[Biopython-dev] [Biopython - Bug #2943] (Closed) MMCIFParser only handling a single model.

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Mon Apr 23 17:00:15 UTC 2012

Issue #2943 has been updated by Peter Cock.

Status changed from New to Closed
% Done changed from 0 to 100

This should be working on the trunk now ready for Biopython 1.60 - thanks Lenna. See this commit and those preceding it:

If we've missed anything please reopen this bug. Thanks Paul!
Bug #2943: MMCIFParser only handling a single model.

Author: TallPaul empty
Status: Closed
Priority: Normal
Assignee: Biopython Dev Mailing List
Category: Main Distribution
Target version: 1.52

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 
        #Added by Paul T. Bathen Nov 2009
Make the following changes:
        #Modified by Paul T. Bathen Nov 2009: comment out this line
        #Modified by Paul T. Bathen Nov 2009: comment out this line
        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=" "
            #Added by Paul T. Bathen Nov 2009
            model_id = model_list[i]
            if current_model_id != model_id:
                current_model_id = 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. 


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org

More information about the Biopython-dev mailing list