When working on molecular models, whether you’re preparing structures for simulation, visualizing proteins, or analyzing large molecular systems, being able to select specific atoms quickly is essential. For SAMSON users, the Node Specification Language (NSL) provides a powerful and flexible way to do just that. But with so many different selection options, it can be hard to know where to start.
One common need is identifying atoms by their chemical element — for example, selecting only oxygen atoms, only hydrogens, or a combination like carbon, nitrogen, and oxygen. NSL offers two key attributes to support this: element and symbol. While they might seem interchangeable at first glance, they each have practical uses depending on your workflow.
Understanding a.e and a.s
The atom.element attribute (short name: a.e) allows you to select atoms based on the full name of the chemical element, while atom.symbol (short name: a.s) works with standard atomic symbols.
Some examples:
a.e Carbon– selects all carbon atomsa.e Oxygen, Nitrogen– selects oxygen and nitrogen atomsa.s H– selects all hydrogen atomsa.s H, O, N, C– selects hydrogen, oxygen, nitrogen, and carbon atoms
One might prefer symbol (a.s) for its brevity — especially when typing selections frequently. On the other hand, element (a.e) can be more readable for sharing or documenting your queries within teams or publications.
Combining Atom Selection With Other Attributes
NSL becomes especially powerful when combining element or symbol filters with other attributes. Suppose you want to select aromatic carbon atoms:
a.s C and a.ar– selects atoms with symbol C that are also aromatic
Want to select oxygen atoms that are water molecules?
a.s O and a.w– selects oxygen atoms flagged as water
This kind of query enables high precision, which is particularly useful in systems with mixed environments, such as solvated biomolecules, materials, or ligands embedded in proteins.
Quick Tips for Efficient Selection
- Use
a.sfor short, quick selections; e.g.,a.s N - Use
a.ewhen you want clarity in shared or documented queries; e.g.,a.e Nitrogen - Use commas to combine environments:
a.s O, Nora.e Oxygen, Nitrogen - Combine with attributes like
a.ar,a.w, ora.hetto enrich the query
For instance, selecting all heteroatoms that are not carbon or hydrogen can be done with:
|
1 |
n.t a and not (a.s H, C) |
Use Cases in Real Workflows
Whether you are setting up models for force field assignment, cleaning up crystallographic data, or creating figures for publications, these attributes help streamline workflows. Instead of manually clicking or navigating menus to find atoms of interest, you can rely on precise, reproducible NSL queries.
This saves time, reduces errors, and helps maintain consistency across large datasets — especially important when analyzing protein-ligand interactions, ion channels, metal binding sites, or biomolecular solvation shells.
To dig deeper into all available atom attributes and how they can be combined in NSL, visit the official documentation page:
https://documentation.samson-connect.net/users/latest/nsl/atom/
SAMSON and all SAMSON Extensions are free for non-commercial use. To get started, download SAMSON at https://www.samson-connect.net.
