Filtering Molecular Structures by Atom Count in SAMSON

Molecular modelers frequently handle large systems where it becomes essential to quickly identify and isolate components based on their structural complexity. For example, you may want to focus on models with fewer than 100 atoms for quantum calculations, or select only macromolecules exceeding 1000 atoms during visualization or simulations. In SAMSON, this becomes possible through the numberOfAtoms attribute in the Node Specification Language (NSL).

The numberOfAtoms attribute—abbreviated as sm.nat—is part of the structuralModel attribute space and simplifies queries that would otherwise be time-consuming and code-intensive. Using this attribute, you can express your selection criteria with a compact and human-readable syntax.

Why atom count matters 🧪

  • Performance optimization: Exclude tiny molecules or solvent molecules when preparing large systems for simulation.
  • Focused analysis: Select fragments of interest based on size criteria.
  • Workflow automation: Easily automate tasks like deletion, coloring, or exporting specific parts of the model.

How it works

The numberOfAtoms attribute accepts integer values and can be used in comparison expressions or in range queries. Here are some examples to help you get started:

  • sm.nat > 100: selects structural models with more than 100 atoms.
  • sm.nat 100:200: selects models with atom counts between 100 and 200 inclusive.

These expressions are valid within SAMSON’s NSL query interface and can be combined with other attributes. For example, you might choose to select visible models with a certain atom count using:

Advanced combinations

You can combine sm.nat with other structural model attributes to refine your selection. For instance:

This query will return structural models that contain fewer than 500 atoms and more than one molecule—useful when studying small organic complexes.

Here’s another practical scenario: identifying large and visible models that also contain coarse-grained atoms:

Typical use case: cleaning up a scene

Imagine you’ve imported a large biological system, and the scene includes water molecules scattered everywhere. These typically consist of 3 atoms each. You can use:

…to find and remove these small molecules in one go.

Conclusion

The numberOfAtoms attribute is a simple yet powerful tool in NSL that helps molecular modelers streamline analysis and organization of complex molecular systems in SAMSON. Whether you are preparing a structure for simulation, cleaning up your workspace, or extracting components for visualization, this feature can save time and effort.

To learn more, visit the full documentation page here: NSL Structural Model Documentation.

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

Comments are closed.