[Biopython] Problem when adding a residue

Claudia Millán Nebot cmncri at ibmb.csic.es
Mon Jul 25 11:26:25 UTC 2016


Dear all,

I am using Biopython to parse a pdb model extracted from a larger pdb and
if a condition is met, complete it with some residues from the original pdb
model. The residue object that I am trying to add was saved when parsing
the original larger pdb, but when I am trying to add it to the new model I
am getting this error:

  File
"/Library/Python/2.7/site-packages/biopython-1.66-py2.7-macosx-10.11-intel.egg/Bio/PDB/PDBIO.py",
line 187, in save

    fp.write("MODEL      %s\n" % model.serial_num)

AttributeError: 'Residue' object has no attribute 'serial_num'


The pdb model that I am completing might have some changes in the chain
nomenclature, could that be the reason for the error? But apparently is
raised for something related with the model... so I am not sure what is
happening.

This is the relevant piece of code where the error happens:

                        if add==True and checkres!=resi.get_full_id()[-1]:

                              ncheckres=checkres[1]

                              print "Adding ncheckres",ncheckres

                              print
"dictio_template[ncheckres]['residue_object']",dictio_template[ncheckres][
'residue_object']

                              checkresobj=dictio_template[ncheckres][
'residue_object']

                              #print "resi.serial_num",resi.serial_num()

                              #print
"list_res[i+1].serial_num",list_res[i+1].serial_num()

                              #print
"checkresobj.serial_num",checkresobj.serial_num()

                              structure.add(dictio_template[ncheckres][
'residue_object'])

Thanks in advance,


Claudia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20160725/0caaddb3/attachment.html>


More information about the Biopython mailing list