For molecular modelers working with complex systems, efficiently querying or filtering groups of nodes within molecular structures can save valuable time. SAMSON’s Node Specification Language (NSL) simplifies this task with its nodeGroup attribute space, specifically designed for interacting with node groups within your models.
The nodeGroup attribute space (shortened to ng) provides several attributes you can leverage. Here’s a breakdown of these attributes, how they work, and where they might be useful in your molecular design projects.
Attributes in the Node Group Space
The nodeGroup attribute space allows the specification of attributes and filtering logic that applies only to node groups. Let’s look at the summary of key attributes within this space:
| Attribute Name | Short Name | Possible Values | Examples |
|---|---|---|---|
| name | n |
strings in quotes |
ng.n "A"ng.n "L*"
|
| selected | true, false |
ng.selectednot ng.selected
|
|
| selectionFlag | sf |
true, false |
ng.sf falseng.sf
|
Diving Deeper into Attributes
- Name Attribute: Inherited from the general
nodeattribute space. Use this to filter node groups by name. For example,ng.n "A"matches a node group named “A”. - Selected Attribute: This helps check whether a node group is currently selected. Unlike the general
nodespace, there’s no short name (s) for this attribute undernodeGroup. Example usage:ng.selected. - SelectionFlag Attribute: Particularly useful for detecting or setting selection flags on node groups. Example usage includes
ng.sforng.sf false.
Why This Matters
By combining these attributes, one can execute complex queries like selecting all node groups with a specific name or filtering out node groups based on flags or selection status. This brings composability and precision to molecular modeling workflows in SAMSON.
For instance, imagine working with a vast molecular system containing hundreds of node groups. Instead of manually sorting through them, you can target specific groups using commands like ng.n "L*" to match groups whose names start with “L” or not ng.selected to filter out unselected groups instantly.
Learn More
If you want to explore the nodeGroup space in-depth and see additional examples, visit the official documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
