Quickly Find Large Molecular Conformations Using NSL

Molecular modelers often face a common challenge: identifying conformations of interest from large datasets. When analyzing structural ensembles, it’s important to be able to quickly filter and act only on molecular conformations that meet specific criteria—like a minimum number of atoms. Without the right tools, this kind of selection becomes tedious and error-prone.

The Node Specification Language (NSL) in SAMSON provides an efficient way to query molecular data. In this post, we’ll focus on how to filter conformations by their number of atoms using the numberOfAtoms attribute from the conformation attribute space.

Why Filter by Number of Atoms?

Conformations are different spatial arrangements of a molecule that may differ in energy, size, or geometry. When studying flexible molecules, a researcher may work with dozens—or hundreds—of conformations generated via simulation or docking techniques. Often, you might want to:

  • Eliminate minimal fragments or small conformations produced during optimization
  • Focus on higher molecular weight structures
  • Prepare large conformations for visualization, clustering, or further simulations

How to Use numberOfAtoms in NSL

In NSL, conformations are filtered using the attribute space conformation (short name: co). The numberOfAtoms attribute lets you specify either exact counts, ranges, or thresholds.

Here are a few practical examples:

  • co.nat > 100: selects all conformations having more than 100 atoms
  • co.nat 100:200: selects conformations with atom counts between 100 and 200 (inclusive)
  • co.nat 150: selects conformations with exactly 150 atoms

This is especially useful when working with systems that produce heterogeneous conformations, such as flexible docking simulations or conformational sampling algorithms.

Combining with Other Filters

You can combine numberOfAtoms with other NSL attributes like name, selected, or selectionFlag:

  • co.nat > 100 and co.selected: selects large conformations that are currently selected
  • co.n "L*" and co.nat < 50: selects conformations whose names begin with “L” and that have fewer than 50 atoms

These compound filters make it possible to design highly specific queries tailored to individual workflows.

Tips for Effective Use

Here are some tips to keep in mind:

  • Use short names for quicker typing: co.nat is the same as conformation.numberOfAtoms.
  • Range filtering (100:200) is exclusive to attributes like numberOfAtoms that accept numeric values.
  • Use the NSL search bar to apply filters interactively in SAMSON.
  • Test filters on small datasets first to ensure they produce expected results.

NSL’s filtering capabilities can save you considerable time and help ensure reproducibility, especially when used in scripted workflows or custom extensions.

To learn more, visit the official NSL documentation page for conformation attributes.

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

Comments are closed.