Working with large molecular systems often means dealing with folders that contain thousands—or even hundreds of thousands—of atoms. Extracting meaningful subsets of these data, such as finding folders with specific numbers of atoms, carbons, hydrogens, or residues, can quickly become challenging. If you’re a molecular modeler who frequently organizes structures in SAMSON, there’s an efficient way to filter and query folders precisely and reproducibly using the Node Specification Language (NSL).
In this post, we’ll explore how to use folder-specific attributes in NSL to filter molecular folders based on atom counts and chemical composition. This can significantly simplify navigation in complex projects and speed up the selection process.
Why filter molecular folders?
Imagine you’re simulating interactions in a protein-ligand system and you want to isolate only the folders that include structures with more than 100 atoms and fewer than 10 carbons. Or perhaps you’re interested in identifying folders that contain more than one chain or a specific range of residues. These are typical tasks in structural modeling, and repetitive manual filtering takes time.
SAMSON’s NSL gives you precise control over these queries. Here’s how.
Available filtering attributes
Each folder in SAMSON can be queried using these NSL attributes. They accept integer values and ranges, allowing you to target folders quickly:
f.nat— Number of atomsf.nC— Number of Carbon atomsf.nH— Number of Hydrogen atomsf.nN— Number of Nitrogen atomsf.nO— Number of Oxygen atomsf.nS— Number of Sulfur atomsf.nc— Number of chainsf.nr— Number of residuesf.ns— Number of segmentsf.nm— Number of molecules
Example use cases
Here are a few practical NSL expressions you can try in SAMSON:
f.nat > 100— Folders containing structures with more than 100 atomsf.nC < 10— Folders with fewer than 10 Carbon atomsf.nr 100:130— Folders with residue counts between 100 and 130f.nm 2:4— Folders containing between 2 and 4 moleculesf.nN > 5 and f.nO > 5— Folders with more than 5 Nitrogen and Oxygen atoms
One of the powerful features is the ability to combine these attributes logically, making the filtering as specific as needed.
Tips for efficient folder querying
- Use short names like
f.nHinstead offolder.numberOfHydrogensfor brevity. - Use ranges (e.g.,
f.nat 100:200) to capture variability in molecular data. - Combine filters with
andornotto fine-tune your selection.
This feature is especially useful when working with datasets such as libraries of ligands, ensembles of structural models, or any project structured around folders containing different entities. Instead of browsing folder by folder, NSL lets you work at scale.
To learn more about all available folder attributes, visit the full 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 here.
