When working on complex molecular systems, it’s not uncommon to accumulate dozens—or even hundreds—of structural and simulation files within a project. Finding those files manually in a crowded workspace can be tedious, especially when trying to isolate a specific conformation or dataset for analysis or export.
The Node Specification Language (NSL) in SAMSON provides a solution. More specifically, by targeting the file attribute space (short name: fi), you can easily identify and select files in your workspace using precise, programmable queries. Let’s look at how this can help you streamline your workflow when dealing with a high number of file nodes.
What is the file attribute space?
The file attribute space in NSL allows you to query only file-type nodes in your document. This ensures that your search does not return irrelevant node types such as visual representations or annotations. You can use it in combination with inherited attributes like:
- name (
n) — the name of the file node - selected — whether the file is currently selected
- selectionFlag (
sf) — a secondary selection attribute
Examples you can put to use right now
If you’re looking for all files whose name starts with “L”, the following NSL query will do the trick:
|
1 |
fi.n "L*" |
Want to check which files are currently selected? Try:
|
1 |
fi.selected |
To find files that are not selected:
|
1 |
not fi.selected |
And to explore files with specific selection flags (useful for custom workflows or tool-defined filters):
|
1 |
fi.sf true |
Each of these queries can be run directly from SAMSON’s selection interface, making it easier to isolate just the data you want to work with—even in large, noisy projects.
When would this help you?
Imagine you’ve imported numerous trajectory files and you only want to export the ones related to a ligand named “LigandX”. Rather than scrolling and selecting them one by one, simply use:
|
1 |
fi.n "LigandX*" |
Or let’s say you’re collaborating on a project and want to make sure only the selected files are submitted for review. A quick fi.selected reveals your current selection landscape.
Important distinctions
It’s worth noting that although attributes like selected and selectionFlag are inherited from general nodes, in the file context, some differences exist. For example, the selected attribute has no short name in the file space.
In summary
Using NSL to filter file nodes helps reduce manual overhead, keeps your workspace tidy, and enables targeted operations like visualization or export. When molecular modeling projects get large, tools like this become essential for efficiency.
To learn more about attributes available in the file attribute space in NSL, visit the official SAMSON documentation: https://documentation.samson-connect.net/users/latest/nsl/file/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
