A familiar molecular-modeling frustration: you know which part of a structure you need—a particular residue, a stretch of sequence, or a loop—but the structure contains many atoms, chains, and residue names. A useful first step is to be precise about the level you want to match. In SAMSON’s Node Specification Language (NSL), residue attributes describe residues; with the short prefix r, they let you search by residue type, structural ID, or secondary structure.
Start with residue identity
To find one amino acid type, use r.t followed by its residue code. For example, r.t ALA matches alanines, and r.t HIS matches histidines. You can list multiple types separated by commas: r.t LYS, PRO matches lysines or prolines. This is handy when the question is about a set of residue types rather than one position.
The residue type list also includes nucleic-acid codes such as A, U, DA, and DT, as well as amino-acid codes such as GLY, LYS, and TRP. If you are searching a structure with both proteins and nucleic acids, check that the codes you use correspond to the kind of residue you intend to find.
Use structural IDs for positions
When you have a residue number from a structure file or another analysis, query r.id. For example, r.id == 42 matches the residue with sequence number 42. To search separated intervals, use r.id 1:10, 20:30. This can be more convenient than entering each position separately.
One useful distinction: a residue sequence number is a structural identifier, while a residue type describes chemical identity. If you are trying to locate “the lysine at position 42,” these attributes represent two different parts of the description. You can check them as separate searches rather than treating the number and the amino-acid code as interchangeable.
Find helices, strands, and loops
For a structural question, use r.ss. The documented values include alpha for alpha helices, beta for beta strands, and unstructured for loop regions. Short forms can make repeated queries quicker: r.ss h matches alpha-helical residues, while r.ss a, b matches residues in alpha helices or beta sheets. The aliases include helix and h for alpha, strand and s for beta, and loop and l for unstructured regions.
When you need atoms, not residues
Some tasks call for a named atom within a residue, rather than the residue itself. The documented expression "CA" in r.t VAL matches alpha carbons by name in valine residues. Likewise, "CA" in r.ter matches alpha carbons in terminal residues. These examples are useful reminders that NSL can express a relationship between an atom name and the residue it belongs to—so you can avoid confusing a residue-level match with an atom-level one.
A practical way to build a query
When a search feels ambiguous, build it from the question outward: decide whether you need a residue or an atom; identify whether the relevant clue is type, sequence number, or secondary structure; then choose the corresponding attribute. Test a simple expression first, such as r.t VAL or r.ss loop, and use a more specific expression when you know the structural ID or atom name. This habit makes it easier to spot whether a mismatch comes from the residue code, the numbering, or the level of the structure you are matching.
For the complete attribute list and more examples, see the SAMSON residue attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
