When working on complex molecular models, visual clarity is essential. Whether you’re trying to isolate a ligand, examine interactions, or prepare a clean visual for publication, quickly showing or hiding parts of a scene is a common need.
SAMSON’s Node Specification Language (NSL) includes a dedicated attribute to help you do just that: visible (short name: v) in the pr (presentation) attribute space. Learning how to use this simple filter can save you a lot of time and keep your workspace decluttered.
What Is the ‘visible’ Attribute?
The pr.visible attribute allows you to identify presentation nodes in your molecular scene that are currently visible or not. This is particularly useful when handling large biomolecular systems where numerous visual elements (e.g., surfaces, ribbons, atom spheres, etc.) are layered together.
The visible attribute can be used in NSL queries with values:
true– to match nodes that are currently visiblefalse– to match nodes that are currently hidden
The short name for this attribute is v, which makes it quick and easy to include in more complex NSL filters. Here’s how you use it.
Basic Examples
To find all visible presentation nodes:
|
1 |
pr.v |
To find all hidden presentation nodes:
|
1 |
not pr.v |
This can be combined with other attribute filters to narrow down your selection. For example, if you want to find visible presentation nodes named “AminoAcid*”:
|
1 |
pr.v and pr.n "AminoAcid*" |
Why It Matters for Molecular Modeling
Let’s say you’re trying to isolate only the atoms involved in a specific hydrogen bond network. After applying some filters using NSL, you may find that many representations like surfaces or labels are cluttering the view. Instead of manually clicking through the Document View and toggling visibility, you can use pr.v as a filter to select and hide unneeded nodes programmatically.
This attribute also works full circle: after hiding elements, you can use not pr.v to re-select them and bring them back when ready. These simple switches mean you control your visual output with precision and speed—something every modeler can appreciate when facing tight project deadlines.
When to Use Visibility Filters
- Preparing clean visuals for publications or presentations
- Focusing on specific interactions or substructures
- Debugging models or inspecting overlapping representations
- Reducing visual clutter in large systems
Because the visible attribute is shared with the core node.visible attribute, users already familiar with node-based querying in NSL will find this consistent and easy to adopt.
Pro Tip
Combine pr.v with selection or name filters to script dynamic scenes. For example, hide all unselected presentations quickly:
|
1 |
pr.v and not pr.selected |
This allows you to maintain focus only on the areas of interest.
To learn more about presentation attributes, visit the official SAMSON documentation page at 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.
