When working with complex molecular systems, an increasingly common pain point among modelers is navigating through large data collections to find specific subsets of structures. Whether you’re analyzing protein complexes, supramolecular assemblies, or atomic simulations, you may often need to filter your molecular folders by characteristics like the number of residues, atoms, or charge.
Thankfully, the Node Specification Language (NSL) in SAMSON makes this task considerably smoother. Here’s a closer look at how folder attributes in NSL can help you pinpoint exactly what you need, saving both time and cognitive effort đź§ .
Getting Started with Folder Attribute Filtering in NSL
In SAMSON, data is organized using nodes, and folders are a special kind of node grouping together sets of other nodes. Each folder can have a number of attributes that describe its content — from the number of atoms to the number of residues or even partial charges. The NSL allows specifying these attributes using concise queries.
For example, let’s say you want to find all molecular folders in your system that contain a structure with more than 100 residues. Simply type:
|
1 |
f.nr > 100 |
This will match only those folders whose structures contain more than 100 residues.
Other Handy Folder Attributes
Here are some very practical filters you might use regularly:
- Number of atoms:
f.nat < 1000– folders with fewer than 1000 atoms. - Number of chains:
f.nc 2:4– folders with between 2 and 4 chains. - Partial charge range:
f.pc 1.5:2.0– structures with a partial charge between 1.5 and 2.0. - Presence of material:
f.hm– folders that have assigned materials for visualization purposes. - Visibility control:
not f.v– folders that are not currently visible.
A Use Case: Visual Cleanup Before Rendering
Suppose you’re preparing a polished render or export and want to hide all folders with more than 300 atoms to simplify the view. The query:
|
1 |
f.nat > 300 |
used in combination with the visibility control flag can help you rapidly isolate and toggle the visibility of folders using script automation or manual operations.
Naming and Search by Pattern
You can also filter by name patterns using:
|
1 |
f.n "Ligand*" |
This will match folders with names starting with “Ligand”. This type of search is especially helpful when structures come from automated naming pipelines or external databases.
Combining Attributes
Yes, you can chain multiple criteria! A compound query like:
|
1 |
f.nr > 100 and f.pc 1.5:2.0 |
will match folders with more than 100 residues and a partial charge between 1.5 and 2.0. This enables incredibly specific querying depending on your modeling needs.
Interested in going deeper? Explore the full documentation on folder attributes here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
