When working with complex biomolecular systems, it’s common to navigate and manipulate multiple chains alongside other structural groups. Whether you’re preparing publication-quality visuals, analyzing specific interactions, or just trying to declutter your scene, being able to selectively show or hide chains is crucial. In this post, we’ll explore a powerful subset of the Node Specification Language (NSL) in SAMSON that helps you filter and manage chain visibility using intuitive attributes.
Why visibility control matters
Imagine you’re modeling a protein-ligand complex that contains multiple chains, including enzyme subunits, DNA strands, and solvent molecules. Visualizing all at once may obscure the layout or key interactions. You might want to:
- Hide chains that are not directly interacting with the ligand
- Quickly display only selected chains for a clear screenshot
- Check which chains are currently hidden or visible using filters
With NSL, you can do this instantly using the chain attribute space and a few visibility-related attributes:
Relevant visibility attributes
All of the following can be used in NSL within the chain attribute space (c):
visible(shortcut:v): whether the chain is currently shown in the viewport.hidden(shortcut:h): whether the chain is hidden in SAMSON.visibilityFlag(shortcut:vf): a visibility flag that helps identify chains set as visible through specific conditions.
Usage examples
You can use these simple expressions in SAMSON’s selection field or scripting to filter and act on chains:
c.v: selects all currently visible chains.not c.v: selects all hidden chains.c.h: selects hidden chains (using thehiddenattribute).c.vf: selects chains whose visibility flag is set (useful in custom workflows).
Let’s say you want to hide all chains except chain A. You can first select the chains with not c.n "A" and then hide them. Alternatively, to show only chains whose name starts with L, you can use c.n "L*" followed by a show command.
Combining conditions
Attributes can also be combined with logical operators. For example:
c.v and not c.selected: finds all visible but unselected chainsnot c.v or c.sf false: targets chains either not visible or without selection flag set
Integrating in your workflow
These visibility controls provide more than just display options—they unlock a cleaner, focus-driven modeling environment. Filter relevant portions, generate cleaner visual outputs, and improve navigation across large molecular systems.
Whether you’re preparing animations, refining structural hypotheses, or collaborating across teams, mastering such NSL filters allows better focus and faster iterations.
To explore all chain-based attributes, including visibility, name, material ownership, and atomic composition, visit the full SAMSON NSL chain attribute documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
