Understanding Label Attributes in SAMSON’s NSL

For molecular modelers and computational scientists, handling complex molecular data often requires effective labeling and filtering mechanisms. Label attributes in SAMSON’s Node Specification Language (NSL) are an important tool to streamline your workflow. If you’re working with molecular models and frequently need to sort, hide, or manipulate labels, understanding these attributes can improve your efficiency.

The Basics of Label Attributes

In SAMSON, labels are supported through the label attribute space, which has the short name la. This space is tailored specifically for label nodes and inherits attributes from the general node attribute space. These attributes allow you to manage the visibility, selection, naming, and other filtering options of labels within your molecular workspace.

Key Attributes and Their Uses

Here’s an overview of the key label attributes defined in NSL:

  • hidden (h): This defines whether the label is hidden. Possible values are true and false. For example, you could use la.h to find labels that are hidden, or not la.h to find labels that are visible.
  • name (n): This allows setting or querying the name of the label. The value is a string inside quotes. For example, la.n "A" identifies a label named “A”, while la.n "L*" identifies labels with names starting with ‘L’.
  • selected: Indicates whether the label is selected, with possible values being true or false. For example, la.selected returns selected labels, and not la.selected filters unselected ones.
  • selectionFlag (sf): Serves a similar purpose to selected, enabling filtering or categorizing. You could write la.sf false to identify labels without this flag.
  • visibilityFlag (vf): Specifies visibility attributes, with possible values true or false. Use cases include la.vf false to find labels marked as invisible.
  • visible (v): Another visibility attribute, which can be toggled using la.v or reversed using not la.v.

Examples of Practical Use

Let’s look at some practical examples of how these attributes might be used:

  • Filter all visible labels: la.v
  • Find specific labels by name pattern: la.n "Protein*"
  • Query hidden labels: la.h
  • Locate labels marked for custom visibility settings: la.vf true

Such expressions can be combined with the powerful querying system of NSL to filter and manipulate large datasets efficiently.

Conclusion

Mastering label attributes in SAMSON’s Node Specification Language opens up advanced ways to filter, display, and manage molecular data efficiently. Whether you’re analyzing structures, visualizing important nodes, or setting up workflows for large systems, these tools are essential for customization and clarity.

To explore the label attribute space further, visit the official documentation page at Label Attributes Documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at SAMSON Connect.

Comments are closed.