When working on complex molecular models, it’s easy for presentations to become cluttered. Whether you’re preparing a figure for publication or analyzing a particular molecular feature, hiding or showing parts of a molecule exactly the way you want is crucial. Did you know that in SAMSON, you don’t need to manually click around to show or hide things? You can express precise visibility criteria using the Node Specification Language (NSL).
This post introduces three visibility-related attributes from the presentation attribute space in NSL: pr.v, pr.vf, and pr.h. Each has its own logic, and understanding the difference helps you better control how your structures appear.
1. visible (pr.v)
This attribute checks whether a presentation node is actually visible in your workspace. If a node is pr.v false, it’s not shown — no matter why. What’s helpful is that this includes both user intention and system state.
For example, the same presentation node might be:
- Explicitly hidden by the user
- Hidden because an ancestor is hidden
- Or managed by a visibility flag (yes, we’ll get there next)
To select all presentation nodes currently shown on screen, simply use:
|
1 |
pr.v |
To filter out what’s not visible:
|
1 |
not pr.v |
2. visibilityFlag (pr.vf)
This one tracks the internal visibility flag state of a node — basically, whether the software is set to show this node if no parent or context is hiding it. This is useful if you’re scripting or debugging complex visibility hierarchies.
To find nodes where the internal flag is off (maybe unintentionally):
|
1 |
pr.vf false |
To find ones with the flag on:
|
1 |
pr.vf |
3. hidden (pr.h)
This simple Boolean tracks user intent. Did you tell SAMSON to hide this node? Then pr.h will be true. It’s about decisions you made explicitly, not how visibility behaved due to system rules.
Example:
|
1 |
pr.h</code> <br><code>not pr.h |
This is handy for undoing visibility changes or confirming specific manual changes you made earlier.
Which One Should You Use?
Think of these three attributes as layers:
pr.h: Did I hide it?pr.vf: Does the software think it should be shown?pr.v: Is it actually being shown right now?
They’re not interchangeable, but together they provide complete control over what you see. If a node has pr.vf and not pr.h, but is still not visible, chances are a parent node is affecting it.
Learning to combine them in NSL allows you to script clean views, check for unintended hides, or build visual layers dynamically. For example, to get all visible nodes you’ve set to be visible yourself (excluding anything hidden by ancestors):
|
1 |
pr.vf and not pr.h and pr.v |
To learn more, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/presentation/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
