A Precise Way to Select Atoms with Mathematical Expressions in SAMSON

When modeling complex molecular systems, selecting specific atoms—even in large structures—can become a repetitive and error-prone task. Whether you’re visualizing a nano-structure or preparing data for simulation, quickly defining regions of interest is often critical. Yet doing this manually using only graphical selection tools is not efficient, especially when dealing with symmetry, spatial constraints, or needing precision over atom attributes.

Fortunately, SAMSON provides a powerful way to address this: the Atoms Selector Extension. Built to let you define selection rules using mathematical and logical expressions, this tool helps molecular modelers speed up their work, avoid mistakes, and even scale tasks across different systems.

Why not just click?

Clicking to select atoms works fine for small, simple molecules. But what if you’re dealing with a large graphene sheet and want to isolate a 10Å cylinder region precisely from its structure? Or maybe you want to analyze only atoms located within a certain residue or chain in your biomolecule.

This is where the Atoms Selector Extension becomes useful. Using variables for atomic attributes such as a.x (x-coordinate), a.element (element name), a.symbol (element symbol), or a.ei (element ID), you write an expression to tell SAMSON exactly what you want.

Practical Example: Selecting a Cylinder in Quartz

Say you want to cut out a cylinder with radius 10Å centered at (15, 15) in a quartz crystal. Simply use:

This selects all atoms whose x and y positions satisfy the constraint of being within a circle of radius 10. It’s quick, reusable, and extremely precise.

Cut cylinder out of quartz crystal

How it Works

The syntax used in the Atoms Selector is the same as in the Simple Script Extension, meaning it supports logical operators (and, or), mathematical functions (abs, sqrt), conditions, and even element-specific criteria like a.symbol=='H' or a.ei==6 for carbons.

This makes it versatile for:

  • Selecting only specific types of atoms (e.g., all oxygen atoms by writing a.symbol=='O').
  • Defining spatial zones, such as hemispheres, rectangular volumes, or spherical projections.
  • Creating dynamic selection filters that can be reused in other documents or systems.

Simplified Expression View

The beauty of using the Atoms Selector is that it only requires an expression—so there’s no need to script visibility or selection flags manually as in the Simple Script Extension. Simplicity does not come at the cost of power.

Designed for Reusability

Once you have a working expression, you can save or adapt it for other sessions or even automate specific selection workflows across datasets, which is ideal for high-throughput modeling tasks or reproducible research.

Conclusion

The Atoms Selector Extension is a practical utility that helps researchers, students, and engineers efficiently select precisely the atoms they need—without clicking, box-selecting, or second-guessing. Learn more from the official documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can start using them today by downloading SAMSON from www.samson-connect.net.

Comments are closed.