Working with large molecular systems can quickly become overwhelming, especially when trying to isolate the parts of a model that matter most. Whether you’re analyzing macromolecular complexes, screening multiple conformations, or simply managing an extensive project tree, having precise control over what you see and work on is essential.
One of the many helpful functions in SAMSON’s Node Specification Language (NSL) is the ability to filter folders based on their atomic content. This is particularly useful if you need to:
- Focus on small molecules within a larger assembly
- Quickly access structures below a certain complexity threshold
- Hide or isolate folders contributing to simulation size
Let’s look at how to use the folder.numberOfAtoms attribute (short name: f.nat) to improve your workflow efficiency.
How it works
Each folder in SAMSON can contain multiple structural elements: molecules, fragments, atomic groups, etc. SAMSON automatically keeps track of the number of atoms inside each folder, and this information is accessible via f.nat in NSL queries.
For example, suppose you want to find all folders containing fewer than 100 atoms. You can write:
|
1 |
f.nat < 100 |
This query returns only the folders meeting the criteria, helping you concentrate on small molecules or manageable sections of your model.
Other common examples
f.nat 100:200— Match folders containing between 100 and 200 atoms.not f.nat > 1000— Exclude large components with more than 1000 atoms.f.nat— Match folders that have any defined atom count at all (equivalent to testing presence).
When this helps the most
If you are dealing with multiscale models or large biomolecular assemblies, you might want to:
- Categorize structures based on size
- Exclude bulky folders during intermediate calculations
- Split systems for coarse-grained vs. atomistic processing
These tasks are much easier when you can define atom-count criteria and apply them systematically through NSL.
Getting started
The quickest way to apply these queries is to open the selection dialog in SAMSON and type directly into the NSL input area. You can also use scripts to iterate over query results and automate further processing.
This approach extends beyond atoms—you can filter folders by number of molecules (f.nm), number of residues (f.nr), and more. But starting with f.nat gives you the most general-purpose and intuitive control over folder content.
To learn more about filtering folders by their contents and discover many other useful attributes, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/folder/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
