Quickly Find Conformations by Atom Count in SAMSON

When working with molecular systems that contain a large number of conformations, one recurring challenge is efficiently filtering and selecting conformations that fall within specific structural complexity — for example, based on the number of atoms. This can be especially useful when you need to identify simplified structures for analysis, or when you are debugging and want to isolate conformations that are too large or too small.

Luckily, SAMSON’s Node Specification Language (NSL) offers a convenient way to query conformations based on these kinds of properties. In this post, we’ll explore how to filter molecular conformations specifically based on their number of atoms using the conformation.numberOfAtoms attribute, also available in short form as co.nat.

Why filter by atom count?

Molecular modelers often generate or import sets of conformations of varying sizes. Navigating through these without a filtering mechanism can be tedious. For example:

  • You generated >100 conformations, but only want to work with those that have between 100 and 200 atoms.
  • You suspect that certain conformations are too large and want to filter out everything beyond a given atom count threshold.

Rather than checking each conformation manually, a simple NSL query accomplishes this in seconds.

Using NSL to filter by number of atoms

The NSL attribute co.nat is used to match conformations by their number of atoms. The syntax is easy to understand:

  • co.nat > 100 — selects conformations that contain more than 100 atoms
  • co.nat 100:200 — selects conformations with between 100 and 200 atoms inclusive

This allows for rapid subsetting without having to visually inspect each conformation.

How it works inside SAMSON

To apply this in SAMSON, simply open the NSL search field or selector wherever it’s available (like in filters or find tools) and enter one of the above expressions. The results will immediately display only those conformations that match your specified requirement.

Here’s an example from the documentation showing how atom-based filtering looks using NSL:

Filtering conformations by number of atoms

Short reference table

Here’s a quick reference from the documentation on this attribute:

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

A good default filter

If you find yourself frequently working with conformations in specific size ranges, you can even save NSL filters to reuse them later. Filtering by atom count is a good default strategy to apply before any sort of visualization, computation, or structure-based analysis.

To learn more about NSL queries for conformations, including additional attributes like selected or name, see the official documentation: https://documentation.samson-connect.net/users/latest/nsl/conformation/.

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

Comments are closed.