Molecular modelers often face a recurring challenge: selecting specific atoms out of a complex structure based on well-defined criteria such as spatial coordinates, atomic types, or custom geometrical constraints. Whether preparing a region for simulation or visualizing a portion of a structure, precision is key—and manual selection becomes tedious and error-prone as system size grows.
This is where the Atoms Selector Extension in SAMSON becomes particularly helpful. It allows users to select atoms automatically and precisely using mathematical expressions based on atom attributes—without any scripting experience.
Why Atom Selection Matters
Atom selection is a core task performed during molecular modeling workflows. Common scenarios include:
- Preparing only a subset of atoms for simulation
- Extracting regions of interest from larger systems
- Modifying or visualizing specific types of atoms (e.g., only Carbon and Hydrogen)
- Creating custom shapes (e.g., nano-tiles, spherical caps, cylinders, etc.)
Using SAMSON’s Atoms Selector Extension, you can define your selection using variables such as position (a.x, a.y, a.z), element name (a.element), chain ID (a.chainID), and many more. Logical and mathematical operators are supported, enabling concise yet powerful expressions.
How It Works
In the Atoms Selector Extension, you simply write an expression that defines which atoms to select. For instance, to select oxygen atoms:
|
1 |
a.symbol == 'O' |
To select atoms with x and y coordinates greater than 5, use:
|
1 |
(a.x > 5) and (a.y > 5) |
You can also define spatial shapes. For example, to select atoms inside a cylinder of radius 10 Å centered at (15, 15):
|
1 |
((a.x - 15)^2 + (a.y - 15)^2) < 100 |

This selection could be used, for instance, to create a cylindrical nanopore in a bulk structure or to isolate a central column for analysis.
When to Use Atoms Selector vs. Scripting
If your task is strictly to select atoms based on specific criteria, the Atoms Selector Extension is the most straightforward tool. It’s quick, intuitive, and designed for this purpose. No control structures or variable declarations are needed.
However, if you want to do more—such as altering atom positions, changing visibility, or batch editing atom attributes—then consider using the Simple Script Extension, which supports a full scripting language.
Getting Started
The Atoms Selector Extension is available in SAMSON and can be installed from SAMSON Connect. Once installed, simply open your atomic model, go to the extension panel, and enter the mathematical expression that defines your selection criteria.
To see more example expressions and learn the full range of atom attributes you can filter on, head to the original documentation page linked below.
🔍 Learn more from the official documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
