Quickly Find the Right Molecular Folders Using NSL Filters in SAMSON

When working with complex molecular systems, SAMSON users often deal with large collections of structures organized into folders. These folders contain atoms, molecules, chains, and other entities that together define the models. As projects grow, identifying the right folders based on specific structural criteria becomes a time-consuming task — unless you know how to filter efficiently.

Whether you’re cleaning up your workspace, focusing on a subset of biological chains, or analyzing a specific charge distribution, SAMSON’s Node Specification Language (NSL) offers a compact and powerful way to zero-in on just the folders you need.

Why Filtering Folders Matters

Imagine importing multiple molecular models with hundreds of chains, or exporting results for simulations that rely on subsets of atoms or molecules. Without filtering, the only options are manual selection or relying on naming conventions – neither of which scale well.

Fortunately, the folder attribute space in NSL lets you apply rich, precise filters on folders, whether it’s by atomic content, charge, visibility, or chain count.

Examples: Filter by Atom Counts and Charges

The folder attribute space (short name: f) supports compact syntax. For example:

  • f.nat > 1000: folders with over 1000 atoms
  • f.nH 10:20: folders with 10 to 20 hydrogen atoms
  • f.fc 6:8: folders with formal charge from 6 to 8
  • f.pc 1.5:2.0: folders with partial charge in that range

These filters let you narrow down folders to exactly those with the molecular content you need.

Focus on Molecular Composition

If your task is structure-driven — say, you’re analyzing surface behavior of carbon chains — filtering for element types is key:

  • f.nC < 10: folders with fewer than 10 carbon atoms
  • f.nN 5:15: folders with 5 to 15 nitrogen atoms

Having such precise control helps during both visualization and export workflows.

Going Beyond Atom Counts

Want to retrieve folders with specific biomolecular units?

  • f.nc > 2: number of chains greater than 2
  • f.nr 100:120: number of residues between 100–120
  • f.nsm < 3: less than 3 structural models

This is particularly helpful in proteins, polymers, or complex assemblies.

Tidy Up Large Projects with Visibility Filters

Sometimes, you’re not looking for structure — you just want to clean your project.

  • not f.v: folders that are currently hidden from the view
  • f.selected: folders that are selected

Use these filters to delete or focus your view on specific parts of your workspace.

All Filters, Compact Syntax

The NSL short names make querying even faster:

  • nat: total atom count
  • nc: chain count
  • fc: formal charge
  • pc: partial charge

This means a query like f.fc > 5 and f.nc < 4 quickly gives folders with charge > 5 and fewer than 4 chains.

Where to Use These Filters

You can apply these filters wherever NSL is supported — for selecting nodes in the Inspector, saving selections, controlling visibility, or automating workflows. By using folder-level attributes, you avoid unnecessary detail and focus on containers of structures.

Documentation and More Details

All folder-level attributes and their short names are documented in SAMSON’s NSL guide. Check out the full reference here:
https://documentation.samson-connect.net/users/latest/nsl/folder/

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

Comments are closed.