One of the most common frustrations in molecular modeling is visual clutter. As molecular systems grow in complexity, the accumulation of labels—whether for atoms, residues, or custom annotations—can quickly become overwhelming. This doesn’t just make visualization harder, it can also obscure key findings and slow down your workflow.
Fortunately, SAMSON’s Node Specification Language (NSL) provides a concise way to manage this issue. If you’re using SAMSON, you can control the visibility of label nodes precisely with the label attribute space (short name: la), which gives you access to label-specific attributes.
Why label visibility matters
Whether you’re preparing a high-quality figure for publication, constructing a protein-ligand interaction map, or refining a complex assembly, keeping only what’s necessary in view helps focus better on meaningful structure and behavior. NSL lets you define visibility rules programmatically, ensuring consistent, reproducible visual setups—even across large systems.
Working with label visibility directly
To target only label nodes, NSL uses the la (label attribute) prefix. Within this space, you have direct access to visibility-related attributes inherited from the general node attribute space.
la.v: visible
Use this to test whether a label is visible:
la.v– matches label nodes that are currently visiblenot la.v– matches label nodes that are hidden
la.vf: visibilityFlag
This flag defines whether the visibility of a label is explicitly controlled. For instance:
la.vf false– matches labels whose visibility is not explicitly setla.vf– returns all labels with a visibility flag set to true
This is especially useful if you’re scripting or automating model view states, as it allows more granular control than visible alone.
Combining attributes
You can combine attributes for more powerful queries. For instance:
|
1 |
la.vf true and not la.v |
This selects labels that are under visibility control—yet currently not visible. These combinations give you quiet but powerful control over how models are rendered.
Use case: hiding custom annotations
Let’s say you’ve added several labels for working purposes (e.g., identifying catalytic sites), but now want to hide them all before sharing the model. You could simply execute:
|
1 |
la.n "*" and la.v |
to find all visible label nodes, then hide them in bulk based on the result. If you named your labels systematically (e.g., with a prefix), use wildcards like:
|
1 |
la.n "anno_*" and la.v |
This helps maintain clarity without permanently deleting helpful annotations.
Learn more
These are just a few examples of how to manage label visibility to streamline your modeling experience. For a full list of label attributes and additional querying techniques, visit the official SAMSON documentation page on label attributes.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
