When managing complex molecular models, visibility becomes more than just a display preference—it’s essential to understanding structure, editing efficiently, and communicating results. In SAMSON, an integrative platform for molecular design, visibility is more than a toggle: it’s a structured, queryable attribute that lets you select and control parts of your model based on what’s shown, hidden, or inherited from parent nodes.
This blog post explores how to use node.visible, node.hidden, and their related attributes to quickly find visible or invisible elements—and explains how SAMSON defines visibility beyond what meets the eye.
Why visibility matters
Molecular scenes in SAMSON often contain several levels of nested content: documents, molecules, atoms, visual models, materials, and more. Some of these may be hidden because you explicitly hid them. Others might be invisible because a parent node (e.g., a molecule or chain) is hidden, and this status propagates to children. Understanding whether nodes are actually visible requires more than a glance.
The difference between node.visible and node.visibilityFlag
Here’s where SAMSON’s Node Specification Language (NSL) comes in handy. Instead of clicking each part of your model manually, you can select nodes with visibility-related attributes.
node.visible(short namen.v): Matches nodes that are truly visible—i.e., their own visibility flag is true and the visibility flags of all their ancestors are also true.node.visibilityFlag(short namen.vf): Matches nodes based only on their own visibility flag, regardless of ancestors.node.hidden(short namen.h): Matches nodes that end up being hidden, either directly or by inheriting from hidden parents.
Here are a few examples:
|
1 2 3 4 5 6 7 8 |
// Find all visible nodes n.v // Find all nodes whose own visibility flag is true n.vf true // Find nodes that are actually hidden (due to own or inherited visibility flag) n.h |
These expressions can help you tackle questions like:
- “Why isn’t this atom showing in the viewer?” Try
not n.vto find hidden nodes. - “What is currently visible in my model?” Use
n.vto highlight visible elements. - “Are some parts of my scene unintentionally hidden by a parent node?” Use
n.vf truebutnot n.vto detect this discrepancy.
Quick troubleshooting workflow
Here’s a mini checklist when a part of your model isn’t showing:
- Use
n.vf falseto locate nodes whose visibility flag is off. - Try
n.hto find nodes that are hidden regardless of individual flags. - If you want to isolate what’s currently visible, use
n.v.
Combining these conditions with other NSL expressions (e.g., filtering by type or category) helps refine your model even faster:
|
1 2 |
// Select visible atoms inside ligands n.t a in n.c lig and n.v |
Bonus tip: Pair visibility with selection
Sometimes, you want to select and modify all hidden elements—perhaps to make them visible again. Use:
|
1 |
not n.v |
Then, toggle visibility from the interface or through scripting. It’s a fast way to streamline your modeling workflow.
Mastering these visibility attributes can help modelers avoid confusion and improve the clarity of large, complex molecular scenes.
To learn more about node attributes and NSL in SAMSON, visit the official 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.
