Precise Atom Selection Without Coding

Selecting specific atoms in a large molecular model can feel like finding a needle in a haystack. Whether you’re filtering by element types, location, or charge, traditional tools can be tedious and error-prone, especially when selections need to be repeated or tweaked frequently.

In this post, we highlight the Atoms Selector Extension in SAMSON as a deceptively simple but powerful solution to this issue. It lets you select atoms based purely on a mathematical expression—no loops, no programming—and it’s suitable for both beginners and advanced users.

Smart Atom Selection Made Easy

The Atoms Selector Extension uses the same variables and syntax as the Simple Script Extension described in the SAMSON documentation. But instead of writing a full script, you only write an expression that defines which atoms to select. This is perfect for all users who just want to filter parts of their model based on criteria.

Need to select all hydrogen atoms?

Want atoms located in the positive quadrant?

This expression selects atoms whose positions along all coordinates are strictly positive. It’s quick, readable, and avoids complicated filtering operations.

Real Example: Cylindrical Cut of a Quartz Model

Say you’re modeling a quartz crystal and want to extract a circular cross-section centered at (15, 15) Å with a radius of 10 Å. You can do this with a single line:

This expression resembles standard analytic geometry and is easy to adapt by changing center or radius values.

Cut cylinder out of quartz crystal

All the Power, None of the Loops

Internally, the Atoms Selector parses common mathematical functions and operators, making it robust enough for complex queries. For more advanced selections, you can combine logical operators, nested expressions, or test values like element ID, charge, or even van der Waals radii. For instance:

selects negatively charged oxygen atoms—ideal when preparing data for simulations or specialized rendering.

Tips for Molecular Modelers

  • Use a.element or a.symbol for chemical identity.
  • Use a.x, a.y, a.z for spatial conditions.
  • Remember: All variable and function names are case-insensitive.
  • The special keyword all selects every atom in the current active document (useful before doing a boolean-based exclusion).

Why It Matters

If you find yourself manually selecting atoms too often or repeating selection steps across different documents, the Atoms Selector Extension can save you time and reduce mistakes. It’s particularly helpful in workflows that require reproducibility, such as structure preparation for simulations or targeted visualizations.

To learn more, examples and detailed documentation are available at the official documentation page: SAMSON Tutorial: 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.