Find Atoms That Matter: Filtering with Atom Attributes in NSL

If you’ve ever worked on a large molecular system, you likely faced this: you want to isolate atoms based on specific chemical or structural properties, but manual selection is tedious and error-prone. Whether you’re preparing a simulation or analyzing hydrogen bonding networks, the ability to precisely filter atoms is essential.

The Node Specification Language (NSL) in SAMSON offers a clean solution. With an extensive set of atom attributes, NSL helps you construct powerful, expressive queries to identify key atoms in your system without writing a script or digging through coordinate files.

What can you filter?

NSL lets you filter atoms using over 50 different attributes. These include basic properties like element and symbol, spatial positions, bonding environment, hydrogen bond roles, hybridization, planarity, and more. Some particularly useful examples:

  • Element filtering: a.s O selects all oxygen atoms.
  • Hybridization: a.hy sp2 selects atoms with SP2 hybridization (e.g., in aromatic rings).
  • In a ring: a.inRing finds atoms part of ring structures.
  • H-bond donors and acceptors: a.hbd, a.hba to quickly isolate these functional groups.
  • Aromatic atoms: a.ar to select atoms with aromatic character.
  • Residue-specific filtering: a.resi 42 matches atoms in residue number 42.

Combining attributes

You can also combine filters to narrow down your selection. For instance:

selects oxygen atoms that can act as hydrogen bond acceptors.

Or try:

to select nitrogen atoms in rings, within residues 10 to 20.

Working with geometry and bonding information

Looking to pinpoint specific geometries? NSL supports geometry-based filtering too. For example:

selects atoms with tetrahedral geometry.

You can also select atoms based on their number of bonded neighbors:

selects atoms bonded to more than three atoms.

Use cases in real workflows

  • Prepare input for QM calculations: Filter only the atoms in a reaction center with partial charges a.pc > 1.
  • Refine hydrogen bonding analysis: Focus on donors and acceptors in proteins: a.hba or a.hbd
  • Clean up inputs: Remove low occupancy atoms: a.oc < 0.5.
  • Distance filtering combo: Combine with coordinate filters like a.z > 20A to isolate spatial regions.

Even better, these filters integrate seamlessly into the SAMSON workspace, making it easier to build selections visually and work with them in simulations or analysis tools.

To explore the full list of attributes and create your own filters, visit the official documentation.

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

Comments are closed.