<div dir="ltr">Dear all,<div><br></div><div>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:</div><div>







<p class=""><span class="">  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</span></p>
<p class=""><span class="">    fp.write("MODEL      %s\n" % model.serial_num)</span></p>
<p class=""><span class="">AttributeError: 'Residue' object has no attribute 'serial_num'</span></p><p class=""><span class=""><br></span></p><p class=""><span class="">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.</span></p><p class=""><span class="">This is the relevant piece of code where the error happens:</span></p><p class=""><span class="">                        </span><span class="">if</span><span class=""> add==</span><span class="">True</span><span class=""> </span><span class="">and</span><span class=""> checkres!=resi.get_full_id()[-</span><span class="">1</span><span class="">]:</span></p><p class=""><span class="">                              ncheckres=checkres[</span><span class="">1</span><span class="">]</span></p><p class=""><span class="">                              </span><span class="">print</span><span class=""> </span><span class="">"Adding ncheckres"</span><span class="">,ncheckres</span></p><p class=""><span class="">                              </span><span class="">print</span><span class=""> </span><span class="">"dictio_template[ncheckres]['residue_object']"</span><span class="">,dictio_template[ncheckres][</span><span class="">'residue_object'</span><span class="">]</span></p><p class=""><span class="">                              checkresobj=dictio_template[ncheckres][</span><span class="">'residue_object'</span><span class="">]</span></p><p class=""><span class="">                              </span><span class="">#print "resi.serial_num",resi.serial_num()</span></p><p class=""><span class="">                              </span><span class="">#print "list_res[i+1].serial_num",list_res[i+1].serial_num()</span></p><p class=""><span class="">                              </span><span class="">#print "checkresobj.serial_num",checkresobj.serial_num()</span></p><p class=""><span class="">















</span></p><p class=""><span class="">                              structure.add(dictio_template[ncheckres][</span><span class="">'residue_object'</span><span class="">]) </span></p><p class=""><span class="">Thanks in advance,</span></p><p class=""><span class=""><br></span></p><p class=""><span class="">Claudia</span></p></div></div>