Hi, I have the following Python code to rename the first residue in a PDB file. The renaming works except that OpenBabel appends a '1', obviously the residue number, to the new name in the mol2 output. How can I force OpenBabel to stop altering my residue name?
import pybel
mol = pybel.readfile('pdb', 'test.pdb').next()
obmol = mol.OBMol
res1 = obmol.GetResidue(0)
res1.SetName('FOOBAR') # appends '1' to 'FOOBAR'
mol.write('mol2', 'test.mol2', overwrite = True)
Cheers,
Hannes.
--
Scanned by iCritical.
import pybel
mol = pybel.readfile('pdb', 'test.pdb').next()
obmol = mol.OBMol
res1 = obmol.GetResidue(0)
res1.SetName('FO')
mol.write('mol2', 'test.mol2', overwrite = True)
test.pdb
Description: application/palm-database
------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
