﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2231	mmCIF: new chain residues saved out of order?	Tristan Croll	Greg Couch	"Unfortunately I can't seem to replicate this now, but just flagging it up in case there's an obvious solution. While working on the model in #2184 I had to rebuild chain AA using chain AB as a template (all the A{ABC...} chains should be identical, but AA had a mismatch both in residue numbering and in sequence). I did this in the shell by first using matchmaker to find the best fit of AB to AA, then (from memory - code may not be exactly correct):

{{{
aa_atoms.delete()
amap = {}
for r in ab_residues:
    new_r = m.new_residue(r.name, 'AA', r.number)
    for a in r.atoms:
       new_a = m.new_atom(a.name, a.element)
       new_a.coord = transform*a.coord
       new_a.bfactor = a.bfactor
       new_r.add_atom(new_a)
       amap[a] = new_a

for b in ab_atoms.intra_bonds:
    m.new_bond(*[amap[a] for a in b.atoms])
}}} 

Anyway, this worked fine in that the rebuilt chain behaved itself in visualisation and simulations, but when I saved the file to mmCIF the chain AA residues were written in random order. I *suspect* what happened is that ChimeraX was treating the chain as non-polymer (perhaps confused by the presence of a ligand with the same chain ID, combined with the non-ideality of the input mmCIF file itself)... as I said, though, I can't seem to replicate it."	defect	closed	minor		Input/Output		can't reproduce		Eric Pettersen				all	ChimeraX
