When working with complex molecular systems, it’s often important to isolate specific atom groups for visualization or modification. Yet, selecting atoms manually can become tedious and error-prone, especially with large systems like crystals, biomolecules, or nanostructures. SAMSON’s Atoms Selector Extension offers a precise and flexible solution by allowing users to define atom selections based on mathematical expressions.
This approach is useful in many scenarios, such as:
- Focusing on atoms within a given geometric boundary (spheres, cylinders, boxes)
- Filtering atoms by chain ID or chemical element
- Creating layers or slices for visual analysis
The Atoms Selector Extension uses the same variables, operators, and functions as the Simple Script Extension. Instead of writing full scripts, however, users only need to provide a selection expression.
Example: Cylindrical Selection in a Quartz Crystal
Let’s say you want to isolate a cylindrical region of radius 10 Å centered at the coordinates (15, 15). A simple expression to use in the Atoms Selector would be:
|
1 |
((a.x-15)^2 + (a.y-15)^2) < 100 |
This expression checks if the squared distance of each atom from the cylinder’s axis (assumed along the z-direction) is less than the square of the radius (102 = 100). Any atom matching this criterion will automatically be selected by SAMSON.

Tips for Effective Use
- Control precision: You can modify the center and radius of the cylinder to target different spatial regions.
- Use element filters: Combine spatial filters with chemical identity, such as
a.s=='Si' and ((a.x-15)^2 + (a.y-15)^2) < 100. - Select all: Use
allif your goal is to apply actions globally across the structure before filtering locally through other tools. - Chain-specific selection: Use
a.ci==0to select atoms from a specific chain, which is helpful in biomolecules.
Why This Matters
Being able to precisely define spatial regions with simple expressions helps molecular modelers avoid complex selection workflows. This is especially beneficial for time-sensitive tasks like model curation, visualization setup for publication, or exporting atom subsets for further simulations. It reduces potential mistakes and repetitive clicking, and brings your focus to the actual science of interest.
To explore more use cases and scripts, visit the full documentation page on Making nano-batarangs (and more).
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at www.samson-connect.net.
