Precise Atom Selection Using Mathematical Expressions in SAMSON

When working with molecular models, one recurring challenge is efficiently selecting specific atoms based on their positions or properties. Whether slicing a geometry, isolating substructures, or modifying subsets of atoms, manual atom selection is often tedious and error-prone—especially in larger systems. If this feels familiar, you may find the Atoms Selector Extension in SAMSON extremely helpful.

This blog post introduces a simple but powerful solution: using mathematical expressions to select atoms in bulk based on spatial or chemical criteria. This approach eliminates the need for repetitive clicking and allows clear reproducibility of selections.

What Is the Atoms Selector Extension?

The Atoms Selector Extension enables selection of atoms in the active document using concise expressions similar to what you might write in a scripting language. It’s especially useful when defining complex geometrical regions, isolating specific elements, or building customized data queries.

The Selector understands atomic variables (like positions and element types), standard operators and functions (like abs, sin, sqrt), and logical combinations. If you’re working in large crystalline or biomolecular datasets, this dramatically saves time and ensures exact reproducibility for your selections.

Example: Cutting a Cylinder out of Quartz

Suppose you want to isolate a cylindrical portion of a quartz crystal centered at (15, 15) with a radius of 10 Å. Instead of rotating and clicking atoms manually, you can simply write:

That’s it. All atoms within that 10 Å radius cylinder are now selected. Combine this with other tools in SAMSON to hide, delete, or modify the atoms immediately.

Cut cylinder out of quartz crystal

More Practical Use Cases

  • Isolate solvent: a.water==1 selects all atoms belonging to water molecules.
  • Select heavy atoms: a.ei > 2 selects atoms with an atomic number above Helium.
  • Focus on a chain or residue: a.ci==0 and a.resi==12 zeroes in on a specific segment within a macromolecule.

Beyond these examples, the extension recognizes the same mathematical capabilities as the more advanced Simple Script Extension, but focuses only on selection—so you don’t have to worry about scripting syntax errors beyond your selection logic.

How to Start Using It

  1. Install the Atoms Selector Extension from SAMSON Connect.
  2. Load your molecular structure and open the extension.
  3. Type your selection expression (e.g., a.e=='Carbon').
  4. Click “Apply” and your atoms are now selected based on your expression.

This method doesn’t only reduce the risk of manual error—it also encourages experimentation and insight by letting you test geometrical and property-based hypotheses quickly.

To explore more selection variables and scripting possibilities, visit the SAMSON documentation:

https://documentation.samson-connect.net/tutorials/simple-script/making-nano-batarangs-and-more/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.

Comments are closed.