When working on complex molecular systems, visual clarity is essential. Whether you’re preparing a figure for publication or curating snapshots for a presentation, chances are you’ve had to hide or reveal parts of your molecular model. But which parts should be shown, and how can you precisely control them?
This is where the visibility-related attributes of SAMSON’s Node Specification Language (NSL) become particularly helpful. Let’s explore a subset of the Visual Model attribute space that lets you manage visibility efficiently: hidden, visible, visibilityFlag, and selectionFlag.
Why visibility control matters 🧬
Imagine you’ve built a large biomolecular complex that contains a protein, a ligand, and a nanocarrier. You only want to visualize the ligand inside its binding pocket for a clear illustration. You could manually toggle objects in the graphical interface, but this approach becomes inefficient when working with large models or automation workflows.
By using NSL, you can write expressive queries to control visibility directly via the scripting or search interface. This lets you make repeatable visual changes, useful in analysis pipelines or during collaborative work.
Visibility-related attributes
Here’s a breakdown of the main attributes relevant to visibility:
vm.h(hidden): Indicates whether a visual model is hidden. Example:vm.hselects all hidden visual models.vm.v(visible): Indicates whether a visual model is visible. Example:not vm.vfinds all non-visible models.vm.vf(visibility flag): Primitives set via the visibility flag checkbox in GUI. More nuanced thanhidden.vm.sf(selection flag): Useful if your visibility is tied to selection logic. Example:vm.sfpicks all selected nodes where the visual flag is enabled.
Examples from practice
To show only the models that are currently not visible but own their materials:
|
1 |
not vm.v and vm.om |
To isolate hidden models named starting with “L”:
|
1 |
vm.h and vm.n "L*" |
Need to ensure only explicitly visible models are displayed regardless of additional logic?
|
1 |
vm.vf |
When it gets confusing…
Note that hidden and visible are not simple inverses of one another in some advanced cases. Internal conditions and GUI states might cause nodes to be treated as non-visible even when hidden = false. That’s why exploring combinations of visibility attributes is important for full control.
This kind of expressiveness is a time-saver during repetitive visual tasks, and can also help implement logic for simulation snapshots, selective rendering, and automated structural inspection.
To explore all attributes in the vm namespace—including visibility, selection, and naming—visit the full documentation here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
