For molecular modelers working with SAMSON, efficient organization and management of nodes are vital for productive workflows. A key feature provided by SAMSON’s Node Specification Language (NSL) is the ability to fine-tune the behavior and appearance of labels through label attributes. This blog post will walk you through how to leverage these capabilities effectively to streamline your projects.
What Are Label Attributes, and Why Do They Matter?
Label attributes in SAMSON are part of the label attribute space (short name: la). These attributes allow users to manipulate and query label nodes in a powerful and concise way. For molecular modelers, this means better control over visibility, selection states, and properties of labels in your models. This is especially helpful for navigating and analyzing complex systems.
Core Label Attributes
The attribute space of labels comes with a set of properties inherited from the general node attribute space. Here is a summary of the most commonly used attributes and how they can be applied to enhance your modeling efforts:
| Attribute Name | Short Name | Description |
|---|---|---|
hidden (h) |
true, false |
Defines whether a label node is hidden. Example: la.h or not la.h. |
name (n) |
String | Specifies the name of a label node. Supports quoted strings. Example: la.n "A". |
| selected | No short name | Indicates whether a label is selected. Example: la.selected or not la.selected. |
selectionFlag (sf) |
true, false |
Used to specify the selection flag of a label. Example: la.sf false. |
visibilityFlag (vf) |
true, false |
Determines whether the visibility flags of a label are enabled. Example: la.vf false. |
visible (v) |
true, false |
Sets whether the label node is visible. Example: la.v or not la.v. |
Why You Should Use Label Attributes
Here are some practical scenarios for leveraging label attributes:
- Enhancing Focus: Use
hiddenorvisibleattributes to quickly show or hide specific label nodes that are not immediately relevant to your analysis. - Advanced Queries: Combine attributes like
nameandselectionFlagto identify and manipulate specific label nodes based on naming conventions or selection states. - Streamlining Workflows: Automate processes by setting selection or visibility flags for multiple labels programmatically, ensuring consistency and reducing manual adjustments.
Application Example
Suppose you are working on a molecular system with dozens of annotations and would like to isolate the labels starting with “A” and make them visible:
|
1 |
la.n "A*" and la.v |
This simple expression isolates all label nodes whose names start with “A” and ensures they are visible. Such streamlined expressions are invaluable in managing complex molecular designs.
Learn More
The details provided here give you a head start on mastering label attributes in SAMSON. For more information and further examples, visit the complete documentation on Label attributes.
SAMSON and all SAMSON Extensions are free for non-commercial use. To start using SAMSON, download it here: https://www.samson-connect.net.
