Quickly Find Structural Groups by Atom Count in SAMSON

When working with large and complex molecular systems, one of the recurring challenges is identifying specific pieces of the model—structural groups that meet very precise criteria. For instance, say you want to focus your analysis or visualization on structural groups with a specific number of atoms, or that are rich in a particular element, like oxygen or nitrogen. Traditionally, this involves repetitive manual filtering, which is time-consuming and error-prone. Fortunately, SAMSON provides a practical way to solve this with the Node Specification Language (NSL), making it easy to query structural groups based on specific attributes.

In this post, we’ll focus on a particularly useful subset of NSL: querying structural groups by their atomic composition using attributes such as:

  • numberOfAtoms (sg.nat)
  • numberOfCarbons (sg.nC)
  • numberOfHydrogens (sg.nH)
  • numberOfOxygens (sg.nO)
  • numberOfNitrogens (sg.nN)
  • numberOfSulfurs (sg.nS)
  • numberOfCoarseGrainedAtoms (sg.ncga)

These attributes allow you to select and act upon structural groups with remarkable control. Let’s break down how you can use them.

Targeting Based on Atom Count

To select all structural groups that have more than 100 atoms, simply use:

Need a range instead? This will get everything between 100 and 200 atoms:

Filtering for Specific Element Composition

You can go a step further by selecting groups based on how many atoms of a specific element they contain. For example:

  • Fewer than 10 carbon atoms: sg.nC < 10
  • Between 10 and 20 hydrogen atoms: sg.nH 10:20
  • At least 8 oxygen atoms: sg.nO >= 8

These filters are especially useful in simulations or molecular design tasks where atom type distributions are critical. For instance, when identifying potentially reactive regions, or for subset analysis in coarse-grained modeling workflows.

Working with Coarse-Grained Models

If your system includes coarse-grained atoms, you can use the sg.ncga attribute. Let’s say you’re interested in a specific density of coarse representation, use:

…to find all structural groups where the number of coarse-grained atoms is between 50 and 100.

Why This Matters

Manually locating these structural groups could take hours on large systems. By using NSL selector queries like these, you can:

  • Quickly identify model components critical to your study
  • Automate the selection process for repeat analyses
  • Reduce visual clutter by isolating meaningful subsets

Using these filters doesn’t just make your work faster—it makes your modeling workflows cleaner, more reproducible, and less prone to oversight.

To learn more about available filtering options for structural groups in NSL, visit the official documentation page.

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

Comments are closed.