Atom selection isn’t always straightforward. If you’re a molecular modeler dealing with large, complex atomic structures, manually selecting atoms that meet specific spatial or chemical criteria can be slow and error-prone. Whether you’re extracting a region of interest or preparing a system for analysis or simulation, precision and repeatability matter.
Luckily, the Atoms Selector Extension in SAMSON offers a way to streamline this task. By combining predefined atomic variables with mathematical expressions, you can select atoms based on spatial positions, chemical attributes, and structural information. This means fewer clicks, fewer mistakes, and more flexibility when defining your selection criteria.
Why Use Mathematical Expressions for Selection?
Consider trying to select all atoms in a specific region of a crystal or just those with particular partial charges or element types. Instead of navigating complex geometries and chemical properties manually, you can now write one expression that does the job consistently.
For example, selecting all atoms inside a cylinder (say, for cutting out a nano-cylinder from a material structure) can be done using a single expression like:
|
1 |
((a.x - 15)^2 + (a.y - 15)^2) < 100 |
This selects all atoms in a 10 Å-radius cylinder, centered at coordinates (15, 15). The same logic applies whether you’re selecting spheres, planes, or complex shapes — all thanks to the expressive power of the scripting system used in SAMSON.
How It Works
Within the Atoms Selector Extension, you can access atom properties such as position (a.x, a.y, a.z), element (a.element, a.symbol), occupancy, charge, backbone membership, and more.
Here’s a simple example that selects all carbon atoms:
|
1 |
a.element == 'Carbon' |
Need to select atoms based on multiple conditions? Combine logical operators:
|
1 |
a.partialCharge > 0.2 and a.vdwr < 1.7 |
This selects atoms with partial charges above 0.2 and Van der Waals radii below 1.7.
Visual Feedback You Can Trust
Selections made using the Atoms Selector are immediately reflected in the 3D viewport. This makes it easy to tweak your expression, iterate faster, and have confidence that your selections are accurate. The tool does not require any programming experience if you’re familiar with basic logic and math. Just enter the condition and see the selection update in real time.
A Real-World Example: Slicing Quartz
In the image below, a cylinder of atoms is selected from a quartz crystal using a simple expression. This can be useful, for example, to extract nanostructures for simulations or visualization:

Compared to Manual Methods
- Faster: No tedious clicking through complex structures.
- Precise: Mathematical expressions allow exact definitions.
- Reproducible: Keep a copy of your expression and reuse it.
- Flexible: Select by spatial parameters, chemical properties, or both.
Getting Started
To try it out, install the Atoms Selector Extension from SAMSON Connect. Then, open your molecular model, launch the extension, and input your selection expression.
To learn more, visit the full documentation page: Atoms Selector Extension documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. Try it yourself and get started at www.samson-connect.net.
