When Labels Get Lost in the Model: A Practical NSL Checklist

In a busy molecular scene, labels can become difficult to track: some may be hidden, some may not be visible, and others may simply be hard to locate by name. Before changing the scene by trial and error, use SAMSON’s Node Specification Language (NSL) to describe the label nodes you want to find. The label attribute space is written label, with the short name la, and matches label nodes.

Start with the label name

If you know the name of a label, use the name attribute. For example, la.n "A" is the documented expression for a label named “A”. The short form n keeps the query compact, while the full attribute name can be easier to recognize when you return to an expression later. The documentation also gives la.n "L*" as an example; use the naming patterns supported by your NSL workflow when searching for groups of labels.

A small practical habit helps here: search by a known label name before broadening the query. It makes the expression easier to interpret and can help you distinguish “I cannot find the label” from “I am looking at the wrong kind of node.”

Check visibility and hidden state separately

Two useful questions are whether a label is visible and whether it is hidden. The visible attribute has the short name v: la.v matches labels whose visible attribute is true, and not la.v matches labels whose visible attribute is false. The inherited hidden attribute has the short name h: use la.h or not la.h to match labels according to their hidden state.

These are separate attributes in the reference, so do not assume that checking one is a substitute for checking the other. If a label is not appearing as expected, query each state independently. For example, comparing la.v with la.h can help you identify which property is relevant to the label you are investigating, without treating the words “visible” and “hidden” as interchangeable.

Don’t confuse selection with selection flags

NSL also exposes selected and selectionFlag. For labels, the selected attribute can be written la.selected or not la.selected. It is inherited from the node attribute space, but the label reference notes that it does not have the short name s. The selection flag, by contrast, uses sf, so la.sf and la.sf false query that attribute.

When a label appears to be included in a selection or omitted from one, check which attribute your expression is asking about. selected and selectionFlag are listed as distinct attributes, with distinct syntax. Keeping them separate in your query makes it easier to understand what you are filtering for.

A quick troubleshooting sequence

  1. Confirm that your expression targets labels with the la namespace.

  2. If you know the name, start with a name expression such as la.n "A".

  3. Check visibility with la.v and not la.v.

  4. Check hidden state separately with la.h and not la.h.

  5. If selection is relevant, decide whether you mean la.selected or the selection flag la.sf.

This turns a vague “Where did my label go?” moment into a set of specific questions about the node’s name and attributes. It also gives you a readable starting point for building more focused expressions, while staying within the label attributes documented for NSL.

For the complete attribute list and examples, see the Label attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.