When molecular modelers build and analyze complex systems, they often annotate their models using note nodes. These notes can contain textual information, comments, or metadata that are extremely useful during collaborative work or when reviewing projects later.
However, as projects grow, models can become visually cluttered. Notes may obstruct views or distract users who are primarily interested in the molecular structures themselves. Being able to selectively show or hide note nodes becomes critical.
Managing Notes with NSL
The Node Specification Language (NSL) in SAMSON provides a powerful way to manage these note nodes based on their attributes. In this blog post, we’ll focus on a small yet very practical subset of NSL functionality: using the nt.v and nt.h attributes to toggle visibility and hidden status of note nodes.
Attribute Overview
NSL provides attribute-based queries that let you filter and manipulate node selections. For note nodes, some particularly useful attributes include:
nt.v– visible: true if the note is currently shown in the viewport.nt.h– hidden: true if the note is part of the scene but not being rendered.
These attributes let you check for, hide, or show note nodes using simple queries inside SAMSON’s search or scripting environments.
Common Use Cases
🔎 Decluttering a scene:
Suppose your molecular model contains several note nodes used for annotations, but you now want to capture a clean screenshot of the molecule without any extra labels.
|
1 |
not nt.v |
This query selects note nodes that are not visible. Conversely, to hide all visible notes:
|
1 |
nt.v |
You can then disable or hide the selected notes using SAMSON’s standard visibility tools.
📋 Focusing on specific annotations:
If your notes follow a naming convention (e.g., “Lysine region”), you can combine attributes:
|
1 |
nt.n "Lysine*" and nt.v |
This shows only those notes that are visible and whose names start with “Lysine”.
Hidden vs Visible: What’s the Difference?
The nt.h (hidden) attribute reflects internal visibility state and can offer finer control when scripting. Meanwhile, nt.v reflects what is currently visible in the viewport. In most workflows, you’ll be using nt.v more often to quickly determine or alter what users see.
Why This Matters
Controlling the visibility of annotations allows you to:
- Work more efficiently in complex models
- Prepare clean visuals for presentations or publications
- Focus collaborators’ attention during review sessions
- Reduce cognitive overload during analysis
The Node Specification Language offers a readable and declarative way to manage visual complexity within SAMSON — and using attributes like nt.v and nt.h is a lightweight yet effective strategy.
To explore all note attributes you can control using NSL, visit the full documentation page here: 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.
