When working on complex molecular systems in SAMSON, it’s common to generate multiple visual representations—such as surface views, ball-and-stick models, or ribbon diagrams—to highlight different structural features. But in large documents with many visual nodes, it quickly becomes difficult to find the relevant ones. 🤯
This is where the presentation attribute space of SAMSON’s Node Specification Language (NSL) becomes very useful. It allows you to filter or search specifically within presentation nodes—the ones responsible for how things are rendered—making it easy to clean up views, toggle visibility, or select specific representations, without having to operate node-by-node manually.
What are presentation filters in NSL?
The NSL attribute space pr deals with presentation nodes. You can use it to control or query attributes like:
- Whether a node is currently visible or not
- Whether it has a selection flag set
- The name of a visual representation
- And more, such as
hiddenandvisibilityFlag
For example, if you want to find all visible representations in your document, you’d write:
|
1 |
pr.v |
This matches presentation nodes that are currently visible. If you’re aiming to hide them, you can follow up by toggling visibility directly in the user interface once selected.
Examples: Practical use cases
1. Hide all hidden visualizations (i.e., make them visible again)
|
1 |
not pr.v |
This matches presentation nodes that are not visible. You can then enable visibility for these nodes in bulk.
2. Find representations by name
|
1 |
pr.n "Ribbon*" |
This query selects all representations whose names start with “Ribbon”. This is especially helpful when you’ve created many views and named them systematically.
3. Select only visible and selected representations
|
1 |
pr.v and pr.selected |
Combining the two flags restricts the result to presentation nodes that are both visible and selected, allowing for precise batch operations.
What’s the difference between visible and visibilityFlag?
The attribute pr.v (short for visible) checks if a presentation node is currently shown. Meanwhile, pr.vf (visibility flag) indicates the internal flag status, which might depend on more complex conditions. In practical terms, use pr.v when you want to match what’s currently on screen.
Why it matters
Efficiently managing visual representations is critical when you’re refining molecular systems, reporting key findings, or preparing great-looking figures. By using NSL’s presentation filters, you reduce clutter, focus your view, and reduce the chances of accidentally modifying the wrong node. It also saves a lot of manual clicking in large documents.
To learn more, visit the presentation filter documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
