A simple way to control what you see in your molecular model

When working with complex molecular systems, visualization quickly becomes one of the biggest challenges. With hundreds or thousands of nodes representing atoms, molecules, and structures, how can you isolate what truly matters? The Node Specification Language (NSL) in SAMSON offers a powerful solution with attribute selectors that let you filter precisely which nodes you want to focus on.

In this blog post, we’re focusing on presentation-level visibility attributes, a simple but effective way to declutter your interface and improve modeling precision.

What is a presentation node?

Presentation nodes refer to how your data is visualized—that is, what you actually see on screen. For example, if you’ve loaded a protein structure and it’s represented as a cartoon, each visual element is a presentation node. By targeting these nodes, you can control the display without affecting the underlying data.

Why use visibility attributes?

Sometimes you just want to hide parts of your model without deleting them. Or perhaps you’ve made a selection that contains multiple representations, and you only want to see ribbons, not surfaces. That’s where visibility flags come in.

Attribute Short name Description Example
visible v Whether the node is currently visible pr.v
not pr.v
visibilityFlag vf Whether the node is allowed to be seen pr.vf false
pr.vf

Controlling visibility in practice

Here are a few practical examples you might use in your NSL queries within SAMSON’s selection bar or Python scripting interface:

  • Select all visible presentation nodes:
    pr.v
  • Select all hidden (non-visible) presentation nodes:
    not pr.v
  • Select presentation nodes with the visibility flag turned off:
    pr.vf false

This ability becomes extremely useful in visual workflows. For instance, say you’ve created multiple representations of different conformations and want to show only one of them at a time. You can quickly switch what’s shown simply by toggling visible or visibilityFlag attributes, without removing any data.

Common workflow tip

A common situation is when you’re building molecular presentations for reports or teaching. You might add surfaces, meshes, or molecular orbitals and realize the view gets cluttered. Use pr.v false to clean it up and focus on a single aspect of the system. When it’s time to bring elements back, just switch the query to not pr.v to find and show the hidden ones.

Visual clarity is not just aesthetic—it can significantly reduce mistakes when building or analyzing models. If you’re not using visibility attributes yet, try them out next time you’re modeling. It might save you more time than you expect.

To learn more about presentation attributes in NSL, visit the official documentation page:
https://documentation.samson-connect.net/users/latest/nsl/presentation/

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

Comments are closed.