When a molecular scene contains many annotations, the hard part is often not creating a label—it is finding the labels you need to inspect or manage. A label may have a name you recognize, be selected, or have a visibility-related state you want to check. SAMSON’s Node Specification Language (NSL) lets you describe labels using attributes, so you can express these checks directly instead of relying on a visual scan.
Start with the label attribute space
Label attributes live in the label attribute space, whose short name is la. An expression beginning with la is intended to match label nodes. That scope is useful when a scene contains many kinds of nodes: your expression is explicitly about labels, rather than being a general search across the whole scene.
For example, the documentation lists la.n "A" as a name-based expression. The full attribute name is name, and its short name is n. Names are written as strings in quotes. The reference also shows la.n "L*" as an example, so you can use the documented expression form when working with label names that follow a recognizable pattern.
Check visibility states deliberately
Visibility-related attributes can be easy to conflate when you are troubleshooting a label that is not appearing as expected. NSL lists both visible and visibilityFlag as label attributes. Their short names are v and vf, respectively. The reference provides these expressions:
la.vandnot la.vfor checking the visible attribute.la.vfandla.vf falsefor checking the visibility flag.
These are separate attributes in the reference, so it is useful to query the one that matches the question you are asking. If you are auditing labels, check visible state with la.v; if you specifically need the visibility flag, use la.vf. The examples also show that a bare attribute expression and an explicit false value are both documented forms for the flag.
Use selection attributes without guessing shorthand
For selection, the label attribute space includes selected and selectionFlag. The first has no short name in the label space, so use la.selected or not la.selected. The second has the short name sf, with examples la.sf and la.sf false.
This difference matters when translating a query from memory or from another node type: the reference explicitly says that selected is inherited from the node attribute space but does not use the short name s for labels. Writing out selected avoids relying on a shorthand that is not available here.
A small checklist for label searches
- Begin with
lato target label nodes. - Use
la.nwhen the label’s name is what you know. - Choose
la.vorla.vfbased on which visibility attribute you need to inspect. - Use
la.selectedfor the selected attribute, andla.sffor the selection flag. - Use
notwith attributes where the reference shows a negative check, such asnot la.vornot la.selected.
The practical benefit is clarity: each expression states which label attribute you mean, and the short names are easy to verify against the reference. When a query does not return the labels you expect, checking the attribute space and the exact attribute name is a useful first step.
For the complete attribute list and examples, see the SAMSON label attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
