If you’re working with molecular systems composed of many structural components, it can be frustrating to locate the right folders manually. Whether you’re preparing simulations, validating data, or simply trying to clean up structures, navigating models with hundreds (or thousands) of atoms, residues, and segments is time-consuming. Luckily, SAMSON’s Node Specification Language (NSL) offers a streamlined way to filter folders based on their contents—no manual inspection required.
In this post, we explore how you can quickly find folders by specifying their atom counts or structural composition, using the folder attribute space in NSL. This can save you hours when dealing with complex biological models, drug compounds, or stacked molecular assemblies.
What is the folder attribute space?
In the NSL, folders represent containers of molecular data. The folder attribute space (short name: f) allows you to write queries that match specific properties of entire folders.
You can filter based on inherited attributes like visible, selected or name, but more powerfully, you can also use attributes specific to molecular content—for example, the number of atoms, molecules, residues, or specific elements like carbon or sulfur.
Examples of useful filters
Maybe you’ve imported a file with several molecular systems, and you’re unsure which folder corresponds to the main structure. Rather than clicking through each one, you could run:
|
1 |
f.nat > 1000 |
to find folders with more than 1000 atoms.
Or let’s say you’re looking for folders with a moderate number of residues, for which you might run:
|
1 |
f.nr 80:120 |
This will return folders containing between 80 and 120 residues.
Why does this matter?
Imagine having a large molecular file with chains of water molecules, ligands, solvent, and a protein. Suppose you want to isolate only the protein folders (e.g., those with higher residue counts) and disregard the others. These types of command filters allow you to easily:
- Focus on the most relevant parts of your model
- Clean large datasets quickly
- Prepare data more efficiently for simulation or visualization
Popular folder-specific attributes
Here are some folder attributes you might find useful, along with examples of how to use them:
- Total atoms:
f.nat < 500 - Carbon atoms:
f.nC > 20 - Molecules:
f.nm 2:5 - Hydrogens:
f.nH > 100 - Structural models:
f.nsm > 1
You can even combine queries using logical expressions. For example:
|
1 |
f.nat > 1000 and f.nr > 120 |
This would return only folders with more than 1000 atoms and more than 120 residues.
Time-saving tip
Don’t forget that if you know the naming convention of your folders (e.g., the ones you exported from another program), you can also add name filters like:
|
1 |
f.n "Protein*" and f.nr > 100 |
This combines structural and naming information to narrow your results efficiently.
These types of searches are especially helpful when dealing with imported PDB files containing multiple models, solvent shells, or ligands. Instead of sifting through the hierarchy manually, NSL queries give you immediate answers—using precise and readable syntax.
If you want to speed up your workflow and reduce repetitive clicks, learning to use folder filters can make a noticeable difference. With a few lines of NSL, you can zero in on exactly the data you need.
To learn more, visit the full documentation: 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
