When working with complex molecular models, clarity is crucial. A common challenge for molecular modelers is managing large structures with multiple overlapping visual elements—different representations, annotations, surfaces, and more. When too many elements are shown at once, the result can be a cluttered visualization that obscures insights rather than revealing them.
This is where the visibility controls in SAMSON’s Node Specification Language (NSL) come in. Specifically, the presentation attribute space (short name: pr) provides a set of attributes that help you manage how your molecular data is displayed—without modifying the structural data itself.
Why visibility management matters
In a typical molecular design session, users often work with multiple presentation nodes: visual representations like ribbons, surfaces, or electron densities. Each of these can be turned on or off to match the current focus of analysis. For example, you may want to hide a ribbon to better observe a ligand surface, or enable only the electron density map while evaluating fitting.
However, when multiple presentation layers overlap, simply hiding them manually for every session becomes tedious and error-prone. NSL offers a powerful way to selectively target and control these elements.
Three ways to control visibility
Within the pr (presentation) space, SAMSON offers multiple attributes for managing visibility:
pr.v(visible): Indicates whether a presentation node is actually drawn. It can betrueorfalse. For example,not pr.vmatches all presentation nodes that are currently hidden.pr.vf(visibilityFlag): A user-defined flag for visibility. Unlikepr.v, which is automatically computed,pr.vfallows manual scripting control. For instance,pr.vf falsematches nodes with a disabled visibility flag.pr.h(hidden): A general flag inherited from the base node class. Likepr.v, this is useful for grouping nodes according to whether they are visible or not.
Together, these attributes give you both automatic and manual ways to control what is shown and what is not, with precise queries that can be used in scripts or as selection filters.
Example use cases
Imagine you import a molecular model with several presentations, but you only want to retain surfaces and discard all others. A quick search filter like pr.n "*Surface*" and pr.v allows you to select and inspect only the visible surfaces.
Or suppose you’ve scripted the visibility properties of various presentations using pr.vf. You could find all of them in a known visibility state using pr.vf true.
Tips for smoother workflows
- Use
pr.vfor quick, current visibility checks. - Use
pr.vfif you plan to toggle visibility programmatically over several steps. - Create selections with
not pr.vto isolate hidden representations and clean them up if needed.
By integrating visibility filters into your workflow, you can declutter your scenes, accelerate analysis, and save time—but most importantly, focus better on the chemistry that matters.
To learn more about the presentation attributes in SAMSON, including visibility controls, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
