Opened 6 years ago
Last modified 6 years ago
#2394 feedback defect
Residues added to protein chain save out of order in PDB
Reported by: | Tristan Croll | Owned by: | pett |
---|---|---|---|
Priority: | moderate | Milestone: | |
Component: | Input/Output | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
If I add a residue to a protein chain (e.g. to the N-terminus using the quick-and-dirty method in the latest ISOLDE build:
m = session.models.list()[0] from chimerax.atomic import Residue from chimerax.isolde.atomic.building.build_utils import add_amino_acid_residue add_amino_acid_residue(m, 'ALA', next_res=m.residues[m.residues.polymer_types==Residue.PT_AMINO][0])
... then on saving to PDB the new residue is found at the end of the PDB file, and gets treated by ChimeraX on reloading as if it's a covalently-bound ligand (and PHENIX just doesn't bond it to the main chain at all). Writing to mmCIF seems to put it in the right place, though. Also writes correctly after running
from chimerax.atomic import Residues m.reorder_residues(Residues(sorted(m.residues, key=lambda r: (r.chain_id, r.number, r.insertion_code))))
reorder_residues
is pretty fast - 800us for 231 residues. Would it make sense to just run it automatically on the added-atoms trigger?
Change History (3)
comment:1 by , 6 years ago
Status: | assigned → feedback |
---|
follow-up: 2 comment:2 by , 6 years ago
OK, that new 'precedes' keyword argument does the trick. After amending my code to use it, saving to PDB and reloading works fine. Previously the new residues were being appended to the end of the residues list, now they insert in the correct positions. Unless I missed something, that wasn't previously possible via the Python API? Didn't know about the circular-permutations wrinkle - I've never knowingly come across a case where the sequence numbering steps down from one residue to the next. You learn something new every day! On 2019-09-09 22:16, ChimeraX wrote:
comment:3 by , 6 years ago
Correct, not previously possible via the Python API (except indirectly through reorder_residues). I had (incorrectly) assumed you were doing it via C++.
Yeah, all kinds of crazy stuff happens in standard PDB files. :-)
--Eric
I had to add a 'precedes' keyword arg to the Python new_residue to test this, but "works for me". After you do your residue addition, is the new residue in the correct position in the structure.residues list?
As for automatically sorting residues, are you talking about you doing that or ChimeraX doing that? ChimeraX cannot do that because residue numbering does not necessarily indicate chain positioning. Numberings for circular permutations that refer to a reference numbering can have a drop in the middle of the sequence.