When a molecular model becomes crowded, the hard part is often not seeing atoms—it is finding the right residues. You might need to inspect a helix, isolate charged side chains, locate a particular residue number, or identify chain-end residues. Selecting atoms one at a time is slow and makes it easy to miss part of the feature you meant to examine.
SAMSON’s Node Specification Language (NSL) lets you describe residue-level criteria directly. Residue queries use the residue attribute space, abbreviated r or res. This matters: a query such as r.ss helix describes residues, while a query that uses an atom attribute can target atoms within a residue group.
Start with the question, then choose the attribute
For structural inspection, secondary structure is often a useful first filter. To match residues in alpha helices, use r.ss alpha (or the shorter alias r.ss h). For beta strands, use r.ss beta; for unstructured regions, use r.ss unstructured. You can list alternatives for the same attribute: r.ss alpha, beta matches residues in alpha helices or beta strands.
Residue type is useful when you know the amino acid identity. For example, r.t HIS matches histidines, and r.t LYS, PRO matches lysines or prolines. The documented type values also include nucleic-acid residue codes such as A and DA. This can help avoid relying on visual inspection or assuming every residue in a model is a standard amino acid.
Use chemistry to narrow the search
If the property you care about is a side chain, try charge or polarity. r.c neg finds amino acid residues with a negative side-chain charge; r.c neu, pos matches neutral or positive side-chain charge. For polarity, r.p polar selects polar side chains, while r.p acidic, basic matches acidic or basic side chains. These categories are residue-type properties, not measurements of the residue’s current environment in the modeled structure.
That distinction is useful when interpreting results: a residue’s documented charge or polarity classification should not be confused with its total formal charge or partial charge. For formal charge, use r.fc; for partial charge, use r.pc. For example, r.fc 6:8 describes a formal-charge range, whereas r.pc > 1.5 compares partial charge. The attributes answer different questions, so choose the one that matches your goal.
Locate residues by numbering and context
To find a residue by its structure sequence number, use r.id == 42. Ranges are also supported: r.id 1:10, 20:30 matches residues numbered 1–10 or 20–30. If you are looking for a known amino acid rather than a position, use r.t instead. Keeping those two ideas separate—identity versus sequence number—helps prevent a common mix-up when comparing structures or working with residue numbering that is not continuous.
Terminal residues can be queried with r.ter. To target a particular atom name within terminal residues, the documented form is "CA" in r.ter. Likewise, "CA" in r.t VAL matches alpha carbons in valines. These examples show a practical distinction: residue attributes can describe a group, while an atom-name condition can identify a specific member of that group.
A simple way to build a reliable query
- Define what you mean. Is the target a residue identity, a structural feature, a chemical classification, or a numbered position?
- Choose the matching attribute. Use
r.tfor type,r.ssfor secondary structure,r.corr.pfor side-chain classification, andr.idfor sequence number. - Check the examples and aliases. For instance,
his an alias for helix andposfor positive charge. - Be precise about the target level. Use a residue query when you want residues; use the documented atom-in-residue pattern when you need a named atom within those residues.
Residue-level queries turn a vague visual search into a repeatable specification. They are especially helpful when the structure is large or when you want to revisit the same kind of selection later. For the complete attribute list and additional examples, see the SAMSON residue attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
