Labels make molecular scenes easier to read—until there are enough of them to compete with the structure. A crowded view can make it harder to inspect a particular annotation, tell which labels are already hidden, or find labels by name. In SAMSON, the Node Specification Language (NSL) lets you describe label nodes with short, readable expressions, so you can narrow your attention to the labels that matter.
This is useful when you are reviewing a complex model, cleaning up a presentation, or trying to locate a label without scanning every annotation manually. The key is to treat an NSL expression as a way to identify matching nodes. For example, la specifies the label attribute space: it matches label nodes, rather than nodes in general.
Start with visibility
If the immediate problem is knowing which labels are visible, use the visible attribute. Its short name is v, so la.v is the compact expression for visible labels. To look for labels that are not visible, use not la.v.
That distinction can help when a label seems to have disappeared: instead of assuming it was deleted, you can check whether it matches the query for non-visible labels. Similarly, the inherited hidden attribute has the short name h. The documented examples are la.h and not la.h. Both attributes are available for labels because label attributes inherit these properties from the broader node attribute space.
Visible and hidden are separate attributes in the reference. The documentation lists both, so use the attribute that corresponds to the question you are asking rather than treating their names as interchangeable.
Find labels by name
When the scene contains many annotations, searching by a label’s name can be more direct than inspecting them one at a time. The name attribute has the short name n and takes strings in quotes. The reference gives la.n "A" and la.n "L*" as examples.
These examples are handy starting points when you know a label’s name, or at least the naming pattern used in your model. Keep the quotation marks around the string, and use the la prefix so the expression is scoped to labels. If you are uncertain about a naming pattern, begin with a specific name you recognize and adjust from there.
Keep selection attributes distinct
The label attribute space also includes selected and selectionFlag. The documented examples are la.selected, not la.selected, la.sf, and la.sf false. The reference notes that selected is inherited from node.selected, but does not provide a short name for it in the label attribute space. selectionFlag, by contrast, has the short name sf.
Because these are listed as different attributes, it is best not to assume they mean the same thing. Use the attribute name that matches your intended query, and consult the detailed node reference if you need to understand inherited behavior.
A small, practical checklist
- Use
lawhen you want your expression to target label nodes. - Use
la.n "A"or the documentedla.n "L*"example to search by name. - Use
la.vandnot la.vto distinguish visible from non-visible labels. - Use
la.handnot la.hwhen querying the hidden attribute. - Keep
selectedandselectionFlagseparate unless you have confirmed which one fits your task.
These simple queries can turn a visual hunt into a more deliberate check: first narrow the target to labels, then describe what you know about their name or state. For the full attribute list and inherited-property notes, see the SAMSON label attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
