When working with molecular models, it’s often crucial to examine which atoms or residues are near a specific site of interest. Whether you’re studying binding pockets, analyzing molecular interactions, or inspecting local environments, being able to precisely select nearby nodes can save you time and reduce errors.
In SAMSON, the Node Specification Language (NSL) offers a powerful and flexible way to carry out such selections. Specifically, proximity operators allow you to select nodes located within (or beyond) a certain distance from other nodes.
What Are Proximity Operators?
Proximity operators let you define spatial relationships between molecular nodes. Available proximity operators in NSL include:
within {distance} of(short version:w {distance} of)beyond {distance} of(short version:b {distance} of)
These expressions are especially useful when trying to identify interaction zones or isolate regions for more focused analysis.
Examples
Below are several practical use cases and expressions:
C within 5A of "GLN 2"orC w 5A of "GLN 2": Selects all carbon atoms within 5 angstroms of residue GLN 2.node.type atom beyond 5A of "2AZ8-IA"orn.t a b 5A of "2AZ8-IA": Selects all atoms that are more than 5 angstroms away from the group “2AZ8-IA”.
Best Practices
Proximity selections can produce unexpected results if used too broadly. For example, the expression * within 5A of "GLN 2" might return the entire document node—because some atoms in the entire document happen to be close to GLN 2.
To avoid this, always specify the type of node you expect in the result. For example:
n.t a within 5A of "GLN 2": Ensures that only atoms are returned.n.t a within 5A of "GLN 2" out of "GLN 2": This excludes atoms that are already part of GLN 2.
Why This Matters
This level of precision is especially helpful when building selection masks, visualizing interactions, or extracting subsets for simulation. Since molecular modeling often focuses on local interactions, these proximity operators allow modelers to create custom selections tailored to specific research questions.
Combine with Other NSL Features
Proximity selections can be used in combination with other NSL expressions. For example:
C w 5A of "GLN 2" and not r.t GLN: Select carbon atoms near GLN 2, but not those that are part of any GLN residue.
Thanks to NSL, you have full control over how nodes are selected, filtered, and manipulated in SAMSON. This can lead to more efficient workflows and deeper insights.

To learn more about proximity operators and other powerful features of NSL, please visit the full documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON from https://www.samson-connect.net.
