pymol-open-source icon indicating copy to clipboard operation
pymol-open-source copied to clipboard

Incorrect TER record format

Open mcs07 opened this issue 5 years ago • 5 comments

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.

mcs07 avatar Aug 05 '19 09:08 mcs07

Thanks @mcs07

Link to spec: http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#TER

speleo3 avatar Aug 12 '19 07:08 speleo3

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.

mcs07 avatar Aug 12 '19 16:08 mcs07

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)?

speleo3 avatar Aug 15 '19 09:08 speleo3

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.

speleo3 avatar Nov 19 '19 14:11 speleo3

Hi, I am having problems with PLIP because it can't handle short TER records. https://github.com/pharmai/plip/issues/113

fabioatuib avatar May 20 '21 15:05 fabioatuib