A quieter molecular scene starts with the right label query

When a molecular scene gets busy, labels can become part of the problem: they overlap, distract from nearby structures, or make it harder to find the annotation you need. A focused Node Specification Language (NSL) query can help you target label nodes by properties such as name, visibility, or selection state—without confusing them with other kinds of nodes.

The key detail is the attribute space: label, abbreviated la, matches only label nodes. That makes it a useful starting point when your goal is to work specifically with labels. The attributes listed here are inherited from the more general node attribute space, but you can use them through the label prefix.

Find labels by name

If you are looking for a label with a particular name, use the name attribute, n, followed by a quoted string:

  • la.n "A"
  • la.n "L*"

These are examples from the label reference. Quotes matter: the possible values for name are strings in quotes. If you know the label text, starting with a name query is a practical way to narrow your attention before working with visibility or selection-related properties.

Check visibility without guessing

Labels expose both visible (short name v) and hidden (short name h). Their documented examples are:

  • la.v and not la.v
  • la.h and not la.h

These expressions let you specify either side of a true/false property. For example, if you are trying to inspect labels that are not visible, not la.v is the documented form to try. If you are thinking in terms of the hidden attribute instead, use la.h or not la.h. Keeping the property name explicit can make a query easier to read later, especially when you return to a complex scene after a break.

Be precise about selection

There are two selection-related entries in the label attribute list: selected and selectionFlag. The examples include la.selected, not la.selected, la.sf, and la.sf false. One small but useful detail: selected does not have the short name s in the label attribute space. Use the full form la.selected rather than assuming that shorthand applies here.

A simple troubleshooting routine

  1. Start with the label prefix, la, so the query is limited to label nodes.
  2. Choose one property to investigate: name, visibility, hidden state, or selection state.
  3. Use the documented short name where available, such as la.n, la.v, or la.sf.
  4. For a true/false attribute, check the positive and negated forms shown in the reference.
  5. If a query does not express what you intend, verify the exact attribute spelling and whether that attribute has a short name.

This one-property-at-a-time approach helps isolate a mismatch: is the label name different than expected, is its visibility state the issue, or are you looking at selection state instead? It also avoids treating every annotation in a molecular scene as though it were the same kind of object.

For the complete list of label attributes and their examples, see the SAMSON label NSL reference.

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

Comments are closed.