From 5c4e8a51f3a3e70530886aab3a233b3c175b5733 Mon Sep 17 00:00:00 2001 From: hlasimpk Date: Fri, 14 Feb 2020 16:39:04 +0000 Subject: [PATCH 1/2] v1.5.1 --- ample/util/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ample/util/version.py b/ample/util/version.py index f8d1a078..55184615 100644 --- a/ample/util/version.py +++ b/ample/util/version.py @@ -1,3 +1,3 @@ -__version_info__ = (1, 5, 0) +__version_info__ = (1, 5, 1) __version__ = '.'.join(str(v) for v in __version_info__) __git_revno__ = "b350b9257de3481d7787ba8993a672245dd29549" From 271891c46afea8d9ae095309a8b9ef2f1046f4d5 Mon Sep 17 00:00:00 2001 From: hlasimpk Date: Mon, 17 Feb 2020 15:52:56 +0000 Subject: [PATCH 2/2] Fixed a couple of bugs to ensure test cases are all working --- ample/modelling/tests/test_rosetta_model.py | 22 ++++++++++++++++++++- ample/util/mtz_util.py | 6 ++++-- ample/util/rio.py | 4 ++-- ample/util/tests/test_reference_manager.py | 9 ++++++++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/ample/modelling/tests/test_rosetta_model.py b/ample/modelling/tests/test_rosetta_model.py index 3a9fd47c..1dd9ba8d 100644 --- a/ample/modelling/tests/test_rosetta_model.py +++ b/ample/modelling/tests/test_rosetta_model.py @@ -1,5 +1,6 @@ import os import shutil +import sys import unittest from ample import constants @@ -38,10 +39,29 @@ def testMultimerConstraints(self): AtomPair CA 3B CA 3C FLAT_HARMONIC 10.00 3.00 5.00 AtomPair CA 4B CA 4C FLAT_HARMONIC 10.00 3.00 5.00 """ + ref_windows = 'AtomPair CA 1 CA 4 FLAT_HARMONIC 6.00 3.00 5.00\r\n' \ + 'AtomPair CA 1A CA 1B FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 2A CA 2B FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 3A CA 3B FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 4A CA 4B FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 1 CA 4 FLAT_HARMONIC 6.00 3.00 5.00\r\n' \ + 'AtomPair CA 1A CA 1C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 2A CA 2C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 3A CA 3C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 4A CA 4C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 1 CA 4 FLAT_HARMONIC 6.00 3.00 5.00\r\n' \ + 'AtomPair CA 1B CA 1C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 2B CA 2C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 3B CA 3C FLAT_HARMONIC 10.00 3.00 5.00\r\n' \ + 'AtomPair CA 4B CA 4C FLAT_HARMONIC 10.00 3.00 5.00\r\n' + with open(cfile) as f: fstr = f.read() # self.assertEquals(fstr, ref, "Contents of constraints files don't match: {}".format(cfile)) - self.assertEquals(fstr, ref) + if sys.platform.startswith("win"): + self.assertEquals(fstr, ref_windows) + else: + self.assertEquals(fstr, ref) os.unlink(cfile) def XtestMakeFragments(self): diff --git a/ample/util/mtz_util.py b/ample/util/mtz_util.py index c4c51019..b05fc34e 100644 --- a/ample/util/mtz_util.py +++ b/ample/util/mtz_util.py @@ -165,11 +165,13 @@ def processReflectionFile(amoptd): exit_util.exit_error(msg) cp = cif_parser.CifParser() + mtz = cp.sfcif2mtz(amoptd['sf_cif']) # See if reflections have been set aside for Rfree or if we need to calculate - if cp.hasRfree and cp.reflnStatus: + if cp.hasRfree: logger.info("sfcif2mtz: no valid RFREE data so removing FREE column added by mtz2cif") - mtz = cp.sfcif2mtz(amoptd['sf_cif']) amoptd['mtz'] = del_column(mtz, 'FREE') + else: + amoptd['mtz'] = mtz # Now have an mtz so check it's valid if not amoptd['mtz'] or not os.path.isfile(amoptd['mtz']): diff --git a/ample/util/rio.py b/ample/util/rio.py index 15560262..65c16231 100644 --- a/ample/util/rio.py +++ b/ample/util/rio.py @@ -455,14 +455,14 @@ def parseNcontLog(self, contactData, logfile=None, clean_up=True): aa1 = c[11:14] # Will get key error for all-atom if there is solvent etc. try: - d['aa1'] = pdb_edit.three2one[aa1] # get amino acid and convert to single letter code + d['aa1'] = ample_util.three2one[aa1] # get amino acid and convert to single letter code except KeyError: d['aa1'] = 'X' d['chainId2'] = c[32] d['resSeq2'] = int(c[34:38].strip()) aa2 = c[39:42] try: - d['aa2'] = pdb_edit.three2one[aa2] + d['aa2'] = ample_util.three2one[aa2] except KeyError: d['aa2'] = 'X' d['dist'] = float(c[56:62].strip()) diff --git a/ample/util/tests/test_reference_manager.py b/ample/util/tests/test_reference_manager.py index 1d81a50c..d0476ac6 100644 --- a/ample/util/tests/test_reference_manager.py +++ b/ample/util/tests/test_reference_manager.py @@ -1,4 +1,5 @@ """Test functions for util.ample_util""" +import sys import unittest from ample.util import reference_manager @@ -14,8 +15,14 @@ def test_construct_references(self): refMgr = reference_manager.ReferenceManager(options.d) ref_references = '* Bibby et al. (2012). AMPLE: A cluster-and-truncate approach to solve the crystal structures of small proteins using rapidly computed ab initio models. Acta Crystallogr. Sect. D Biol. Crystallogr. 68(12), 1622-1631. [doi:10.1107/S0907444912039194]\n\n* Winn et al. (2011). Overview of the CCP4 suite and current developments. Acta Crystallographica Section D 67(4), 235-242. [doi:10.1107/S0907444910045749]\n\n* Thomas et al. (2015). Routine phasing of coiled-coil protein crystal structures with AMPLE. IUCrJ 2(2), 198-206. [doi:10.1107/S2052252515002080]\n\n* Simkovic et al. (2016). Residue contacts predicted by evolutionary covariance extend the application of ab initio molecular replacement to larger and more challenging protein folds. IUCrJ 3(4), 259-270. [doi:10.1107/S2052252516008113]\n\n* Bradley et al. (2005). Toward High-Resolution de Novo Structure Prediction for Small Proteins. Science 309(5742), 1868-1871. [doi:10.1126/science.1113801]\n\n* Grosse-Kunstleve et al. (2002). The Computational Crystallography Toolbox: crystallographic algorithms in a reusable software framework. Journal of Applied Crystallography 35(1), 126-136. [doi:10.1107/S0021889801017824]\n\n* Theobald et al. (2006). THESEUS: maximum likelihood superpositioning and analysis of macromolecular structures. Bioinformatics 22(17), 2171-2172. [doi:10.1093/bioinformatics/btl332]\n\n* Krissinel et al. (2012). Enhanced fold recognition using efficient short fragment clustering. Journal of molecular biochemistry 1(2), 76-85. [doi:]\n\n* Zhang et al. (2004). SPICKER: A clustering approach to identify near-native protein folds. Journal of Computational Chemistry 25(6), 865-871. [doi:10.1002/jcc.20011]\n\n* Keegan et al. (2018). Recent developments in MrBUMP: better search-model preparation, graphical interaction with search models, and solution improvement and assessment. Acta Crystallographica Section D 74(3), 167-182. [doi:10.1107/S2059798318003455]\n\n* Murshudov et al. (1997). Refinement of macromolecular structures by the maximum-likelihood method. Acta Crystallogr. Sect. D Biol. Crystallogr. 53(3), 240-255. [doi:10.1107/S0907444996012255]\n\n* Thorn et al. (2013). Extending molecular-replacement solutions with SHELXE. Acta Crystallogr. Sect. D Biol. Crystallogr. 69(11), 2251-2256. [doi:10.1107/S0907444913027534]\n\n* Cohen et al. (2008). ARP/wARP and molecular replacement: the next generation. Acta Crystallogr. Sect. D Biol. Crystallogr. 64(1), 49-60. [doi:10.1107/S0907444907047580]\n\n' + + ref_references_windows = '* Bibby et al. (2012). AMPLE: A cluster-and-truncate approach to solve the crystal structures of small proteins using rapidly computed ab initio models. Acta Crystallogr. Sect. D Biol. Crystallogr. 68(12), 1622-1631. [doi:10.1107/S0907444912039194]\r\n\r\n* Winn et al. (2011). Overview of the CCP4 suite and current developments. Acta Crystallographica Section D 67(4), 235-242. [doi:10.1107/S0907444910045749]\r\n\r\n* Thomas et al. (2015). Routine phasing of coiled-coil protein crystal structures with AMPLE. IUCrJ 2(2), 198-206. [doi:10.1107/S2052252515002080]\r\n\r\n* Simkovic et al. (2016). Residue contacts predicted by evolutionary covariance extend the application of ab initio molecular replacement to larger and more challenging protein folds. IUCrJ 3(4), 259-270. [doi:10.1107/S2052252516008113]\r\n\r\n* Bradley et al. (2005). Toward High-Resolution de Novo Structure Prediction for Small Proteins. Science 309(5742), 1868-1871. [doi:10.1126/science.1113801]\r\n\r\n* Grosse-Kunstleve et al. (2002). The Computational Crystallography Toolbox: crystallographic algorithms in a reusable software framework. Journal of Applied Crystallography 35(1), 126-136. [doi:10.1107/S0021889801017824]\r\n\r\n* Theobald et al. (2006). THESEUS: maximum likelihood superpositioning and analysis of macromolecular structures. Bioinformatics 22(17), 2171-2172. [doi:10.1093/bioinformatics/btl332]\r\n\r\n* Krissinel et al. (2012). Enhanced fold recognition using efficient short fragment clustering. Journal of molecular biochemistry 1(2), 76-85. [doi:]\r\n\r\n* Zhang et al. (2004). SPICKER: A clustering approach to identify near-native protein folds. Journal of Computational Chemistry 25(6), 865-871. [doi:10.1002/jcc.20011]\r\n\r\n* Keegan et al. (2018). Recent developments in MrBUMP: better search-model preparation, graphical interaction with search models, and solution improvement and assessment. Acta Crystallographica Section D 74(3), 167-182. [doi:10.1107/S2059798318003455]\r\n\r\n* Murshudov et al. (1997). Refinement of macromolecular structures by the maximum-likelihood method. Acta Crystallogr. Sect. D Biol. Crystallogr. 53(3), 240-255. [doi:10.1107/S0907444996012255]\r\n\r\n* Thorn et al. (2013). Extending molecular-replacement solutions with SHELXE. Acta Crystallogr. Sect. D Biol. Crystallogr. 69(11), 2251-2256. [doi:10.1107/S0907444913027534]\r\n\r\n* Cohen et al. (2008). ARP/wARP and molecular replacement: the next generation. Acta Crystallogr. Sect. D Biol. Crystallogr. 64(1), 49-60. [doi:10.1107/S0907444907047580]\r\n\r\n' + # We may not run (e.g.) arpwarp, so need to be tolerant of missing citations. - self.assertGreaterEqual(ref_references.index(refMgr.citation_list_as_text), 0) + if sys.platform.startswith("win"): + self.assertGreaterEqual(ref_references_windows.index(refMgr.citation_list_as_text), 0) + else: + self.assertGreaterEqual(ref_references.index(refMgr.citation_list_as_text), 0) options.d['nmr_model_in'] = 'foo' options.d['transmembrane'] = True