Hi André, As far as I know there is no way to do this with ChimeraX's command-line syntax, so I am going to assume you are asking how to do this in Python. The following Python code will put the starting and ending backbone atom of each chain into a list named 'terminal_atoms':
from chimerax.atomic import all_atomic_structures, Residue
terminal_atoms = []
for s in all_atomic_structures(session):
for chain in s.chains:
ordered_bb_names = Residue.aa_min_ordered_backbone_names if chain.polymer_type == Residue.PT_AMINO \
else Residue.na_min_ordered_backbone_names
existing_residues = chain.existing_residues
terminals = []
for terminal_residue, bb_names in [(existing_residues[0], ordered_bb_names),
(existing_residues[-1], reversed(ordered_bb_names))]:
for bb_name in bb_names:
a = terminal_residue.find_atom(bb_name)
if a:
terminals.append(a)
break
else:
print("No backbone atoms found in %s; skipping chain" % terminal_residue)
break
else:
terminal_atoms.extend(terminals)
For your convenience, I've attached a file containing the above code.
--Eric
Eric Pettersen
UCSF Computer Graphics Lab