Working with large and complex molecular systems can be overwhelming. Whether you’re analyzing a protein-ligand complex or preparing data for simulations, it’s common to face the challenge of identifying relevant subsets of your data — for example, structures with a specific number of atoms or carbon atoms. Manually sorting through multiple folders or molecular models can be time-consuming and error-prone.
With SAMSON’s Node Specification Language (NSL), this problem becomes much more manageable. NSL allows you to write powerful queries to retrieve only the data you need, directly within the SAMSON interface. In this post, we’ll walk through how to filter molecular folders based on atom counts using folder-level attributes.
Choosing by total number of atoms
Suppose you want to find all folders that contain fewer than 1,000 atoms. You can use the folder.numberOfAtoms attribute — or its short name f.nat — like this:
|
1 |
f.nat < 1000 |
Alternatively, if you’re interested in folders that contain between 100 and 200 atoms:
|
1 |
f.nat 100:200 |
These queries instantly match structures that meet these criteria, saving you the step of manually browsing structural contents.
Getting specific: filtering by atom types
Sometimes total atom counts aren’t enough — you might care more about the number of specific atom types, like carbons, hydrogens, or oxygens.
Here are a few useful attributes to consider:
- Carbon atoms:
f.nC - Hydrogen atoms:
f.nH - Oxygen atoms:
f.nO - Nitrogen atoms:
f.nN
The usage is identical to the way you’d filter by total atom count. For example:
|
1 |
f.nC < 10 |
Finds folders with fewer than 10 carbon atoms.
|
1 |
f.nH 10:20 |
Selects structures that include between 10 and 20 hydrogen atoms.
Why this matters
Atom counts can help you quickly screen out irrelevant structures before running analyses, simplify system preparation steps, or assist in comparing molecular size distributions between datasets.
By using folder-level attributes like f.nat, f.nC, or f.nH, you can construct reproducible and transparent filters that can be adapted to different research needs. No need to rely on naming conventions or cumbersome selections anymore.
You can learn more about folder attribute filtering at the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/folder/.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
