For molecular modelers working with large and complex systems, a common challenge is visibility management: how to quickly hide or reveal molecules based on specific properties. Whether you are hunting for just the visible ligands, identifying hidden molecular chains, or preparing clean and focused visualizations for presentations, manually toggling visibility can be both tedious and error-prone.
This is where SAMSON’s Node Specification Language (NSL) helps. In particular, the visibility control attributes for molecules allow you to write quick expressions to filter molecular data in seconds.
Understanding Visibility Attributes
In SAMSON, molecules inherit visibility-related attributes from the node attribute space. Specifically, there are three key attributes you can use:
visible(short name:v): Indicates whether the molecule is currently visible in the viewport, i.e., not hidden.hidden(short name:h): Simply the inverse ofvisible; true if hidden.visibilityFlag(short name:vf): Tracks the visibility state of a node regardless of selection or material states.
With just a few characters, you can find only the molecules you’re interested in. For example:
|
1 |
mol.v |
This expression will match all visible molecules.
|
1 |
not mol.v |
This will match all hidden molecules.
If you need more control, you can use mol.vf to work with the visibility flag directly. For instance:
|
1 |
mol.vf false |
matches all molecules whose visibilityFlag is set to false.
Why It Matters
When working with biomolecular assemblies or simulations involving thousands of atoms, you often want to isolate only the relevant parts. For example, visualize only the solvent, or check if your chains are properly rendered. Instead of manually hiding all other molecules, NSL lets you precisely pick what to see or hide based on well-defined criteria.
Even better, these expressions can be used in work automation scripts or selections, allowing you to:
- Filter visible and hidden molecules programmatically
- Prepare cleaner scenes for exporting images or videos
- Avoid visually overwhelming representations
- Inspect specific properties without interference from other structures
Example Use Case
Let’s say you’re analyzing a large molecular complex and only want to focus on chains that have more than 100 residues and are currently visible. You could write:
|
1 |
mol.nr > 100 and mol.v |
This simple expression gives you instant access to the molecules that matter, cutting through visual noise and improving focus.
Conclusion
The visibility attribute tools available in SAMSON’s NSL system allow modelers to save time and streamline their workflow. If you’re regularly navigating complex scenes, learning how to use mol.v, mol.h, and mol.vf will help you work more efficiently.
Learn more by visiting the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/molecule/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download and explore SAMSON at https://www.samson-connect.net.
