For molecular modelers using SAMSON, managing and visualizing information efficiently is one of the most critical aspects of the workflow. Labels, whether applied to specific atoms, residues, or other structural aspects, serve as key markers to annotate and interact with models. But understanding how to control their behavior, visibility, and selection within the integrative SAMSON platform’s Node Specification Language (NSL) can be a major pain point. If you’ve ever wondered how to manipulate label attributes effectively, this guide breaks it down for you.
What Are Label Attributes in NSL?
Label attributes are specifically defined within the label attribute space (short name la) in SAMSON’s NSL. Unlike common node attributes, these are designed to interact exclusively with label nodes. They allow you to specify metadata and appearance properties for labels in SAMSON.
Some of the main attributes include:
- Visibility: Control whether a label is hidden or visible.
- Selection Status: Determine whether a label has been selected or marked through selection flags.
- Name Identification: Search and identify labels via string-based names.
Why Are Label Attributes Useful?
Imagine working on a large and complex molecular system. Labels may clutter your workspace, making visualization challenging. Alternatively, you may want to isolate just the parts of the system that are labeled for certain analyses or presentations. By mastering label-specific attributes, you can refine your workflow and minimize distractions.
A Closer Look at Key Label Attributes
Below are some primary label attributes that you can use in NSL, along with examples to help you understand their syntax and function:
| Attribute | Description | Example Usage |
|---|---|---|
| hidden | Shows whether a label is hidden (true) or visible (false). |
la.hnot la.h |
| name | Identifies labels by their names, specified as strings in quotes. | la.n "A"la.n "L*" |
| selected | Indicates if a label is selected (true) or not (false). |
la.selectednot la.selected |
| selectionFlag | Specifies whether a label’s selection flag is active. | la.sfla.sf false |
| visibilityFlag | Shows the state of the visibility flag for a label. | la.vfla.vf false |
| visible | Indicates whether a label is currently visible (true). |
la.vnot la.v |
Putting It All Together
Suppose you want to identify all visible labels with names starting with the letter “L”. In NSL, you can achieve this effortlessly with:
|
1 |
la.v && la.n "L*" |
Or perhaps you want to hide all currently visible labels:
|
1 |
not la.h |
The combination of these attribute expressions allows you to automate workflows, isolate relevant annotations, and declutter your visualization projects.
For a complete explanation of all label attributes and additional examples, check the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
