A large molecular structure can contain thousands of residues, and scrolling through it one residue at a time is a slow way to answer focused questions: Where are the acidic residues? Which parts of the chain form helices? Are there unusual residue names in this model? SAMSON’s Node Specification Language (NSL) lets you describe the residues you want to find, using their identity, properties, or structural context.
The key idea is to search at the residue level. Residue attributes use the residue namespace, with the short forms res and r. That means a query such as r.t LYS matches lysine residues—not just individual atoms named or typed in some particular way. Once you have a residue-focused query, you can use the result to direct your inspection toward a smaller, more meaningful part of the model.
Start with residue identity
If you already know which residue types you are looking for, use type, abbreviated t. For example, r.t HIS finds histidines, while r.t LYS, PRO matches lysines and prolines. This can be useful when checking particular amino acids in a binding site or reviewing a sequence-specific region.
You can also search by residue sequence number. The query r.id == 42 matches the residue whose sequence number is 42. To search multiple ranges, use r.id 1:10, 20:30. This is handy when you have residue numbering from a structure or analysis and want to locate those positions in the model. The sequence number is the structure ID, so it is worth checking that the numbering in your reference matches the numbering in the structure.
Sort by chemical character
Residue properties help turn broad questions into precise searches. To find residues with negative or positive side-chain charge, use r.c neg or r.c pos. You can request more than one listed category, as in r.c neu, pos, which matches neutral or positively charged amino acid residues.
Charge and polarity are related, but they are not interchangeable labels. The charge attribute describes side-chain charge, whereas formalCharge is a numeric total formal charge for the residue. For example, r.fc 6:8 searches for residues with formal charge between 6 and 8. For side-chain character, r.p polar finds polar residues, and r.p acidic, basic finds residues with acidic or basic side chains. Keeping those meanings separate can prevent a query from answering a different question than the one you intended.
Bring structural context into the search
When the question is about protein structure rather than chemistry alone, use secondaryStructure, abbreviated ss. For example, r.ss h selects residues in alpha helices; r.ss a, b matches alpha-helical and beta-strand residues. The documented aliases include helix for alpha and strand for beta, so you can use either the longer descriptions or the shorter codes.
Other useful checks include r.caab for residues with a complete amino-acid backbone, r.ter for terminal residues, and r.srn or r.nsrn for standard or non-standard PDB residue names. These can help when inspecting whether a structure contains incomplete backbones, chain ends, or residue names that deserve a closer look.
When you need atoms inside selected residues
Some tasks start with residues but need to identify their atoms. NSL supports expressions that connect an atom query to a residue property. For example, node.type atom in residue.aminoAcid (short form: n.t a in r.aa) matches atoms in amino-acid residues. To find alpha carbons in valines, use "CA" in r.t VAL. For terminal residues, "CA" in r.ter matches alpha carbons by name in those residues.
A practical workflow is to begin with the simplest attribute that answers your question, then use the result to guide closer inspection. Use residue type or sequence number when you know what or where to look; use charge, polarity, or secondary structure when you are exploring a chemical or structural pattern. Checking the exact meaning of each attribute—especially the distinction between side-chain charge and formal charge—helps keep the search precise.
For the complete list of residue attributes, aliases, and examples, see the SAMSON residue attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
