When working with large molecular systems, identifying specific atoms with precision can be time-consuming and frustrating. Whether you’re cleaning up a model, extracting meaningful subsets, or analyzing specific substructures, selecting atoms by hand becomes inefficient and error-prone very quickly.
This is where the Node Specification Language (NSL) in SAMSON can save hours of manual work. NSL enables precise, attribute-based filtering of atoms using a powerful and concise query language. SAMSON’s NSL offers dozens of atom attributes you can use to define filters tailored exactly to the atoms you need.
Why Attribute-Based Filtering Matters
Let’s imagine you want to:
- Identify all aromatic carbon atoms.
- Select atoms within a certain residue range in chain B.
- Extract polar hydrogens involved in hydrogen bonds.
You’ll need a flexible way to combine geometric, chemical, and structural criteria. The atom attribute space (short name a) makes queries like these possible in just a few characters.
A Look at Common Atom Attributes
Here are just a few examples of how attributes are used inside NSL:
a.ar: matches aromatic atomsa.s C: matches atoms with symbol C (carbon)a.c B: atoms from chain Ba.resi 40:60: residue sequence numbers between 40 and 60
For instance, to select aromatic carbon atoms, simply use:
a.s C and a.ar
Combining Atom Attributes
Atom attributes can be combined using logical operators like and, or, and not. This gives you expressive control over your selection criteria. Consider these examples:
a.s O and a.w: selects oxygen atoms flagged as watera.ar and not a.pl: selects aromatic atoms that are not planara.hbd and a.hba: finds atoms that are both hydrogen bond donors and acceptors
Going Further: Geometric and Electronic Attributes
If you’re dealing with specific molecular properties or simulations, NSL also offers attributes like:
a.pc: partial chargea.hy: hybridization (e.g.,sp2)a.tf: B-factor / temperature factora.g: geometry (e.g.,tetrahedral)
A more complex example: select all planar nitrogen atoms with a partial charge over 1:
a.s N and a.pl and a.pc > 1
Tips for Efficient Use
- Use short names:
a.s,a.pc,a.g, etc. make queries faster to write. - Chain filters using
and/or– no need to click through visual interfaces. - Combine with node types (e.g.,
n.t a and not a.met): this excludes metallic atoms.
Your Workflow Streamlined
Atom attribute filters are indispensable whether you’re:
- Preprocessing structures for simulations
- Extracting functional groups
- Comparing structural motifs
- Building custom selection rules for scripts
The more comfortable you become with NSL, the less you’ll find yourself reaching for manual selection tools. Learning just a handful of these attributes can save hours and foster more repeatable, reliable modeling workflows.
To learn more and explore the full list of available attributes, visit the documentation page: https://documentation.samson-connect.net/users/latest/nsl/atom/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
