Filtering Structures by Atom Count in SAMSON’s NSL

When working with complex molecular assemblies, one of the key challenges for computational chemists and molecular modelers is filtering out irrelevant parts of a structure to focus only on regions of interest. You might be looking at thousands of components and need to isolate just those that fall within a specific size range.

This is where the Node Specification Language (NSL) in SAMSON becomes very handy. Among its many features, the numberOfAtoms attribute (short name: nat) allows users to define queries that match conformations based on the number of atoms they contain.

Why this matters

Molecular modelers often need to distinguish between different types of entities—for example, small molecules, peptides, large proteins, or supramolecular complexes. Loading or analyzing the wrong subset can result in wasted computational time or results that don’t answer your questions. With the p.nat attribute, you can quickly filter out what you don’t need and focus on what you do.

Using p.nat to filter by atom count

In NSL, the path attribute space (short name: p) includes this dedicated attribute to match nodes based on atom count. This is especially useful if you’re looking at conformations and want to select only those with a certain number of atoms. It’s quick, flexible, and syntax-light.

Examples:

  • p.nat > 100 — matches paths with more than 100 atoms
  • p.nat 100:200 — matches paths with 100 to 200 atoms

Whether you’re filtering ligands, cofactors, or fragments during the design process, being able to specify thresholds like these can guide downstream steps such as energy minimization, visualization, or exporting structures.

Combining with other attributes

The real power comes when you combine p.nat with other NSL features. For example, you can filter only selected nodes within a specific atom count range using:

or find unselected conformations with more than 500 atoms using:

This selective querying becomes very useful when cleaning up structures prior to simulations or when preparing visualizations for presentations or publications.

What to watch out for

Keep in mind that numberOfAtoms is specific to paths—so the p prefix is key. Without it, your query might not behave as expected. For example, nat > 100 would not work; you need to use p.nat > 100.

Also, remember that ranges use a colon notation: 100:200 includes both ends of the range. This is especially useful when segmenting structures by size.

Conclusion

The ability to filter molecular structures by atom count using NSL’s p.nat attribute is a small but powerful feature that can significantly improve the way you navigate and prepare your data in SAMSON.

To learn more about path attributes in NSL, including name, selected, and selectionFlag, visit the official documentation page.

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

Comments are closed.