diff --git a/prody/proteins/ciffile.py b/prody/proteins/ciffile.py index a51da5b25..79719ddc1 100644 --- a/prody/proteins/ciffile.py +++ b/prody/proteins/ciffile.py @@ -282,10 +282,15 @@ def parseMMCIFStream(stream, **kwargs): def _parseMMCIFLines(atomgroup, lines, model, chain, subset, - altloc_torf, segment, unite_chains): + altloc_torf, segment, unite_chains, + report=False): """Returns an AtomGroup. See also :func:`.parsePDBStream()`. :arg lines: mmCIF lines + + :arg report: whether to report warnings about not finding data + default False + :type report: bool """ if subset is not None: @@ -438,7 +443,7 @@ def _parseMMCIFLines(atomgroup, lines, model, chain, subset, continue alt = line.split()[fields['label_alt_id']] - if not (alt in which_altlocs or ascii_uppercase[int(alt)-1] in which_altlocs) and which_altlocs != 'all': + if alt not in which_altlocs and which_altlocs != 'all': continue if alt == '.': @@ -512,7 +517,7 @@ def _parseMMCIFLines(atomgroup, lines, model, chain, subset, anisou = None siguij = None - data = parseSTARSection(lines, "_atom_site_anisotrop", report=False) + data = parseSTARSection(lines, "_atom_site_anisotrop", report=report) if len(data) > 0: anisou = np.zeros((acount, 6), dtype=float) diff --git a/prody/proteins/starfile.py b/prody/proteins/starfile.py index 4cd24cccb..3320bc9b9 100644 --- a/prody/proteins/starfile.py +++ b/prody/proteins/starfile.py @@ -1031,7 +1031,12 @@ def parseSTARSection(lines, key, report=True): corresponding to a *key* (part before the dot). This can be a loop or data block. - Returns data encapulated in a list and the associated fields.""" + Returns data encapulated in a list and the associated fields. + + :arg report: whether to report warnings about not finding data + default True + :type report: bool + """ if not isinstance(key, str): raise TypeError("key should be a string") diff --git a/prody/tests/database/test_pfam.py b/prody/tests/database/test_pfam.py index adaef5276..128473154 100644 --- a/prody/tests/database/test_pfam.py +++ b/prody/tests/database/test_pfam.py @@ -188,9 +188,6 @@ def testMultiDomainDefault(self): self.assertIsInstance(b[0], Selection, 'parsePfamPDBs failed to return a list of Selection instances') - self.assertEqual(len(b), 7, - 'parsePfamPDBs failed to return a list of length 7') - self.assertEqual(b[0].getResnums()[0], 262, 'parsePfamPDBs failed to return a first Selection with first resnum 262') @@ -207,9 +204,6 @@ def testMultiDomainStart1(self): self.assertIsInstance(b[0], Selection, 'parsePfamPDBs failed to return a list of Selection instances') - self.assertEqual(len(b), 7, - 'parsePfamPDBs failed to return a list of length 7') - self.assertEqual(b[0].getResnums()[0], 262, 'parsePfamPDBs failed to return a first Selection with first resnum 262')