pymol-open-source
pymol-open-source copied to clipboard
Incorrect TER record format
As of v2.3 the setting pdb_use_ter_records
now inserts TER
records in all the correct places (i.e. not at gaps within a chain). However, there seems to be a regression in terms of the format of the TER
records that it does insert. It seems to be hard-coded to "TER \n"
:
https://github.com/schrodinger/pymol-open-source/blob/67248b9120fd36b7714af50218dfb89ea54c5035/layer3/MoleculeExporter.cpp#L479
My understanding is that it should have a serial number that increments the preceding record by 1 and should include a repeat of the residue name, chain ID and residue ID from the preceding terminal residue. One effect of this is that subsequent ATOM
records (in a different chain) or any subsequent HETATM
records may also need their serial number incremented by 1 to avoid a duplicate.
Thanks @mcs07
Link to spec: http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#TER
I did notice that Gemmi has a --short-ter
option to write "iotbx-compatible" TER records without numbers. I'm not sure what the rationale is for diverging from the spec - maybe to allow atom serial numbers to match the mmCIF version? If there is a good reason, maybe PyMOL should have a setting to choose whether PDB output is spec-compliant or iotbx-compliant.
TER records are a weird feature, it contains redundant information, I don't really understand why an application would depend on that. Do you have an example of an application which depends on the full TER record (works incorrectly with a short TER record)?
I'm reluctant to change PyMOL's PDB export once again unless we have some proof that it really matters. So if anyone knows an application which can't handle short TER records, please leave a comment here.
Hi, I am having problems with PLIP because it can't handle short TER records. https://github.com/pharmai/plip/issues/113