<div dir="ltr"><font face="arial, helvetica, sans-serif" color="#000000">Dear all,</font><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">I am trying to write a small function to fuse a number of pubs in a single one,</font></div><div><font face="arial, helvetica, sans-serif" color="#000000">by adding them as models to an structure object. The code looks like this:</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><div><font face="arial, helvetica, sans-serif" color="#000000">def fuse_pdbs(list_of_filepaths,path_pdb):</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> list_of_structures=[]</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> parser=PDBParser()</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> for pdb_file in list_of_filepaths:</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> structure=parser.get_structure(pdb_file[:-4],pdb_file)</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> list_of_structures.append(structure)</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> main_structure=list_of_structures[0]</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> for x,structure in enumerate(list_of_structures):</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> #print "Processing ",structure," ",x</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> model=structure[0]</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> if x!=0:</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> <a href="http://model.id">model.id</a>=x</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> main_structure.add(model)</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> print Selection.unfold_entities(main_structure,'M') </font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> io=PDBIO()</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> io.set_structure(main_structure)</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"> io.save(path_db)</font></div></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">The print statement shows the following output:</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">[<Model id=0>, <Model id=1>, <Model id=2>, <Model id=3>, <Model id=4>, <Model id=5>, <Model id=6>, <Model id=7>, <Model id=8>, <Model id=9>, <Model id=10>, <Model id=11>]</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo"><br></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif">So I believe I have correctly generated the object. However, the pub file generated is saving all models with id 0, plus it has some END keywords that I think are not correct. It looks like this (I am showing the last part of the first model and the first one from the second):</font></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo"><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 168 N ILE D 99 -5.026 -38.437 15.960 1.00 22.23 N </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 169 CA ILE D 99 -5.870 -37.247 15.926 1.00 20.60 C </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 170 C ILE D 99 -6.803 -37.455 14.742 1.00 20.32 C </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 171 O ILE D 99 -6.378 -37.412 13.580 1.00 21.10 O </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 172 CB ILE D 99 -5.028 -35.954 15.704 1.00 20.81 C </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">TER</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ENDMDL</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">END</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">MODEL 0</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 1 N ILE D 25 -4.486 28.320 36.177 1.00 13.13 N </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 2 CA ILE D 25 -3.263 27.547 36.087 1.00 15.38 C </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 3 C ILE D 25 -3.596 26.073 36.119 1.00 16.87 C </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">
</p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">ATOM 4 O ILE D 25 -4.286 25.599 37.026 1.00 17.23 O </p><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo"><br></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif">I am not sure about what could be causing the problem, or if I can solve it by adding some keyword to the write statement, indicating that it is like an NMR model? Maybe I am missing something obvious, but I would be glad to know it :)</font></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif"><br></font></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif">Best,</font></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif"><br></font></p><p style="margin:0px;line-height:normal"><font face="arial, helvetica, sans-serif">Claudia </font></p></div></div>