﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2394	Residues added to protein chain save out of order in PDB	Tristan Croll	Eric Pettersen	"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?"	defect	feedback	moderate		Input/Output								all	ChimeraX
