In large biomolecular systems, navigating and interacting with specific parts of a molecule—such as chains, domains, or residues—can be difficult. SAMSON’s Node Specification Language (NSL) offers a powerful solution by letting users write queries that target these components precisely. One particularly helpful capability lies in the use of node group attributes, which streamline the process of selecting and filtering groups of nodes in your scene.
In this article, we’ll look at how node group attributes provide an efficient way to work with molecular assemblies in SAMSON. Instead of browsing the node tree manually, you can use expressive queries to name, select, or filter molecular components directly using NSL.
What Are Node Group Attributes?
Node group attributes are special attributes in the nodeGroup attribute space (short name: ng) that apply specifically to node group nodes.
These attributes allow you to filter node groups by:
- Name – using
ng.n - Selection state – using
ng.selected - Selection flag – using
ng.sf
This can be especially useful for automating repetitive selections or when working with large structures that include many node groups.
Practical Examples
Let’s say you’re working with a multi-chain protein and you’ve organized different chains or domains as node groups. You can:
- Select a specific group by its name:
ng.n "Chain A" - Select groups whose name starts with a certain prefix:
ng.n "L*" - Select only the groups that are currently selected:
ng.selected - Exclude the selected groups:
not ng.selected - Target groups with a defined selection flag:
ng.sf true
Each of these selectors can be combined with logical operators to build more complex queries, enabling fine control over the elements you’re interested in.
Why This Matters
Imagine you’ve created several node groups representing different active sites or binding pockets in a protein. Instead of manually clicking each one when switching views, you can store and retrieve views using attribute-based queries. This makes your workflow reproducible and efficient.
Also, using wildcard names in queries (e.g., ng.n "L*") allows you to treat groups collectively without needing to remember exact names.
Additional Tips
- Short Names Save Time: Instead of writing
nodeGroup.name, just useng.n. - Attribute Inheritance: The attributes
name,selected, andselectionFlagare inherited from the generalnodeattribute space, with small differences (e.g.,ng.selecteddoes not have a short form).
Working with well-organized node groups and selection queries doesn’t just save time—it also helps ensure you can repeat your work or share your scenes without manual errors.
To learn more about node group attributes, visit the official SAMSON documentation page: https://documentation.samson-connect.net/users/latest/nsl/nodeGroup/
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
