A common molecular-modeling task sounds simple: select everything near a ligand. But a broad distance selection can mix receptor atoms, waters, ions, and ligand atoms—and a single cutoff rarely answers every question. The useful step is to define both what you want to select and what it should be near.
In SAMSON’s Node Specification Language (NSL), many contact selections follow a readable pattern: specify a node or chemical feature, then use a distance condition to relate it to another group. The examples below show how that pattern can turn an open-ended search into a focused selection.
Start with the question, not the cutoff
If you want receptor residues close to a ligand, this expression selects residues within 6 Å while excluding glycine and alanine:
|
1 |
((n.t r and not r.t GLY,ALA) in n.c rec) w 6A of n.c lig |
The expression names the target (residues), limits the target to the receptor, excludes two residue types, and then applies the distance relationship to the ligand. That structure is useful to keep in mind when adapting the selection: change the target or the filter to match the question, rather than changing the distance alone.
Choose the right level of detail
Sometimes residues are the useful answer; sometimes you need atoms. To inspect receptor atoms in the binding pocket—defined here as atoms belonging to residues within 5 Å of the ligand—use:
|
1 |
n.t a in (n.t r w 5A of n.c lig) |
This is a two-step idea expressed as one selection: identify nearby residues, then select their atoms. By contrast, this selects ligand heavy atoms that are within 2 Å of receptor atoms:
|
1 |
(n.t a in n.c lig) w 2A of n.c rec |
For a steric-clash inspection, the example narrows both sides to non-hydrogen atoms and uses a 2.2 Å cutoff:
|
1 |
((n.t a in n.c lig) and not a.s H) w 2.2A of ((n.t a in n.c rec) and not a.s H) |
These selections answer different questions: pocket composition, close ligand–receptor contacts, and possible tight contacts. Keeping those intentions separate makes the resulting selection easier to interpret.
Use “near” and “away” together
Water molecules can be important in a binding site, but not every nearby water is equally relevant. To find waters within 4 Å of a ligand:
|
1 |
n.c wat w 4A of n.c lig |
To find water oxygens that are within 3 Å of both receptor and ligand, combine two distance conditions:
|
1 |
(a.s O in n.c wat) and (n.t a w 3A of n.c rec) and (n.t a w 3A of n.c lig) |
Other examples use the b distance relation to exclude nodes within a cutoff. For instance, receptor atoms within 5 Å of a ligand but more than 3 Å from water oxygens are expressed as:
|
1 |
(n.t a in n.c rec) and (n.t a w 5A of n.c lig) and (n.t a b 3A of (a.s O in n.c wat)) |
This combination is handy when the scientific question is explicitly comparative: near one group, but not near another. The cutoff is part of the selection’s definition, so choose it to match the contact criterion you are investigating.
Make selections easier to reuse
- Name the target first. Decide whether the result should contain atoms, residues, waters, or another node type.
- Limit the relevant groups. Expressions such as
n.c rec,n.c lig, andn.c watmake the intended participants explicit. - Add chemistry filters when they matter. Examples include excluding hydrogen with
not a.s H, selecting oxygen and nitrogen witha.s O,N, or choosing aromatic residues withr.t PHE,TYR,TRP. - Keep the selection aligned with the question. A residue-level result is convenient for identifying pocket regions; an atom-level result is more specific for examining contacts.
NSL expressions are most useful when they make the selection’s logic visible: which nodes are included, which are excluded, and which distance relationships define the result. That makes it easier to adjust a selection for a new ligand, contact threshold, or analysis goal without starting from scratch.
For more examples and the full reference table, see the NSL examples documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
