Labels can make a molecular scene easier to read, but they can also become one more thing to sort through: some may be hidden, some visible, and some named for a particular residue or feature. When you need to identify labels by their properties, SAMSON’s Node Specification Language (NSL) provides a focused way to describe which label nodes you mean.
The key detail is the attribute space: label, abbreviated la. Attributes in this space match only label nodes. That makes label queries useful when you want to target annotations without treating every node in the scene as a label.
Start with the label’s name
To find labels by name, use la.name or its short form, la.n. The value is written as a quoted string. The reference gives these examples:
la.n "A"la.n "L*"
If you are organizing a busy scene, name-based matching is a practical starting point: give a set of related labels a consistent naming pattern, then use that pattern to express what you want to find. The documentation shows L* as an example expression; consult the NSL examples if you need guidance on pattern syntax.
Check visibility and hidden state
For label visibility, the short form is la.v. The page shows la.v and not la.v as examples for matching visible and not-visible labels. The inherited hidden attribute has the short form h, giving examples la.h and not la.h.
These are two separately named attributes in the reference. If your task depends on the exact meaning of “hidden” versus “visible,” do not assume that the terms are interchangeable: check the inherited node attribute descriptions. The label page points to the detailed definitions for node.hidden and node.visible.
Selection has two forms here
The selected attribute accepts true or false, and the page gives la.selected and not la.selected as examples. Unlike the node attribute space, however, selected has no short name in the label space. In other words, use the full form rather than assuming a short alias such as s applies to labels.
The page also lists selectionFlag, abbreviated sf, with examples la.sf false and la.sf. It is listed separately from selected. Keep the attribute names distinct in your queries, and refer to the inherited node documentation if you need their precise behavior.
A small checklist for a cleaner query
- Confirm that you mean label nodes; use the
laattribute space. - Choose the property that matches your task: name (
n), visible (v), hidden (h), or a selection-related attribute. - Use the documented value form: quoted strings for names and true/false values for Boolean attributes.
- Use
notwhere shown to express the opposite condition, such asnot la.v. - When two similar attributes appear, check their definitions rather than treating them as synonyms.
These small distinctions can prevent a common source of confusion: writing a query for the right-looking property but the wrong node type, alias, or attribute. For the complete attribute table and links to inherited definitions, see the label attributes reference. You can also explore the NSL examples.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
