mirror of
https://github.com/biopython/biopython.git
synced 2025-10-20 21:53:47 +08:00
Fix mmCIF parsing bug with underscores
* Allow underscore in non-first columns * Add test case Squashed commit of pull request #1349
This commit is contained in:
@ -38,7 +38,11 @@ class MMCIF2Dict(dict):
|
||||
n = 0
|
||||
continue
|
||||
elif loop_flag:
|
||||
if token.startswith("_"):
|
||||
# The second condition checks we are in the first column
|
||||
# Some mmCIF files (e.g. 4q9r) have values in later columns
|
||||
# starting with an underscore and we don't want to read
|
||||
# these as keys
|
||||
if token.startswith("_") and (n == 0 or i % n == 0):
|
||||
if i > 0:
|
||||
loop_flag = False
|
||||
else:
|
||||
|
10
Tests/PDB/4Q9R_min.cif
Normal file
10
Tests/PDB/4Q9R_min.cif
Normal file
@ -0,0 +1,10 @@
|
||||
data_4Q9R
|
||||
loop_
|
||||
_pdbx_audit_revision_item.ordinal
|
||||
_pdbx_audit_revision_item.revision_ordinal
|
||||
_pdbx_audit_revision_item.data_content_type
|
||||
_pdbx_audit_revision_item.item
|
||||
1 5 'Structure model' '_atom_site.B_iso_or_equiv'
|
||||
2 5 'Structure model' '_atom_site.Cartn_x'
|
||||
3 5 'Structure model' '_atom_site.Cartn_y'
|
||||
4 5 'Structure model' '_atom_site.Cartn_z'
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user