Trouble Seeing Labels in Your Model? Here’s a Precise Way to Control Visibility

When working with complex molecular designs in SAMSON, it’s easy to lose track of labels—especially when shifting between different states, selections, or visualization settings. If you’ve ever had the frustrating experience of wondering why a label isn’t visible (or why one won’t disappear), this post will help you make sense of it all. 🧬

Label elements in SAMSON are not just passive annotations. They are nodes with a set of attributes that control their appearance, selection status, and visibility. These properties are part of the label attribute space, accessible through the Node Specification Language (NSL).

Visibility vs. Visibility Flags

A key concept in SAMSON is that there are multiple ways something can be hidden or visible. If you’ve tried toggling labels on or off without success, it might be due to a conflict between visible and visibilityFlag, both of which are label attributes.

  • visible (la.v) tells you whether a label is ultimately visible to the user.
  • visibilityFlag (la.vf) determines whether the label is marked to be visible—depending on other factors (like parent visibility).
  • hidden (la.h) is another visibility-related flag inherited from the node attribute space.

Examples to Make It Practical

You can filter or query your label nodes using these attributes. For example:

These queries are highly useful when scripting, filtering, or analyzing large molecular systems with many labels. Want to highlight only the labels that are hidden due to global visibility settings? Use la.vf false. Need to revert all labels to a visible state? Use a script to toggle la.vf true.

Understanding Label Selection

Selection status often matters when choosing which labels to hide/show/delete. Here are helpful attributes:

  • selected (no short name) checks if a label is currently selected: la.selected.
  • selectionFlag (la.sf) is a boolean flag, useful to know whether the label is marked as selected during operations.

Putting It All Together

To find all labels that are hidden even though they are flagged to be shown and selected, you can chain attributes like this:

This is especially helpful when working with software-generated label nodes or large datasets where manual toggling becomes impractical.

For more detailed reference, visit the full documentation on label attributes here: https://documentation.samson-connect.net/users/latest/nsl/label/

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON here.

Comments are closed.