When working with complex molecular systems in SAMSON, it’s common to handle multiple datasets, simulations, or structural variations, each encapsulated in distinct file nodes. Whether you’re juggling docking runs or importing external molecular files, a recurring need arises: how do I easily filter and act on specific files in my graph?
Thankfully, the Node Specification Language (NSL) in SAMSON provides just the right tools, and understanding the file attribute space is your starting point 🚀.
What Is the file Attribute Space?
The file attribute space (short name: fi) targets only file nodes. These are typically nodes representing imported or generated data files — think of files resulting from quantum calculations, simulation outputs, or structural data loads.
Common Pain: Managing File Selection in Large Projects
Let’s say you have a project with dozens of molecular models imported from different sources. You want to isolate the models whose file names start with “L” and are not selected currently. With NSL, this can become a one-liner instead of a manual search.
Useful File Node Queries
Here are attributes you can use with fi:
fi.n: the name of the file node (string in quotes, with wildcard support).fi.selected: whether the file node is currently selected.fi.sf: a selection flag used in compound selection logic.
Examples
To select files whose names start with “L”:
|
1 |
fi.n "L*" |
To find all files that are not currently selected:
|
1 |
not fi.selected |
To retrieve all files whose selection flag is false:
|
1 |
fi.sf false |
Why This Matters
Beyond organization, these queries are vital when scripting, automating model preparation workflows, or comparing results across file sets. For instance:
- Avoid accidentally modifying the wrong model by filtering selected file nodes first.
- Design clean visual presentations by isolating only the relevant molecular files.
- Prepare batches of files for export or transformation using name-based queries.
Small Tips That Go a Long Way
- Remember that
fi.selecteddoesn’t have a short name — unlikefi.norfi.sf. - Wildcards like
*inside strings are powerful for quick grouping. - Combine with logical operators to define precise conditions.
Learning to combine simple expressions like fi.n "Docking*" and not fi.selected will significantly speed up how you process molecular datasets.
Learn more about the file attribute space in SAMSON NSL.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON from https://www.samson-connect.net.
