When projects in SAMSON grow and fill with simulations, models, and other data, navigating through many nodes — especially file nodes — can become time-consuming. Users often want to quickly find or select only specific files based on naming conventions or selection status. If you’ve ever asked yourself questions like:
- “How can I filter only the files I named with an ‘L’?”
- “Can I select only the unselected file nodes in my workspace?”
- “Is there a way to target files using conditions programmatically?”
The answer lies in the Node Specification Language (NSL), specifically its file attribute space (short name: fi), which targets only file nodes. This is a subset of the NSL that enables precise control and querying within SAMSON.
Target File Nodes with Ease
The NSL allows users to define queries over file nodes using simple and expressive syntax. Let’s explore how you can take advantage of three key attributes defined in the file attribute space:
1. Name Matching
Want to find files by name? Use the fi.n attribute. This is inherited from the general node attribute node.name and allows string matching (including wildcards *):
|
1 2 3 |
fi.n "A" <!-- Matches files named exactly 'A' --> fi.n "L*" <!-- Matches files with a name beginning with 'L' --> |
This is particularly useful when organizing files by naming schemes — for example, all ligand files that start with ‘L’.
2. Selection Status
Want to identify which file nodes are selected or not? Try this:
|
1 2 3 |
fi.selected <!-- Matches selected file nodes --> not fi.selected <!-- Matches file nodes that are not selected --> |
It’s very helpful when running operations or visualizations only on certain subsets of your data.
3. Selection Flags
The selectionFlag tag (short name: sf) enables even finer control. You can use it like this:
|
1 2 3 |
fi.sf <!-- Matches file nodes where selectionFlag is true --> fi.sf false <!-- Matches file nodes with selectionFlag set to false --> |
This opens up new possibilities for filtering what’s interactively flagged in your workspace, beyond the typical visual selection.
Why This Matters
Rather than manually scanning your Document view, learning how to write a few NSL expressions can let you:
- Instantly locate input/output files for simulations
- Run batch operations on filtered file nodes (e.g., hide, export, delete)
- Ensure that only relevant files are selected before launching tools or scripts
Whether you’re working on long simulation workflows or just cleaning up a cluttered workspace, the file attribute space provides a light-weight way to stay in control.
To learn more about the full set of file node attributes and see more examples, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
