When working with complex molecular models in SAMSON, adding notes to nodes can be a convenient way to annotate and keep track of specific elements or structural features. However, as the number of notes increases—especially in collaborative or long-term projects—it can get difficult to manage which notes are currently visible or hidden in the viewport. This can slow down your workflow and increase visual clutter.
Thankfully, SAMSON’s Node Specification Language (NSL) provides an effective solution by allowing you to filter notes based on specific attributes such as visibility. In this post, we’ll show you how note visibility attributes such as nt.v (note visible) and nt.h (note hidden) can help you quickly isolate, hide, or reveal notes based on their display status—all without diving into menus manually.
Why visibility filtering matters
Imagine you’re preparing a figure for publication or a teaching session. You only want to show specific notes relevant to your current focus. Without a way to filter efficiently, you would need to manually toggle each note on or off, which is tedious and error-prone. With NSL, you can quickly apply a filter such as:
|
1 |
nt.v |
This command displays only those notes that are currently visible. To view only hidden notes, you can use:
|
1 |
not nt.v |
Similarly, the hidden attribute can be used:
|
1 |
nt.h |
or
|
1 |
not nt.h |
This simple visibility filtering can be applied instantly, making it easy to toggle between different annotation layers or prepare specific node presentations.
Combining visibility with other attributes
One of the strengths of NSL is the ability to combine multiple filters together. For example, if you want to find notes whose names start with “L” and are currently hidden, you could use:
|
1 |
nt.n "L*" and nt.h |
This kind of multi-attribute filtering is especially useful in large systems where annotations are abundant. It gives you total control over what to see and what to leave out.
Visibility vs. Visibility Flag: What’s the difference?
While the visible attribute (nt.v) determines if a note is actually visible on screen, visibilityFlag (nt.vf) represents the visibility state that can be set programmatically or by user action. Similarly, both selected and selectionFlag serve complementary roles with regards to the selection status of nodes. Understanding this distinction becomes important in scripted workflows or when analyzing states over time.
Summary Table
The table below summarizes some of the visibility-related attributes you can use directly in your NSL queries:
| Attribute | Short Name | Values | Examples |
|---|---|---|---|
| visible | v |
true, false |
nt.vnot nt.v |
| hidden | h |
true, false |
nt.hnot nt.h |
| visibilityFlag | vf |
true, false |
nt.vf falsent.vf |
Using these attributes doesn’t just streamline your view—it minimizes distractions and can significantly speed up inspection and annotation-related tasks when working on intricate molecular systems.
To learn more and see the full list of note attributes available in NSL, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/note/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
