A Clean Way to Filter Notes in SAMSON Using NSL

Molecular modeling projects often become complex, especially when visualizing or organizing annotations amidst large systems. If you’re working with numerous note nodes in SAMSON, it’s easy to lose track of which notes are visible, hidden, or relevant at a given moment. Fortunately, the Node Specification Language (NSL) provides a structured way to filter and control note attributes.

In this blog post, we explore how to use NSL’s note attribute space to filter and manage note nodes efficiently. This can be a big time-saver—especially when juggling complex molecular annotations or collaborating across teams.

What are Note Nodes?

Note nodes in SAMSON help users annotate their models. These notes can include text, highlights, or reminders. As projects grow, being able to control what’s shown or hidden becomes important.

That’s where NSL’s note attribute space comes in. You can target note nodes using nt, and combine it with specific filters to locate or control exactly what you need.

Common Note Attributes and Their Uses

The following attributes are supported for note nodes in NSL:

  • hidden (nt.h): Check if a note is hidden.
  • name (nt.n): Filter notes by name, using quoted string values. Useful with wildcards like "L*".
  • selected (nt.selected): Check if a note is currently selected. This attribute doesn’t have a short form.
  • selectionFlag (nt.sf): Check or change selection status without actually selecting the note.
  • visibilityFlag (nt.vf): Test if the note should be visible according to visibility rules.
  • visible (nt.v): See if the note is effectively visible in the viewport.

Usage Examples

Here are a few common scenarios where NSL can help:

1. Filter All Visible Notes

This returns all notes currently visible on screen.

2. Hide All Notes Starting with a Specific Name

This can be used to isolate notes with names starting with “L” that are currently visible, which you may want to toggle visibility for.

3. See All Unselected Notes

Good for quickly identifying which annotations haven’t been interacted with yet.

Why This Matters

When managing models with hundreds of nodes, being able to quickly narrow down what matters can massively reduce cognitive load. Whether you’re working interactively, automating display logic, or preparing scenes for export or publication, having control over note visibility and selection provides better workflows.

What makes this powerful is that these filters can be combined with other node filters from SAMSON’s broader NSL capabilities. For example:

This would select atoms associated only with visible notes (hypothetically, if notes were associated with specific selections).

Ready to Dive Deeper?

To explore all supported note attributes and learn more about how they inherit functionality from the general node attribute space, visit the full documentation:
https://documentation.samson-connect.net/users/latest/nsl/note/

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

Comments are closed.