In molecular modeling projects, clarity matters. Whether you’re preparing a figure for publication 🧬 or inspecting large biomolecular structures, clutter can make it hard to analyze or present your data. One common issue modelers face is toggling visibility efficiently across various elements in their molecular scene.
The Node Specification Language (NSL) in SAMSON provides a flexible way to query and filter nodes—including presentation nodes—based on visibility status. In this post, we focus on using presentation attributes, specifically the visibilityFlag (vf) and visible (v) attributes, to help simplify molecular scene management.
Understanding Visibility in SAMSON’s NSL
Visibility in SAMSON is tracked in two ways:
pr.vf: Controls whether a node should be visible.pr.v: Indicates whether the node is actually visible after all flags and conditions are taken into account.
This distinction makes it possible to construct advanced filters for controlling the appearance of elements in your molecular scene.
Why This Matters
Imagine you’re working with a complex protein that includes many chains, ligands, and visual representations (like surfaces, cartoons, or sticks). Trying to hide just the solvent-accessible surface while keeping the cartoon representation visible can quickly become frustrating—especially if done manually.
Instead, you can use the NSL to filter only what you need:
|
1 |
pr.vf false |
This will match presentation nodes that are marked as not meant to be shown. You can also use:
|
1 |
not pr.v |
to identify presentation nodes currently not visible in the scene, regardless of the flag settings.
Practical Use Case
Suppose you’re preparing slides and want to temporarily hide all labels without deleting or modifying the structure. You can run a filter like:
|
1 |
pr.n "Label*" and pr.v |
This will select all visible presentation nodes whose name matches Label*. You can then hide them using the visibility control.
Combining Filters
Filters become even more powerful when you combine them:
|
1 |
pr.n "Surface*" and not pr.v |
This selects all surface-related nodes that are currently hidden. Useful for quickly identifying which elements of your molecular visualization won’t be rendered.
Summary Table
| Attribute | Short Name | Example |
|---|---|---|
| Visible | v |
pr.v, not pr.v |
| Visibility Flag | vf |
pr.vf, pr.vf false |
These tools might seem small at first glance, but they help you avoid clicking through layer after layer of trees when trying to manage what’s visible in your model. Having a clear scene helps you and your collaborators stay focused on the science—not the clutter.
To learn more, visit the full documentation: https://documentation.samson-connect.net/users/latest/nsl/presentation/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download and get started at https://www.samson-connect.net.
