Working Smarter with Visual Model Visibility in SAMSON

When working on complex molecular models, clarity is key. Whether you're setting up simulations or presenting molecular designs, being able to efficiently hide, reveal, or filter elements can make a huge difference in both productivity and communication.

In SAMSON, the visual model attribute space (vm) offers a set of attributes to help users manage how molecular elements are displayed. In this post, we'll explore how to effectively use these visibility-related attributes in the Node Specification Language (NSL) to control what you see—and what you don't—in your workspace.

Why visibility control matters

Let’s say you’re working on a large biomolecular complex. Among the hundreds of visual elements, you might want to focus only on a protein backbone, specific ligands, or perhaps highlight one type of representation. You could click through menus and toggle checkboxes, but that gets tedious quickly. This is where NSL and the vm attribute space come in handy, especially the hidden, visible, and visibilityFlag attributes.

Key attributes in the visual model attribute space

To control visibility using the vm space, here are the most relevant attributes:

  • vm.h: Short for hidden. Returns true if the visual model is hidden.
  • vm.v: Short for visible. Returns true if the visual model is visible.
  • vm.vf: Short for visibilityFlag. A more specific toggle related to whether the node's visibility is flagged on or off.

Let’s look at some usage examples in the NSL:

These filters are extremely powerful when combined. For instance:

This would give you all hidden models with visibility flags turned off—possibly models that were programmatically hidden or set to remain invisible during certain steps of your workflow.

Practical use cases

Case 1: Troubleshooting missing elements
If you’re unsure why a certain visual is not appearing, querying vm.h and vm.vf can help determine whether it’s hidden manually or flagged to be out of view. Quickly finding and revealing these nodes can save time and prevent mistakes.

Case 2: Preparing presentations or exports
Prior to exporting figures or creating snapshots, you may want to hide internal representations or non-relevant decorations. Use NSL queries like not vm.v to bulk revert visibility or ensure only key visuals are displayed.

Case 3: Scripting or automation
For users developing custom workflows or automations (e.g., using Python scripting), having access to consistent and queryable visibility flags allows for procedural control—important when batch processing large molecular libraries or creating reproducible project templates.

Conclusion

The vm attribute space in SAMSON’s Node Specification Language is a precise and flexible tool for visual model visibility control. Whether you’re diagnosing a model layout, customizing views for analysis, or setting up publishing-quality visuals, these tools help streamline your modeling experience.

To learn more, visit the full SAMSON documentation on visual model attributes.

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

Comments are closed.