In molecular modeling, especially when working with complex systems or animations, user interfaces packed with many nodes can quickly become overwhelming. It’s sometimes surprisingly hard to focus on what really matters—perhaps a specific ligand interaction or a folding mechanism—when multiple animations and data visualizations are layered in a busy viewport.
If you’ve been spending time manually toggling the visibility of animations in SAMSON, this short guide might just make your day easier. Here’s how to programmatically control visibility using the visible, visibilityFlag, and hidden attributes in SAMSON’s Node Specification Language (NSL). It can save you a lot of clicking and provide a smoother workflow.
Understanding the Visibility Trio
In SAMSON’s NSL, the following attributes (in the animation an attribute space) are used to manage display:
an.v: Checks whether the animation is currently visible.an.vf: Controls the visibility flag of the animation node.an.h: Checks if the animation is hidden.
The subtle but important difference between these attributes is:
visibleis a combination of display states and the current settings.visibilityFlagdirectly controls whether the node is flagged to appear.hiddenis inherited from the general node space and can behave differently in specific contexts.
Useful Queries
Say you have multiple animations and want to show only those beginning with “Ligand”. Instead of toggling visibility manually for each animation node, you can focus selectively using NSL:
|
1 |
an.n "Ligand*" and an.v |
To hide them instead, toggle their visibilityFlag:
|
1 |
an.n "Ligand*" and an.vf false |
Alternatively, list all currently hidden animations:
|
1 |
an.h |
This feature is extremely helpful when reviewing animation-driven structure changes. For example, you might want to hide unimportant animations when evaluating docking sequences or protein unfolding results.
When to Use Each Attribute
If you’re simply checking what’s visible on screen, an.v is your go-to. If you’re trying to control display programmatically, an.vf is the attribute to use. Keep in mind that an.h can be true even when an.vf is also true, so they’re not strictly interchangeable.
By memorizing these differences and using NSL’s concise syntax, you can manage complex visualizations much faster, especially during real-time simulations or large batch processing sessions where interface performance matters.
To learn more and explore other NSL attributes, see the full documentation page here: https://documentation.samson-connect.net/users/latest/nsl/animation/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
