“Select the binding site” sounds like a simple instruction—until you have to decide what counts as the site. Do you want whole residues or only atoms? Should nearby waters be included? Are you looking for tight contacts, a broader pocket, or residues that are close to the ligand but not close to water? Each choice can change what you inspect next.
In SAMSON, Node Specification Language (NSL) lets you express these choices as selections and filters. The useful habit is to build a selection in layers: first identify the kind of node you want, then define its context, and finally add chemical or geometric conditions.
Start with the question, not the syntax
Suppose you want the atoms that make up a binding pocket within 5 Å of a ligand. The example is:
n.t a in (n.t r w 5A of n.c lig)
Read it from the inside out. n.c lig identifies the ligand category. The distance condition w 5A of finds residues within 5 Å of it. The outer part, n.t a in, asks for atoms belonging to those residues. That distinction matters: a selection of nearby residues and a selection of all atoms in those residues are not the same result.
If you want just ligand atoms close to receptor atoms, reverse the target of the selection:
(n.t a in n.c lig) w 2A of n.c rec
This selects ligand atoms within 2 Å of the receptor. A narrower distance can help focus attention on tight contacts; a wider one can provide a broader neighborhood. Treat the cutoff as part of the scientific question, not as a universal definition of a contact.
Add chemistry without losing the scope
Once the geometric neighborhood is clear, add the chemical feature you care about. To find polar oxygen or nitrogen atoms in the receptor within 3 Å of the ligand:
(a.s O,N in n.c rec) w 3A of n.c lig
Here, the atom-symbol condition restricts the receptor-side selection to oxygen and nitrogen. This can be more informative than collecting every atom in the same distance range when you are investigating polar contacts.
For a mutagenesis-oriented view, the documentation gives this example:
((n.t r and not r.t GLY,ALA) in n.c rec) w 6A of n.c lig
It focuses on receptor residues near the ligand while excluding glycine and alanine. The key idea is to express the exclusion explicitly, rather than selecting a broad neighborhood and trying to remember which residue types should be ignored afterward.
Use “near” and “not near” together
Sometimes the most useful selection is defined by two distance conditions. For example, pocket-rim residues can be described as residues within 12 Å of the ligand but beyond 7 Å:
(n.t r w 12A of n.c lig) and (n.t r b 7A of n.c lig)
The expression combines an outer limit with an inner exclusion. A similar pattern can help distinguish residues close to a ligand from those that are also close to water. The examples use w for within a distance and b for beyond a distance. Read each condition in context, and check that the selected node type—atom, residue, or another node—is the one your analysis needs.
A practical way to build a selection
- Name the target. Decide whether the result should contain atoms, residues, waters, or another category.
- Set the relationship. Add a distance condition such as
w 4A of n.c lig, or combine within and beyond conditions to define a shell. - Apply chemical filters. Restrict by element, residue type, charge, secondary structure, or another property shown in the expression.
- Check the scope. Ask whether the expression returns the nearby residues themselves or atoms inside those residues. Nesting with
incan change that answer.
This layered approach makes NSL expressions easier to read, adapt, and explain to collaborators. A cutoff, a residue exclusion, or a change from residues to atoms can be adjusted without rebuilding the selection from scratch. It also makes the selection’s intent visible: a pocket definition, a polar-contact search, and a clash check are different questions, even when all involve distances to a ligand.
For more selection patterns and filters, see the NSL examples reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
