openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
453 stars 114 forks source link

PDBFixer is changing chain names #230

Open raoufkeskes opened 2 years ago

raoufkeskes commented 2 years ago

hello,

PDBfixer in my case is changing chain names and re-indexing them to alphabet order

initial chains are : {'O', 'F', 'D', 'P'} fixed PDB chains are : {'A', 'B', 'C', 'D'}

fixer = PDBFixer(filename="my_structure.pdb") fixer.findMissingResidues() fixer.findNonstandardResidues() fixer.replaceNonstandardResidues() fixer.findMissingAtoms() fixer.addMissingAtoms() PDBFile.writeFile(fixer.topology, fixer.positions, open("my_fixed_structure.pdb", 'w'))

my structure : https://www.filemail.com/d/rrqrxvfuhrgxkdp

peastman commented 2 years ago

In the call to writeFile(), add the argument keepIds=True. See the API documentation at http://docs.openmm.org/latest/api-python/generated/openmm.app.pdbfile.PDBFile.html#openmm.app.pdbfile.PDBFile.writeFile, especially the warning about that argument.