You can add an amino acid to your chain using the following approach. First, select any atom from the residue you want to attach it to. Then in the shell:
m = session.isolde.selected_model
from chimerax.atomic import selected_residues
from chimerax.isolde.atomic.building.build_utils import add_amino_acid_residue
# if you're adding an ARG to the C-terminal end:
add_amino_acid_residue(m, 'ARG', prev_res=selected_residues(session)[0])
# if you're adding to the N-terminal end:
add_amino_acid_residue(m, 'ARG', next_res=selected_residues(session)[0])
It currently makes no attempt to pre-optimise geometry so that'll be pretty crap, but it's usually good enough to easily settle into place (you might occasionally need to "isolde ignore" one or two residues for the first sim). There are a few known bugs:
- when adding into a gap, occasionally the "missing structure" pseudobonds will fail to update correctly, leaving the old pseudobond in place. This doesn't cause any immediate harm, but can mess up the structure on saving if not corrected. To do
so, select the atoms on either end of the offending pseudobond, then:
pbg = m.pseudobond_group[m.PBG_MISSING_STRUCTURE, create_type=None)
from chimerax.atomic import selected_atoms
pbg.pseudobonds[pbg.pseudobonds.between_atoms(selected_atoms(session))].delete()
- very occasionally, and for reasons that still remain mysterious, saving to mmCIF will lead to one or more of the new residues being duplicated - which can be really confusing at first because the coordinates for the new residue will be identical
to the old. If it happens, this can be fixed by taking advantage of the fact that the "extra" residue is not bonded to anything:
m = session.isolde.selected_model
from collections import defaultdict
rmap = defaultdict(list)
for r in m.residues:
sig = (r.chain_id, r.number, r.insertion_code)
rmap[sig].append(r)
for rlist in rmap.values():
if len(rlist) > 1:
for r in rlist:
if len(r.neighbors) == 0:
r.delete()