For molecular modelers using SAMSON, the Node Specification Language (NSL) is an indispensable tool for querying and customizing molecular structures. However, understanding how to leverage the note attributes in NSL to organize and manipulate structures effectively can be a challenge. This blog post will guide you through the basics of note attributes, helping you save time and work more efficiently.
What Are Note Attributes?
Note attributes in SAMSON’s NSL are defined in the note attribute space, which has the short name nt. These attributes are specifically designed to match note nodes in your molecular models, allowing you to apply filters and manipulations to annotations or metadata attached to specific nodes. If you’ve struggled with keeping track of structural annotations while designing complex molecules, understanding note attributes can be a game-changer.
Some commonly used note attributes include:
- Hidden (
nt.h): Use this attribute to filter nodes that are hidden (true) or visible (false). - Name (
nt.n): Search for note nodes by their names using string queries (e.g.,nt.n "A"ornt.n "L*"for pattern matching). - Visibility Flag (
nt.vf): Check whether the visibility flag is enabled (true) or disabled (false). - Selection Flag (
nt.sf): Determine whether a node is part of a selection (true) or not (false). - Selected (
nt.selected): Identify whether a note node is currently selected in the model withtrueorfalse. - Visible (
nt.v): Filter nodes that are currently visible (true) or not (false).
Why Note Attributes Matter for Molecular Modeling
Let’s consider an example: Imagine working on a large biomolecular structure with dozens of notes marking specific annotations like binding sites, functional regions, or structural irregularities. The ability to filter and query these notes, such as “Find all visible annotations starting with ‘L’”, can save hours of manual effort. With note attributes in NSL, you can use expressions like nt.v and nt.n "L*" to achieve this in a single step.
Similarly, if you’re debugging a molecular script or reviewing metadata, displaying only the hidden or selected notes can declutter your workspace. The combinations are flexible to your needs, enabling precise control over annotations and interactions with nodes.
How to Get Started
The table below provides a quick reference for using note attributes effectively:
| Attribute Name | Short Name | Possible Values | Examples |
|---|---|---|---|
| hidden | h | true, false |
nt.h, not nt.h |
| name | n | Strings in quotes | nt.n "A", nt.n "L*" |
| selected | — | true, false |
nt.selected, not nt.selected |
| selectionFlag | sf | true, false |
nt.sf, nt.sf false |
| visibilityFlag | vf | true, false |
nt.vf, nt.vf false |
| visible | v | true, false |
nt.v, not nt.v |
For more information about specific attributes or to explore additional options, visit the original documentation below. SAMSON’s NSL provides a robust and flexible way to interact with molecular models, tailored to your precise needs.
Learn more about note attributes in SAMSON here: https://documentation.samson-connect.net/users/latest/nsl/note/.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
