Manually selecting atoms based on spatial patterns, element types, or structural features can be tedious and error-prone, especially in systems with thousands or millions of atoms. If you’ve ever wished you could just select atoms the way you describe them in equations, there’s a simple and efficient solution inside SAMSON.
The Atoms Selector Extension in SAMSON allows you to define atom selections using mathematical expressions—including position coordinates, element identifiers, visibility, or any other available atomic property. This results in powerful, customizable, and reproducible atom selections with virtually no manual interaction.
Why Use Mathematical Atom Selection?
Whether you’re isolating specific molecular fragments, focusing on atoms in a geometric region (like a sphere or cylinder), or scripting your own data-driven selections, the ability to use expressions greatly reduces modeling time and increases control.
How It Works
Using the Atoms Selector Extension, an expression like the one below selects all atoms within a cylinder of radius 10 Å centered at (15, 15):
|
1 |
((a.x-15)^2 + (a.y-15)^2) < 100 |

You can use a range of predefined atomic properties to define your expression:
a.x, a.y, a.z– 3D coordinatesa.elementID– atomic number (e.g., 6 for carbon)a.symbol– element symbol (e.g., ‘H’)a.visibilityFlag– whether the atom is visiblea.chainID,a.residueSequenceNumber, and others
You also have access to a full suite of mathematical and logical operators: +, -, *, /, ^, abs, sin, sqrt, and logical tests like and, or, and not. With this capacity, you can create incredibly specific selections—for example:
|
1 2 |
# Select all carbon atoms in the upper-right quadrant (a.element == 'Carbon') and (a.x > 0) and (a.y > 0) |
Advantages Over Manual Selection
- 🚀 Efficiency: Instantly select exact regions or features without clicking through atoms.
- 🧩 Custom logic: Include or exclude atoms based on combinations of structural and spatial characteristics.
- 🔁 Repeatability: Expressions can be reused across models or shared with colleagues.
- 💡 No scripting required: You only need to input a selection expression, not a full script.
Ready-Made and Custom Expressions
The Extension offers helpful presets, like:
all– selects all atoms
But most importantly, you can custom define your selection domains, which is especially valuable in large systems such as proteins, graphene sheets, or crystals.
Getting Started
You can easily install the Atoms Selector Extension via SAMSON Connect. Once installed, open it, type your expression, and click execute. Within seconds, you’ll have the atoms you want highlighted and ready to go.
If you’re curious about defining even more advanced atom manipulations—like modifying coordinates or properties using logic—you may also want to explore the Simple Script Extension.
Learn more in the full documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
