Controlling What You See: A Guide to Molecular Model Visibility in SAMSON

When working on complex molecular systems in SAMSON, clarity is key. With large assemblies, overlapping structures, and multiple representations, staying focused on relevant components can quickly become challenging. This is where understanding how to control the visibility of presentation nodes becomes essential.

SAMSON’s Node Specification Language (NSL) gives users powerful tools to fine-tune which molecular models, visual representations, or annotations are shown or hidden. By using presentation attributes in the presentation (or pr) attribute space, users can easily select what makes it into view — and what stays out.

What Are Presentation Nodes?

Presentation nodes in SAMSON refer to the visual representations of molecular models — such as ribbons, surfaces, and labels. Unlike data nodes (which store information), presentation nodes mainly govern how molecules are displayed. Fine control over these allows for cleaner visuals and a more streamlined user experience.

Using Visibility Attributes

There are several useful visibility-related attributes in the pr namespace. Here’s a summary of the most relevant ones for controlling what is shown:

Attribute Short name Description Example
visible v Checks whether the node is currently visible pr.v, not pr.v
visibilityFlag vf Specifies whether the node should be visible or not pr.vf false
hidden h Returns whether a node is hidden by a display rule or context pr.h, not pr.h

Making Visual Adjustments Efficiently

To hide all protein ribbons labeled with names starting with “L,” you could write:

This line filters presentation nodes whose name starts with “L” and sets their visibility flag to false, effectively hiding them in the viewport.

Similarly, if you’re trying to find everything that’s currently visible, use:

Or invert it to focus on things that are explicitly hidden:

Why This Matters

Working with large molecular systems often leads to clutter: overlapping atoms, multiple visual styles, or legacy elements you no longer need to see. Being able to control presentation node visibility means you can:

  • Filter out noise
  • Focus on what matters for your current task
  • Prepare cleaner visuals for colleagues, reports, or publications
  • Debug complex visualizations by isolating or hiding individual components

Hidden vs. visibilityFlag vs. visible

These three might seem similar, but they serve slightly different purposes:

  • pr.vf (visibilityFlag): what visibility was requested by the user
  • pr.h (hidden): whether the node is currently hidden by internal logic
  • pr.v (visible): whether the node is currently being rendered

This subtle distinction enables better root cause analysis when something doesn’t display as expected. For example, a node might not be visible (pr.v is false), even if pr.vf is true, indicating it might be hidden due to layered display rules.

To learn more and dive deeper into the full set of presentation attributes, visit the original documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.