Quickly identifying large molecular paths based on atom count

Filtering molecular structures by size can speed up your workflow significantly when working with large and complex models. If you’ve ever struggled to isolate paths with a specific number of atoms in SAMSON, the Node Specification Language (NSL) offers a simple yet powerful solution. This post explores how to use path attributes, specifically path.numberOfAtoms (short: p.nat), to quickly identify molecular paths based on atom count.

Why atom count filtering matters

When building or analyzing molecular models, it’s often useful to identify or work only with certain components—such as ligands, flexible linkers, or side chains—that fall within a specific size range.

For example:

  • Quickly identifying small drug-like molecules embedded in larger molecular complexes 🔍
  • Filtering out large or irrelevant substructures to simplify simulations
  • Preparing groups of similarly sized paths for batch processing

Filtering paths by atom count with NSL

The NSL syntax provides the numberOfAtoms attribute for path (with short name nat). This lets you match paths based on how many atoms they contain.

Use the attribute like this:

  • p.nat > 100 — selects paths with more than 100 atoms
  • p.nat 100:200 — selects paths with between 100 and 200 atoms

Why does this matter? Because this allows you to navigate very large and complex models with surgical precision, isolating only the parts that match your specific criteria.

Example use case

Let’s say you’re working with a protein-ligand complex, and you want to focus on small ligand candidates buried inside the protein structure. These ligands are often simple organic molecules with fewer than 50 atoms. You could extract those in seconds by typing:

This gives you a filtered list of paths containing fewer than 50 atoms, which you can then export, simulate, or label independently from the rest of the model.

Combining filters for advanced queries

NSL filters are composable. Combine the atom count filter with other path attributes for more specific searches. For example:

This filters paths with more than 100 atoms and that have been selected. Or:

This retrieves paths with names that start with “Ligand” and contain 50 or fewer atoms.

Getting started

No need for scripting—just open the NSL filter in SAMSON’s Find panel and enter your atom count criteria. It’s an easy and effective way to navigate large systems.

To learn more about available attributes and advanced examples, visit the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/path/

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

Comments are closed.