[Biopython-dev] [Bug 2943] New: MMCIFParser only handling a single model.
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Tue Nov 3 12:58:37 EST 2009
http://bugzilla.open-bio.org/show_bug.cgi?id=2943
Summary: MMCIFParser only handling a single model.
Product: Biopython
Version: 1.52
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Main Distribution
AssignedTo: biopython-dev at biopython.org
ReportedBy: TallPaulInJax at yahoo.com
MMCIFParser as-written only handles a single model in a protein. Any protein
that has multiple modesl with repeating chains and residues will get an
exception since the residue ID will already exist. Please make the following
changes in MMCIFParser.py:
Change the __doc__ setting:
#Optional __DOC__ change if the new MMCIFlex is not used nor the changes
#to MMCIF2Dict based on the new MMCIFlex.
#Mod by Paul T. Bathen to reflect MMCIFlex built solely in Python
__doc__="mmCIF parser (implemented solely in Python, no lex/flex/C code
needed)"
Regardles of the DOC changes:
Insert the following model_list line
occupancy_list=mmcif_dict["_atom_site.occupancy"]
fieldname_list=mmcif_dict["_atom_site.group_PDB"]
#Added by Paul T. Bathen Nov 2009
model_list=mmcif_dict["_atom_site.pdbx_PDB_model_num"]
try:
Make the following changes:
#Modified by Paul T. Bathen Nov 2009: comment out this line
#current_model_id=0
structure_builder=self._structure_builder
structure_builder.init_structure(structure_id)
#Modified by Paul T. Bathen Nov 2009: comment out this line
#structure_builder.init_model(current_model_id)
structure_builder.init_seg(" ")
#Added by Paul T. Bathen Nov 2009
current_model_id = -1
Make the following changes in the for loop:
#Note by Paul T. Bathen: should MMCIFParser include
#the HOH and WAT stmts in PDBParser immediately below?
#if fieldname=="HETATM":
# if resname=="HOH" or resname=="WAT":
# hetero_flag="W"
# else:
# hetero_flag="H"
if fieldname=="HETATM":
hetatm_flag="H"
else:
hetatm_flag=" "
#Added by Paul T. Bathen Nov 2009
model_id = model_list[i]
if current_model_id != model_id:
current_model_id = model_id
structure_builder.init_model(current_model_id)
#end of addition
After these changes took place, and with the new MMCIFlex and MMCIF2Dict in
place, I was able to parse and test 2beg.cif and pdb2beg.ent and both parsed
with the same number of models, chains, and residues.
Paul
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list