If you’ve ever worked on complex molecular systems, you’ve probably run into this problem: hundreds or thousands of folders in a project, each one containing various structural models and atom groups. Locating the exact subset of structures you want to work on—say, molecules with more than 100 atoms, or folders containing specific charge states—can become time-consuming and frustrating.
Fortunately, SAMSON’s Node Specification Language (NSL) provides a focused solution with folder-specific attributes that you can use to filter, search, and manage content more efficiently.
Why folder-level filtering matters
When dealing with hierarchical molecular data, organization matters. Folders in SAMSON can contain atoms, molecules, chains, residues, and even entire structural models. But sometimes you might want to select only folders that contain:
- A certain number of molecules
- Specific atom types (e.g., Carbon, Hydrogen, Oxygen atoms)
- A defined formal charge or partial charge
- Multiple chains or segments
- Complex structural groupings
Rather than manually scanning through node trees, you can specify precise attributes using short identifiers like f.nm for number of molecules or f.fc for formal charge. This lets you locate exactly what you’re after with just one line.
Examples in action
Here are some common use cases where folder filtering can save you a lot of time:
📌 Find folders with more than 100 atoms
|
1 |
f.nat > 100 |
📌 Locate structures containing molecules with a formal charge between 6 and 8
|
1 |
f.fc 6:8 |
📌 Select folders with fewer than 3 chains (useful for small proteins)
|
1 |
f.nc < 3 |
📌 Target molecular folders that contain many residues (e.g., large biomolecules)
|
1 |
f.nr > 130 |
📌 Filter folders with a specific partial charge range
|
1 |
f.pc 1.5:2.0 |
Whether you’re filtering by atom count, element composition, or molecular properties, these attributes help streamline analysis and remove the tedium from large molecular projects.
Each folder attribute has a short name prefix (in this case, f) to indicate it applies to folder nodes. Conditions can be written in standard logical expressions, or using colon ranges for intervals.
How it works
Folder attributes are organized into two groups:
- Inherited attributes: such as
visible,selected,ownsMaterial, andname, which apply to all nodes, including folders. - Folder-specific attributes: like
numberOfAtoms(f.nat),numberOfResidues(f.nr), andpartialCharge(f.pc), which apply only to folder nodes.
By combining both inherited and folder-specific filters using logical operators, you can create very targeted queries. For example:
|
1 |
f.nat > 100 and f.vf true |
This matches all folders with more than 100 atoms that are also visible.
Learning more
Folder filtering is just one part of the Node Specification Language (NSL) available in SAMSON. You can tailor searches for virtually any kind of molecular property. To explore the full list of folder attributes and see more examples, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
