Taming Scene Clutter: Find the Labels You Actually Need

In a molecular scene, labels can be helpful until there are enough of them to compete for attention. A label may identify a residue, a measurement, or a note you added while exploring a structure. When you need to inspect or select labels without confusing them with atoms and other nodes, SAMSON’s Node Specification Language (NSL) provides a dedicated attribute space: label, abbreviated la.

Start by narrowing the search to labels

The prefix la makes a selector apply to label nodes. That distinction is useful when a scene contains many kinds of objects: a label-specific expression is easier to reason about than a broad search across the whole node tree. For instance, la.n "A" combines the label attribute space with the name attribute. The documentation also shows la.n "L*" as an example of a name expression.

Think of the prefix as the scope of your question: first specify that you are interested in labels, then add an attribute that describes which labels matter. This makes expressions easier to read later, especially when you return to a scene after a break or share a selection with a colleague.

Use visibility to focus, not to guess

When labels are visually overwhelming, visibility is often the most relevant property to inspect. The short form is v, so la.v refers to visible labels. To refer to labels that are not visible, the documented example is not la.v. The full attribute name is visible; the short name is simply a convenient alternative.

There is also hidden, with short name h. The label reference lists both visibility-related attributes, but their detailed behavior is inherited from the general node attribute space. If you need to distinguish exactly what hidden means from what visible means in a particular context, consult the linked node reference rather than assuming they are interchangeable.

A practical habit is to make the target explicit: use la.v when your question is about visible labels, and not la.v when it is about labels that are not visible. This keeps the intention clear in the expression itself.

Separate selection state from selection flags

Labels also inherit selected and selectionFlag. The documented examples include la.selected and not la.selected for selection state, as well as la.sf and la.sf false for the selection flag. These are separate attributes in the reference, so preserve that distinction when choosing an expression.

One small detail is easy to miss: unlike the corresponding node attribute, selected has no short name in the label attribute space. Write la.selected, not a guessed abbreviation such as la.s. By contrast, selectionFlag does have the short name sf.

A quick reference for label searches

  • la.n "A" — a documented name-expression example.
  • la.h — the short form for the inherited hidden attribute.
  • la.v and not la.v — examples for visible and not-visible labels.
  • la.selected and not la.selected — examples for selected and not-selected labels.
  • la.sf false and la.sf — examples using the selection flag.
  • la.vf and la.vf false — examples using the visibility flag.

The point is not to memorize every abbreviation. Start with la, choose the attribute that matches the question you are asking, and use the full attribute name when it makes an expression clearer. For definitions inherited from the general node space, follow the relevant links in the reference.

For the complete attribute list and its examples, see the SAMSON label attributes reference.

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

Comments are closed.