Making Molecular Models Disappear (And Reappear) with NSL

Working with complex molecular systems often means dealing with a cluttered workspace. In SAMSON, the integrative molecular design platform, managing the visibility of various components in your scene can save time and reduce visual overload. If you’ve ever found yourself manually toggling models on and off or struggling to isolate particular elements, this post is for you.

SAMSON’s Node Specification Language (NSL) offers an efficient way to control what you see — or don’t see — using attributes of visual models like visible, visibilityFlag, and hidden. These attributes belong to the visualModel (or vm) attribute space, specialized for nodes that represent visual models.

When Visual Clarity Matters

Imagine you’re analyzing a protein-ligand complex and want to focus solely on the ligand’s interaction area. Disabling everything else manually is tedious — and prone to errors. With NSL, you can quickly specify visibility conditions based on attributes assigned to visual models.

Understanding Key Attributes

  • visible (vm.v): Indicates whether a model is currently visible.
  • visibilityFlag (vm.vf): Useful for programmatic or batch control of visibility using scripts.
  • hidden (vm.h): States if the model is meant to be hidden from the user interface.

Example Queries

Want to find all currently visible visual models? Use:

Need to hide all of them? Try combining with logical negation:

Filter models that have the visibility flag set to false:

You can also select elements using name filters. For instance, to find and hide all visual models beginning with “Lig”, use:

How This Helps

Controlling visibility with NSL is especially powerful when dealing with large scenes that include multiple visual representations — surface models, backbone traces, molecular orbitals, etc. With keyword-based selection, you can write expressive queries to show only what matters to you at a given time. It’s like having a spotlight operator for your molecular theater 🎭.

Tips for Effective Workflow

  • Combine vm.v with other attributes like vm.selected to selectively act on portions of a model.
  • Use negations (e.g., not vm.v) to quickly identify hidden elements.
  • Batch-process multiple visual models by grouping selection queries with spaces or logical operators like and.

Controlling visibility using NSL is not just about hiding things — it’s about creating clarity. By learning a handful of attribute names and logical operators, you can simplify your visualization space and focus on the science that matters.

You can refer to the full documentation of visibility-related attributes in the SAMSON Node Specification Language by visiting the official documentation page.

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

Comments are closed.