When working with complex molecular systems, modelers often need to isolate specific groups of atoms to perform targeted operations, run simulations, or build visualizations. One recurring task is selecting heavy atoms — that is, atoms that are not hydrogen. This step can be time-consuming and error-prone, especially in large biomolecular models.
In SAMSON, the Node Specification Language (NSL) makes it possible to perform precise atom selections using concise expressions. One of the most useful filters for molecular modelers is:
|
1 |
a.nonH |
This short keyword matches all non-hydrogen atoms. Behind the scenes, it uses the atom.heavy attribute, and makes no assumptions about the atom types beyond excluding hydrogens. It’s a one-word solution to a frequent modeling need.
When should you use it?
- Preparing input for quantum chemistry calculations: These often exclude hydrogens to focus on electronic structure at heavy atom centers.
- Analyzing molecular backbones: Backbone analysis typically involves C, N, O, and other heavy atoms.
- Setting constraints or forces: Applying constraints to heavy atoms often improves simulation stability and reduces computation.
Imagine you want to constrain all non-hydrogens in your structure for a minimization step. Simply use:
|
1 |
a.nonH |
Or, if you’re visualizing or exporting atoms, use it to select only the most relevant subset.
Combining with other filters
NSL expressions can be combined using logical operators. For example:
a.nonH and a.c A: Selects all non-hydrogen atoms in chain Aa.nonH and a.ar: Selects all non-hydrogen aromatic atomsa.nonH and a.w: Selects heavy atoms flagged as water (e.g., O in water molecules)
Visual result

While the image above is from another tutorial, it illustrates how filtering atom types improves model clarity.
Why it helps
The a.nonH filter is a tiny piece of syntax—but it removes the need for tedious manual selection, reduces errors, and makes your NSL queries more readable. It can also make scripts and saved selection presets more general (i.e., avoid listing element names).
You can also invert it using not a.nonH to highlight just the hydrogen atoms if needed.
To learn more about NSL attributes and see more filtering options, visit the full official documentation: NSL Atom Attributes – SAMSON User Documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at samson-connect.net.
