If you’ve ever worked on a complex molecular model in SAMSON, you know how important annotations—such as notes—can be. Notes are extremely helpful for adding context, reminders, or visual explanations for you and your collaborators. However, when the number of notes grows, your workspace can quickly get cluttered. This can make it difficult to maintain a clear view of your molecular system or even mislead collaborators who see annotations that might not be relevant to them.
Fortunately, SAMSON provides fine-grained control over note visibility through its Node Specification Language (NSL). This post focuses on how you can use NSL attributes—especially nt.visible, nt.visibilityFlag, and nt.hidden—to better manage which notes are shown or hidden in your workspace.
Understanding the Visibility Attributes
When working with note nodes, SAMSON allows you to filter and select based on the following visibility-related attributes from the nt (note) attribute space:
nt.v(visible): Determines whether a note is currently visible. Use this to check or set the actual visibility state.nt.vf(visibilityFlag): Represents the intent to render the note as visible. Iffalse, the note is hidden, regardless of other attributes.nt.h(hidden): Inversely related to visibility; a hidden node is not shown.
These three attributes work together to give you complete control over what gets displayed. For instance:
|
1 |
nt.vf false |
This expression can be used in NSL selectors or filters and will match any notes that are explicitly flagged to not be visible.
Practical Use Cases
Let’s say you’re working on a large protein structure and you’ve added a dozen notes pointing out active sites, potential mutations, and docking results. At some point, the annotations cloud the clarity of your structure. Here’s what you can do:
1. Hide All Notes
|
1 |
not nt.v |
This will allow you to exclude all currently visible notes from your selections or actions.
2. Show Only Specific Notes
|
1 |
nt.n "Active Site*" and nt.v |
This selects all visible notes where the name matches “Active Site*” (such as “Active Site 1”, “Active Site 2”, etc.). Useful when only certain annotations are currently relevant.
3. Toggle Visibility On or Off
Use NSL queries in combination with scripting commands or selection operations to toggle specific notes on or off based on name or other attributes:
|
1 |
nt.n "MutationHighlight" and not nt.vf |
This selects hidden notes with the name “MutationHighlight”, so you can turn them back on when needed.
A Tip on Attribute Shortcuts
SAMSON supports short names for attributes to streamline your workflow. For visibility handling, the key short names are:
vforvisiblevfforvisibilityFlaghforhidden
This means that nt.vf false is equivalent to writing note.visibilityFlag false.
Conclusion
Clear visual communication is critical when working in a shared modeling environment or during presentations. By using NSL’s visibility-related attributes like nt.v, nt.vf, and nt.h, you can ensure that only the most relevant annotations are shown—exactly when you need them.
Take a moment to review your projects and see how much more streamlined your modeling sessions become simply by better managing note visibility.
Learn more in the official documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
