When a molecular project contains many files, a small filtering mistake can make it harder to focus on the structure or data you meant to work with. SAMSON’s Node Specification Language (NSL) lets you describe file nodes with concise expressions, using attributes such as their names and selection state. The key is to be precise about which attribute you are querying.
Start by narrowing the target to files
The file attribute space matches only file nodes. Its short name is fi, so you can write fi rather than spelling out the full attribute space in an expression. This is useful when your goal is specifically to reason about files, rather than nodes generally.
Match files by name
File nodes inherit the name attribute from the node attribute space. Use fi.n as its compact form, and put the value in quotation marks:
fi.n "A"is an example using the nameA.fi.n "L*"is an example using a name expression that includes an asterisk.
If you are trying to isolate a particular file, start with the name you expect and keep the expression easy to inspect. The documented examples show that name values are quoted; leaving off the quotes changes the form of the expression and may prevent it from being interpreted as intended. The L* example suggests a useful pattern-style name expression, but the page does not specify the complete matching rules. If exact matching matters, verify the result in your SAMSON workflow rather than assuming how every special character behaves.
Check selection state deliberately
File nodes also expose selected and selectionFlag. These are separate attributes in the reference, so choose the one that matches the state you want to inspect.
For selected, use fi.selected to express the positive condition, or not fi.selected to express its opposite. Unlike the general node attribute space, selected has no short name in the file attribute space. In particular, do not assume that the node-space shorthand s is available for file nodes.
For selectionFlag, the short name is sf. The documented examples are fi.sf and fi.sf false. This gives you a compact way to specify the flag’s true or false value. Because the reference identifies selected and selectionFlag as distinct attributes, avoid treating them as interchangeable; use the attribute named for the state you need.
A practical way to build an expression
When a query does not return the files you expect, simplify it before changing several things at once. First identify the target as a file with the fi space. Then check the name expression, including its quotation marks. Finally, add the appropriate selection condition, such as fi.selected or fi.sf false. Breaking the query into these checks makes it easier to spot whether the issue is the target type, the name, or the state condition.
For the complete attribute list and the original examples, see the SAMSON file attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
