Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add report as argument for ciffile and cifheader #1795

Merged
merged 8 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions prody/proteins/ciffile.py
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 6 additions & 1 deletion prody/proteins/starfile.py
Original file line number Diff line number Diff line change
@@ -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")
6 changes: 0 additions & 6 deletions prody/tests/database/test_pfam.py
Original file line number Diff line number Diff line change
@@ -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')