When working on large and complex molecular systems, it’s easy to get overwhelmed by the sheer number of components displayed in the viewport. You might find yourself hunting for just the visible backbones of a protein, or trying to select subsets based on their visibility or display states. This is a common struggle for molecular modelers, especially during presentations or focused analyses.
Fortunately, SAMSON offers a flexible and precise way to handle this using the Node Specification Language (NSL), and in particular, the visible and visibilityFlag attributes within the backbone attribute space.
Understanding Visibility in SAMSON
In SAMSON, every node (including molecular backbones) has a visible attribute and a visibilityFlag. These provide two complementary but distinct ways to define whether a node is currently displayed:
bb.v(short name forvisible): Indicates whether the backbone is currently visible in the viewport.bb.vf(short name forvisibilityFlag): A user-defined flag that describes whether the backbone should be visible, even if other scene conditions might override it.
This distinction helps users control visibility at different levels—for example, globally hiding whole chains for clarity, while leaving their visibility flag intact.
Quick Examples and Filters
You can use NSL expressions in SAMSON’s search and selection dialogs to isolate specific parts of your model:
Select visible backbones only:
|
1 |
bb.v |
Hide all currently visible backbones:
|
1 |
not bb.v |
Filter by visibility flag (e.g., show only flagged structures you intended to visualize):
|
1 |
bb.vf |
Backbones that should be visible, but may have been hidden by global filters:
|
1 |
bb.vf and not bb.v |
Why This Matters
This fine-grained control becomes essential when dealing with large protein complexes, ligand libraries, or any structurally dense dataset. For example, during trajectory analysis, you might want to track only those backbone groups whose visibility has been toggled interactively, or compare the set of flagged visible regions before and after running a visualization macro.
Additionally, understanding the dual visibility model (actual visibility vs. visibility flag) gives you better programmatic control when building animations or automating selections via scripting interfaces in SAMSON.
Other Backbone Attributes You Can Combine
Visibility attributes can be combined with others in powerful ways. For instance:
- Visible backbones with more than 10 carbon atoms:
bb.v and bb.nC > 10 - Hidden backbones with a negative partial charge:
not bb.v and bb.pc < 0
This flexibility enables a range of use cases, from filtering structures to building custom visualization pipelines.
To explore the full list of backbone attributes available in NSL—including those inherited from both the node and structuralGroup attribute spaces—visit the official documentation page below.
Read more in the NSL Backbone attribute documentation
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
