How to filter molecular structures by atom count in SAMSON

When working with large molecular projects, it’s easy to get overwhelmed by the number of elements and structures loaded into your workspace. From simple ligands to multi-chain proteins and multimeric complexes, your project tree can quickly turn into a complex mesh of folders and nodes.

One particularly common challenge for molecular modelers and simulation experts is navigating and isolating subsets of structures based on key quantitative attributes—like the number of atoms. For example, you might want to:

  • Quickly find all molecules with more than 100 atoms.
  • Identify proteins with atom counts in a specific range, such as between 100 and 200 atoms.
  • Exclude small molecules and solvents like water clusters below a certain atom threshold.

The Node Specification Language (NSL) in SAMSON offers a concise and efficient way to filter folder nodes using attributes that describe content properties. One such attribute is numberOfAtoms—a powerful way to filter folders containing molecular structures based on their atom count.

Using numberOfAtoms (f.nat)

In NSL, you can access properties of folder nodes using attribute short names. The f.nat attribute refers specifically to the number of atoms in a structure contained in a folder node.

Here’s how you can use it:

  • f.nat > 100: This expression filters folders that contain structures with more than 100 atoms.
  • f.nat 100:200: This matches folders where the number of atoms is within the 100-200 range, inclusive.

These filters are especially useful to programmatically select structures of interest when dealing with large and diverse molecular models. It helps streamline your workflow, whether for analysis, visualization, or export.

For comparison, here’s how this information is structured in the official documentation:

  • Attribute name: numberOfAtoms
    Short name: nat
    Possible values: integers
    Examples:
    f.nat > 100
    f.nat 100:200

If you’re familiar with command-line filtering or SQL-style queries, the syntax should feel intuitive. And the best part? It’s integrated directly inside SAMSON’s search and filter tools, so you can combine it with other folder attributes (like f.nm for molecule count or f.nC for number of carbon atoms) to build sophisticated queries.

Whether you’re running a simulation or comparing structural variants, selective filtering by atom count allows you to:

  • Reduce noise in your workspace
  • Avoid selecting irrelevant structures during analyses
  • Improve project navigation and clarity

To explore the complete list of folder attributes available in SAMSON’s NSL, visit the full documentation page below.

Learn more here about folder attributes in NSL.

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

Comments are closed.