If you’re a molecular modeler working with large datasets of conformations, you’ve probably encountered the challenge of finding specific structures within big systems. Whether you’re screening generated conformations or preparing simulations, it’s often important to filter models based on the number of atoms. Doing this manually can be time-consuming and error-prone.
The Node Specification Language (NSL) in SAMSON provides a straightforward solution: use the conformation.numberOfAtoms attribute to quickly pinpoint the conformations you need.
Why Filter by Atom Count?
There are many cases where the number of atoms in a conformation matters:
- You’re interested in smaller fragments from a docking simulation.
- You want to isolate larger conformations for trajectory analysis.
- You need to batch-export conformations that fall within a specific size window.
Instead of counting atoms manually or writing scripts, you can use an NSL line like:
|
1 |
co.nat > 100 |
This matches all conformation nodes with more than 100 atoms. Similarly, to find conformations between 100 and 200 atoms, use:
|
1 |
co.nat 100:200 |
This saves time, eliminates human error, and is very adaptable to different workflows.
How It Works in NSL
Conformation nodes in SAMSON are a specific type of data node that represent molecular structures in a particular state. NSL allows you to query these nodes using attribute spaces—the conformation attribute space (short name: co) gives you direct access to structure-specific properties, including the number of atoms.
The co.nat short name maps to the conformation.numberOfAtoms attribute. NSL interprets conditions numerically, so you can use operators like >, <, or specify intervals.
Additional Examples
To find small molecules (e.g., less than 50 atoms):
|
1 |
co.nat < 50 |
To isolate conformations with exactly 128 atoms:
|
1 |
co.nat 128 |
This powerful syntax can be easily combined with other NSL filters, so you could search, for example, for conformations with a given name and a certain atom count:
|
1 |
co.n "LigandA" and co.nat > 100 |
Simplify Your Workflow
Whether you are building a machine learning dataset, filtering simulation results, or preparing a visualization, the ability to filter by atom count natively within NSL allows much faster iteration and better dataset control.
To learn more about this attribute, visit 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 download SAMSON from https://www.samson-connect.net.
