Mastering Node Group Attributes in SAMSON’s NSL

Molecular modeling often involves working with complex structures and datasets. As a modeler, efficiently specifying and interacting with groups of nodes—a universal concept in molecular design—can be challenging. Fortunately, SAMSON’s integrative platform addresses this with its Node Specification Language (NSL). In this post, we’ll delve into the node group attributes, a vital aspect of NSL designed specifically for handling groups of nodes.

What Are Node Group Attributes?

Node group attributes are part of the nodeGroup attribute space, commonly shortened as ng in the Node Specification Language. These attributes specifically match node group nodes, making it easier to query and manipulate node groups in a clear and structured way. Whether you’re working on group filtering or querying group properties, understanding these attributes is essential.

Inherited Attributes

The node group attribute space builds on inherited attributes from the broader node attribute space, but fine-tuned for node groups. Let's explore three key attributes:

  • name (short name: n): The attribute that allows you to identify node groups by their names.
  • selected: Indicates whether a group of nodes is selected (true or false). This attribute does not have a short form.
  • selectionFlag (short name: sf): A complementary attribute to selected, often used for more nuanced expressions.

How to Work with These Attributes

Understanding the syntax and examples is critical to leveraging node group attributes effectively. Here are some examples of different attributes in use:

1. Naming Node Groups

With the name attribute, you can retrieve or filter groups by their names. Example expressions include:

These queries will match node groups with names such as “A” or those starting with “L,” respectively.

2. Selection State

The selected attribute checks whether a node group is currently active in the selection, using expressions like:

This allows for quick toggling or validation of selection states.

3. Using the Selection Flag

The selectionFlag attribute provides another way to handle selection logic, particularly for scripting workflows. Examples:

With this attribute, you can include or exclude specific groups in automated pipelines depending on their flagged selection state.

Why Are These Attributes Important?

Node group attributes help molecular modelers by streamlining complex queries. For example, instead of manually verifying or classifying groups in large, multi-hierarchical datasets, attributes like name, selected, and selectionFlag allow you to programmatically apply changes or extract specific subsets of data. This not only saves time but also ensures consistency across workflows.

Learn More

These are just the foundational concepts of node group attributes in SAMSON. To dive deeper into all the available functionalities and examples, visit the full documentation page at https://documentation.samson-connect.net/users/latest/nsl/nodeGroup/.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at https://www.samson-connect.net.

Comments are closed.