Filtering Conformations by Atom Count in SAMSON

When working with molecular conformations, size matters — especially when you’re exploring large datasets or designing simulations with molecules of specific complexity. If you’re a molecular modeler using SAMSON, selecting conformations based on the number of atoms can help you streamline your workflow and avoid processing overly complex or unnecessarily small structures.

In this blog post, we’ll look at how to use the path.numberOfAtoms attribute in SAMSON’s Node Specification Language (NSL) to filter conformations (i.e., path nodes) according to their size. This is particularly useful when running energy minimizations, comparing molecular states, or preparing data for machine learning workflows.

Why filter by atom count?

Let’s say you’ve loaded a simulation trajectory or a structural ensemble containing hundreds of conformations. Perhaps you just want to identify those within a particular size range — large enough to be biologically relevant, but not too large to slow down your calculations. Or maybe you only want to visualize conformations containing more than 100 atoms. NSL makes this type of filtering both expressive and fast.

Using path.numberOfAtoms

The path.numberOfAtoms attribute — whose short form is p.nat — allows you to match conformations based on the number of atoms they contain.

Here’s how it works:

  • p.nat > 100 matches conformations with more than 100 atoms.
  • p.nat 100:200 matches those with atom counts between 100 and 200.

You can use this directly in the NSL search bar within SAMSON. The filter applies to conformation nodes, helping you isolate the structures you need from larger systems like flexible ligands, molecular dynamics trajectories, or docking results.

Taking it further

Combine this with other NSL attributes to create more powerful queries. For example:

  • p.nat > 100 and p.sf: Match conformations with more than 100 atoms that are also selected via a selection flag.
  • p.n "Ligand*" and p.nat < 150: Match conformations whose name starts with “Ligand” and have fewer than 150 atoms.

These types of combinations let you create custom filters tailored to your molecular modeling needs without writing any scripts. It’s a quick way to sort through complex models efficiently.

What counts as a conformation here?

In NSL, path refers specifically to conformation nodes. So you’re not filtering atoms or residues directly, but rather whole paths in the molecular model that represent individual conformations. This is particularly useful when analyzing time-dependent simulations or exploring flexible molecular structures.

Note: The numberOfAtoms attribute is specific to the path attribute space, and is not available in the general node space. Make sure you prefix it correctly, either with path. or simply p.

Efficient use of NSL filters like p.nat can speed up workflows, make model exploration more targeted, and help you focus on what matters most — whether it’s identifying promising drug candidates or debugging structural models.

To learn more about the available path attributes in SAMSON, including how to query names and selection flags, 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.