“Where did my structure go?”
If you’ve ever worked on a molecular system in SAMSON and suddenly found that parts of your molecule seem to disappear or won’t respond to selection, you’re not alone. Visibility issues are a common source of confusion for molecular modelers—especially in complex systems with multiple hierarchical components.
Through this post, we’ll explore how SAMSON classifies visibility for nodes using Node Specification Language (NSL), and how you can effectively troubleshoot and control what’s visible or hidden in your molecular design environment.
Why visibility matters
In SAMSON, nodes represent structural elements such as atoms, residues, molecular groups, and so on. Visibility is not just about rendering—it also affects selection, editing, and analysis. A ‘hidden’ node could be causing your tool to malfunction or respond unexpectedly.
Three visibility-related attributes
SAMSON provides three distinct but connected node attributes for dealing with visibility:
node.hidden(n.h): Indicates whether a node is hidden, either due to its own visibilityFlag or one inherited from an ancestor.node.visibilityFlag(n.vf): Reflects the node’s own flag, independent of ancestors.node.visible(n.v): A high-level indicator that considers both the node’s own flag and the flags of its ancestors.
The difference between visibilityFlag and visible
This is key: setting a node’s visibilityFlag to true doesn’t guarantee that it’ll be truly visible. Why? Because any of its ancestors (e.g., the parent molecule or chain it belongs to) might have their visibilityFlag set to false, cascading invisibility down the tree.
To diagnose visibility issues, try using these queries in NSL:
n.vf false: See nodes that have their visibility flag turned off.not n.v: Check what’s not visible, regardless of why it’s hidden.n.h: See what’s hidden due to visibility flags set anywhere up the hierarchy.
A practical example
Let’s say you’re trying to visualize a water molecule but it’s not showing up. Your instinct might be to check n.vf (visibility flag) on the water node, but that might not be enough. Its parent molecular group might be hidden, and the water node inherits that state. In that case, hasMaterial and selected queries won’t work as expected either.
Instead, run:
|
1 |
not n.v |
to list all nodes that aren’t visible. From there, navigate up the hierarchy using the Inspector to check which ancestor is hiding your node.
Toggling visibility efficiently
You can use NSL queries directly in the Find panel to toggle visibility:
- Select nodes hidden due to their own flag:
n.vf false - Select nodes that are not visible (including inherited flags):
not n.v - Toggle visibility from the context menu in the document view
Remember, visibility is both local and global—being aware of this can save hours of debugging and give you more control over your model display.
Learn more
For a deep dive into node attributes and the complete overview of visibility, see the full documentation page: https://documentation.samson-connect.net/users/latest/nsl/node/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
