Making Label Selection Easier in Molecular Models with NSL

When working on large molecular systems, simplicity and speed are key. One common challenge among molecular modelers is quickly pinpointing the right label nodes—especially when scenes contain complex visual elements and nested structures. Whether you’re highlighting reaction intermediates or flagging specific atoms, effective selection techniques can save time and reduce frustration.

This is where the Node Specification Language (NSL) in SAMSON can help. More precisely, NSL’s label attribute space (la) provides an efficient filter set to identify label nodes based on visibility, names, and selection flags.

Why labels matter

Labels in SAMSON can be used for annotations, node descriptions, atom identifiers, and more. But once you’ve added multiple labels during your modeling sessions, selecting or hiding only the relevant ones can become tedious.

For instance, how do you select all labels that are visible and start with “L”? Or hide every label whose name matches a certain pattern? With NSL, the answer is a single line.

Working with the la attribute space

The la prefix in NSL targets only label nodes. By combining it with intuitive attribute names or short forms, you can specify exactly what you want. Here’s a summary of what you can access:

  • la.h: Labels that are hidden
  • la.v: Labels that are currently visible
  • la.n: Labels with specific names (strings in quotes)
  • la.sf, la.vf: Selection and visibility flags

Examples you can use immediately

To hide all labels starting with “L”, try:

This finds all visible labels whose name starts with “L”.

Need to select labels that aren’t visible? Use:

To find all labels regardless of name but that are currently selected:

Understanding the difference between visible, visibilityFlag, and hidden

These attributes might seem similar but serve different purposes:

  • visible (la.v): Whether the label is currently visible on screen.
  • visibilityFlag (la.vf): Indicates if the node can be made visible (useful in scripting).
  • hidden (la.h): A general flag inherited from the node class.

By combining these, you can fine-tune your label management process, avoiding unintended selections or visual clutter.

Lastly, NSL is designed for rapid workflows. All queries are evaluated in real time in SAMSON’s Find window or scripts. Label attributes aren’t unique to labels only—most are inherited from node-level definitions, which helps maintain a consistent filtering system.

To learn more, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/label/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.

Comments are closed.