When working on large molecular systems, especially in collaborations or when re-opening older projects, it’s surprisingly common to be puzzled by missing visual elements that should be there. Whether it’s a surface view, a label, or an entire representation, something might be mysteriously invisible. Figuring out what’s currently hidden—and why—takes time and can delay your work.
Fortunately, in the Node Specification Language (NSL) of SAMSON, there’s a clean and structured way to track and control which visual models are visible, hidden, or partially visible thanks to a set of visual model attributes.
Understanding Visual Visibility Attributes
In SAMSON, visual objects such as graphical representations, surfaces, and annotations fall under a category called visualModel, with a short attribute prefix vm. You can filter these nodes based on various flags and properties that control visibility. Let’s explore the four that help the most when you’re wondering if something is simply hidden, invisible, or disabled.
vm.hidden: Boolean flag indicating whether the node is hidden. You can filter nodes withvm.h(i.e.,vm.h true) to quickly identify hidden ones.vm.visible: Also a boolean, but different fromhidden. This indicates whether a node is currently visible in the viewport after accounting for both internal and global controls.vm.visibilityFlag(vm.vf): Separately tracks whether the node’s visibility is currently enabled. A node could be technically visible, but if this flag is set to false, it won’t be displayed.vm.selectionFlag(vm.sf): This helps when selections are involved in toggling visibility. Some scripts or modules use selection-based visibility toggles.
Example Use Case: Revealing Hidden Elements
Suppose you’ve opened a model and the protein backbone representation isn’t appearing. A quick NSL query like this:
|
1 |
vm.h |
…gives you all visual models where hidden=true. You can then inspect or modify their state individually.
If nothing shows up with vm.h, it might be that visibility is off rather than hidden. Try:
|
1 |
not vm.v |
Or look for disabled visibility flags:
|
1 |
vm.vf false |
This layered approach allows you to understand exactly why something isn’t displayed—and fix it fast.
Bonus Tip: Helpful Short Names
Many of these visual model attributes have short names that make querying quicker. Here’s a small table to help you remember them:
| Attribute | Short Name |
|---|---|
| hidden | h |
| visibilityFlag | vf |
| visible | v |
| selectionFlag | sf |
Bring It All Together
Combining these attributes in a query can give powerful insights. For example:
|
1 |
vm.h or not vm.v or vm.vf false |
This catches any visual node that isn’t properly displaying. It’s a lifesaver when you’re deep into visual analysis or preparing a figure for publication.
Understanding visual model attributes doesn’t just help you fix display issues faster—it can also help you automate visibility control in larger scripts or when developing Extensions.
Learn more at the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/visualModel/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
