Molecular modelers frequently adjust and organize structural models, and labeling plays an essential role in this process. Whether you’re identifying specific nodes or customizing visibility in complex systems, knowing how to effectively use label attributes in SAMSON’s Node Specification Language (NSL) can save significant time and avoid frustration.
This blog post provides a practical guide to understanding the key label attributes in NSL’s attribute space (label or its short name la), focusing on their functionality and examples of usage. This will empower you to streamline your molecular modeling workflows, fine-tune your selections, and enhance structural annotations.
What Are Label Attributes?
Label attributes in NSL are part of the label attribute space, which applies only to label nodes. These attributes can control visibility, indicate selection states, or add descriptive names. Importantly, they inherit properties from the broader node attribute space, making them powerful and versatile in customizing molecular models.
Key Label Attributes and Their Applications
| Attribute Name | Description | Possible Values | Usage Example |
|---|---|---|---|
hidden (h) |
Defines whether a label is hidden. | true, false |
la.h, not la.h |
name (n) |
Specifies the label's name. | String values in double quotes | la.n "Label1", la.n "L*" |
selected |
Indicates whether the label is selected. Note: This attribute does not have a short name. | true, false |
la.selected, not la.selected |
selectionFlag (sf) |
Determines selection flags for the label. | true, false |
la.sf false, la.sf |
visibilityFlag (vf) |
Manages visibility flags that control label rendering. | true, false |
la.vf false, la.vf |
visible (v) |
Indicates whether the label is visible. | true, false |
la.v, not la.v |
Practical Examples in Context
Imagine working on a complex molecular model where you need to isolate and emphasize specific label nodes:
- To check visibility, use
la.v. If you need to turn off visibility for all labels, applyla.vf false. - To focus on labels with specific names, you can query by name using a wildcard:
la.n "L*". This example selects all labels starting with “L.” - For debugging or filtering out invisible labels, combine queries with negation, e.g.,
not la.h, ensuring you only work with visible labels.
Conclusion
The label attributes in SAMSON’s NSL offer a low-barrier way to control and customize molecular labeling effectively, from hiding redundant labels to focusing on targeted annotations in your model. By mastering label attributes, you optimize how you interact with complex molecular systems in SAMSON.
For a deeper dive, check out the full documentation here: https://documentation.samson-connect.net/users/latest/nsl/label/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
