From ligand to pocket: a practical way to build molecular selections

Finding the atoms around a ligand sounds simple—until the selection includes waters, hydrogens, distant residues, or atoms from the wrong chain. A useful way to reduce that friction is to build the selection in stages: define the ligand, choose a distance cutoff, then add chemical or structural filters only when they answer a specific question.

In SAMSON, the Node Specification Language (NSL) lets you express these selections directly. The examples below focus on a common modeling task: identifying a ligand’s local environment without confusing a geometric neighborhood with a confirmed chemical interaction.

Start with a distance-defined pocket

To select atoms belonging to residues within 5 Å of a ligand, use:

n.t a in (n.t r w 5A of n.c lig)

The expression first finds residues (n.t r) within 5 Å of ligand nodes (n.c lig), then selects the atoms (n.t a) in those residues. This distinction matters: selecting nearby residues and selecting nearby atoms are not the same operation. The first can give you whole pocket residues; the second can focus on atoms themselves.

For only the ligand atoms that lie close to the receptor, reverse the selection target:

(n.t a in n.c lig) w 2A of n.c rec

Changing the distance changes the question. A tighter cutoff can help inspect close contacts, while a wider one can include the broader pocket environment. A distance-based selection reports proximity; by itself, it does not establish a bond, favorable interaction, or biological role.

Make the selection chemically useful

Once you have a geometric neighborhood, add filters that match the analysis. For a quick ligand-contact set containing non-hydrogen ligand atoms, use:

(n.t a in n.c lig) and not a.s H

To focus on polar oxygen and nitrogen atoms in the receptor near the ligand, use:

(a.s O,N in n.c rec) w 3A of n.c lig

This can help narrow a visual inspection to atoms that may be relevant to polar contacts. It is still a candidate-selection step: distance and element identity alone do not prove a hydrogen bond.

You can also ask whether nearby residues belong to a particular category. For example, to find aromatic residues within 5 Å of the ligand:

(r.t PHE,TYR,TRP,HIS) and (n.t r w 5A of n.c lig)

Or, to select positively or negatively charged residues near the ligand:

(r.c positive, negative) and (n.t r w 8A of n.c lig)

These filters help turn a large neighborhood into a more interpretable set, while keeping the geometric cutoff explicit.

Separate nearby waters from the rest

Waters can be important in a binding site, but they can also complicate an initial pocket view. To select waters within 4 Å of a ligand, use:

n.c wat w 4A of n.c lig

For a different question—receptor atoms within 5 Å of the ligand but more than 3 Å from any water oxygen—the example is:

(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))

Here, w expresses a within-distance selection and b expresses being beyond the specified distance. This makes it possible to separate overlapping spatial criteria instead of relying on visual guesswork.

Build readable selections, not just longer ones

When a selection becomes hard to understand, split the task conceptually: first identify the relevant node type, then apply the distance condition, and finally add exclusions or properties. Parentheses make the intended grouping visible. For example, the ligand-near-residue step in the pocket expression is grouped before its atoms are selected.

It also helps to name the scientific question before choosing a cutoff. “Show the pocket residues,” “show ligand heavy atoms near the receptor,” and “show polar receptor atoms near the ligand” are three different selections. Keeping them separate makes it easier to inspect results and adjust one criterion without changing the others.

These expressions are starting points from the NSL examples reference. Adapt the distance, node category, and chemical filters to the structure and analysis at hand; a selected set is a way to focus inspection, not a substitute for evaluating the molecular context.

See the NSL examples documentation to learn more.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.