Efficient Folder Filtering in SAMSON with NSL: A Practical Guide for Molecular Modelers

If you’re working with complex molecular systems, you probably know the frustration of managing big projects filled with numerous folders, each storing different structures, chains, atoms, or molecules. Finding a folder that matches specific structural criteria among dozens—or even hundreds—can waste precious time.

The Node Specification Language (NSL) in SAMSON provides a powerful way to query and filter folder nodes efficiently. In this post, we’ll dive into a set of very practical folder attributes that help you zero in on what you need, fast. These functionalities are especially helpful when navigating rich hierarchies of biomolecular models, large simulations, or multiple molecular systems.

Why filter folders?

Imagine trying to locate all folders containing molecular models with exactly two chains, or those with more than 10 residue groups. NSL allows you to build concise queries that retrieve just these folders using a consistent syntax.

Querying Folders: How It Works

Folder attributes in NSL are accessed via the folder attribute space (short name: f). You can formulate queries like f.nc 2 to match folders containing structures with two chains or f.nr 100:150 for folders containing between 100 and 150 residues.

Common Filters and What They Do

Attribute Short name Description Example
numberOfChains nc Number of chains in the structure f.nc < 3
numberOfResidues nr Number of residues present f.nr 100:130
numberOfOxygens nO Number of oxygen atoms f.nO > 5
formalCharge fc Total formal charge f.fc 1
partialCharge pc Total partial charge (real number) f.pc 1.5:2.0

Combining Filters

One of the most useful features in NSL is that you can combine multiple attributes. This allows you to create precise queries like:

This query matches folders that contain more than 100 residues and exactly two chains. You save time and reduce manual inspection by using NSL queries that reflect the biological or chemical features you’re focusing on.

Useful Tip: Wildcards for Folder Names

Want to match folders by name? Use wildcards with f.n:

This matches any folder whose name starts with “Ligand”—helpful when classifying groups of ligands or repeated structures.

What’s the benefit?

For molecular modelers working with structural variation, compound libraries, or multi-chain proteins, being able to query folders based on structure saves a lot of time. Instead of browsing, you search. You can then apply actions (e.g., visibility toggles, selection operations, coloring) to matched folders in bulk.

NSL makes folder navigation in SAMSON much more scalable and less error-prone.

To explore the complete list of folder attributes and learn how they integrate with the rest of NSL, check out the official SAMSON documentation page: Folder Attributes in NSL.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at samson-connect.net.

Comments are closed.