Finding the residues you mean can be harder than it sounds. A sequence position is not a residue type; a charged side chain is not the same thing as a nonzero total formal charge; and a query for residues is not always the same as a query for the atoms inside them. These distinctions matter when you want a clean, repeatable selection instead of clicking through a structure one residue at a time.
SAMSON’s Node Specification Language (NSL) lets you describe residues by properties such as type, sequence number, secondary structure, charge, and atom count. Residue queries use the residue attribute space, commonly shortened to r. Here is a practical guide to choosing the right kind of filter.
Start with the question, not the abbreviation
Before writing a query, decide what “the right residues” means for your task:
- Identity: Which amino-acid or nucleic-acid residue types do you need?
- Location in the chain: Which residue sequence numbers are relevant?
- Structure: Are you looking for helices, strands, or loops?
- Chemistry: Do you mean side-chain charge, polarity, or total formal charge?
- Completeness: Do the residues have complete amino-acid backbones?
Being explicit about the question helps avoid a common modeling mistake: using a convenient attribute that sounds similar but measures something different.
Filter by residue identity
Use r.t to match residue types. For example, r.t HIS matches histidines, while r.t LYS, PRO matches lysines and prolines. The documented type values include standard three-letter amino-acid names, as well as nucleic-acid residue codes such as A, DA, and DT.
This is useful when the scientific question is about chemical identity—for example, locating a particular amino-acid type before inspecting its local environment. If you need atoms rather than residue nodes, the documentation also shows the pattern "CA" in r.t VAL, which matches alpha carbons by name in valine residues. The related pattern n.t a in r.aa matches atoms in amino-acid residues.
Use sequence numbers for positions
When you already know the residue numbering, use r.id, the short name for residueSequenceNumber. For example, r.id == 42 targets sequence number 42. A set of intervals can be expressed as r.id 1:10, 20:30.
This is a different kind of filter from residue type. “Residue 42” describes a position in the structure’s numbering; “HIS” describes the chemical type. If a position-specific analysis is important, check which of these you actually mean rather than treating numbering and identity as interchangeable.
Find structural regions
For secondary structure, use r.ss. The aliases make queries quick to read: r.ss h matches alpha helices, and r.ss a, b matches alpha helices and beta strands. Unstructured regions can be specified with u, loop, or l.
A useful way to think about this attribute is that it classifies residues by their secondary-structure state, rather than by their sequence identity. It can therefore answer a different question from r.t, even when both are used to inspect the same part of a protein.
Don’t confuse charge with formal charge
This distinction can prevent misleading selections. r.c classifies amino-acid residues by side-chain charge: r.c neg matches negatively charged side chains, and r.c neu, pos matches neutral or positively charged side chains. By contrast, r.fc refers to a residue’s total formal charge and accepts integers or ranges, such as r.fc 6:8.
Polarity is another separate classification. For example, r.p polar matches residues with polar side chains, while r.p acidic, basic matches acidic or basic side chains. These labels are not substitutes for a numeric charge query.
Check residue completeness and composition
If missing backbone atoms are a concern, r.caab matches residues with complete amino-acid backbones. To filter by composition, use inherited structural-group attributes: r.nat is the number of atoms, r.nC the number of carbons, and r.nO the number of oxygens. For example, r.nat < 1000 applies a numeric condition to atom count, while r.nO 10:20 specifies an interval.
These filters are especially useful when inspecting a structure with unusual or incomplete residues: they let you describe a property directly instead of relying only on a name.
A small checklist for better queries
- Use
r.tfor residue identity andr.idfor sequence numbering. - Use
r.ssfor secondary structure, not residue type. - Use
r.cfor side-chain charge; user.fcfor total formal charge. - Use
inpatterns shown in the documentation when the target should be atoms within matching residues. - Prefer readable full attribute names while learning; switch to short names when you are comfortable with their meaning.
For the complete attribute list, value aliases, and additional examples, see the SAMSON residue attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
