Easily Find Hidden Molecules in Your Model with Node Visibility Flags

When working with complex molecular models, it’s all too common to lose track of components that seem to disappear from view. Whether it’s atoms missing from a ligand or entire visual models vanishing without notice, navigating a crowded project in SAMSON can sometimes feel like searching for nanoneedles in a molecular haystack. Fortunately, there’s an easy way to pinpoint what’s visible and what’s not—using node visibility flags in the NSL.

In SAMSON, node visibility is governed by two related concepts:

  • node.visibilityFlag (n.vf): indicates whether a node is flagged as visible or not, regardless of its parent.
  • node.visible (n.v): more practical—it tells whether a node is actually visible in the scene, accounting for the visibility status of all its ancestors.

This subtle difference matters. A node’s visibilityFlag might be true, but if one of its parent nodes is hidden, the node itself won’t be visible.

Quickly Selecting All Visible Nodes

When you need to isolate just the visible part of your model, use:

This returns all nodes that are truly visible onscreen, no matter where they are in the data graph.

Finding Hidden Nodes

To inspect what’s hiding and potentially bring it back into view, try:

This selects all genuinely invisible nodes. Useful if you suspect elements of your model are being hidden by accident, or nested in a hidden parent node.

Diagnosing Visibility Issues

If a node is not appearing as expected, the issue may lie with either its flag or one of its parent flags. To check if a node itself is invisible (regardless of parents):

Conversely, to find nodes where the issue might lie higher up the hierarchy, identify hidden nodes whose visibilityFlag is true:

This helps when you’ve forgotten you collapsed or hid an entire group earlier.

Visual Model Trouble? Try This

Visual models like van der Waals surfaces or cartoon ribbons might also be hidden. To find visible ones, use:

Or, if you want to list all hidden visual models:

This is handy when rebuilding a visual scene or exporting specific representations.

Combining Visibility with Categories

Layering visibility with keywords gives even more control. For example:

This matches all ligands that are not visible. A real time-saver if part of your binding site goes missing during modeling tweaks.

Understanding and using node visibility flags allows you to double-check the state of your model with precision. As molecular assemblies grow in size and complexity, being able to quickly “unhide” key parts of your systems streamlines both visualization and modeling workflows.

Learn more about how visibility and other node attributes work in the full documentation on SAMSON’s Node Specification Language (NSL).

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download the latest version of SAMSON at https://www.samson-connect.net.

Comments are closed.