Effortless Filtering of Visible Molecular Presentations in SAMSON

When working with complex molecular systems in SAMSON, keeping track of what is visible, selected, or hidden can quickly become overwhelming. Especially for users handling layered molecular scenes—such as structures with multiple representations, annotations, or overlays—rapidly filtering and managing displayed objects becomes critical.

One of the lesser-known but extremely helpful features in SAMSON is the ability to filter presentation nodes using the visible attribute in the Node Specification Language (NSL). This lets you quickly isolate or exclude representations in your workspace without manual clicking through the document hierarchy.

What Are Presentation Nodes?

In SAMSON, presentation nodes control the visual representation of molecular data. These include various renderings like surfaces, bonds, labels, meshes, etc. Unlike data nodes (which contain the actual molecular structure), presentation nodes dictate how things look.

The NSL allows for precise queries through attribute spaces. To target presentation nodes, you use the prefix pr, which refers to the presentation attribute space.

Using pr.v for Filtering by Visibility

The visible attribute—short name v—lets you filter presentation nodes based on whether they’re currently visible in the viewport.

  • pr.v returns all visible presentation nodes.
  • not pr.v returns all invisible presentation nodes.

This is especially useful when you’ve hidden certain layers or when you’re auditing the visibility state before taking a snapshot or exporting a view.

Combining Visibility with Other Filters

You can combine visibility filtering with other attributes like names or selection states.

  • To find all visible surfaces named with prefix “L”: pr.v and pr.n "L*"
  • To find all invisible but selected nodes: not pr.v and pr.selected

These queries bring tremendous precision to your workflow. For instance, if you’re preparing a publication image and need just certain elements, the visibility flags help you script that setup rather than doing it manually.

Visibility vs. Visibility Flag

A subtle but useful distinction: visible is the final visibility state after all hierarchy and display conditions are taken into account. There’s also a visibilityFlag (short name vf) which is a more direct user-controlled flag.

Use pr.v for what’s ultimately shown. It can differ from pr.vf depending on parent node states and visibility inheritance.

Summary

If you’ve ever felt lost trying to manage your scene’s visual complexity, the pr.v filter is a straightforward tool you’ll appreciate. It enables you to script, audit, and manipulate your scene more effectively—especially when working with large and detailed molecular systems.

To explore other presentation node attributes like selected, name, or selectionFlag, visit the full documentation page below.

Learn more in the full documentation

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

Comments are closed.