When a molecular project contains many organized node groups, a small targeting mistake can make a selection hard to understand: did you match the group by its name, its selected state, or its selection flag? These are separate checks in SAMSON’s Node Specification Language (NSL). Knowing which one you need makes group queries easier to read and review.
The node-group attribute space is nodeGroup, abbreviated ng. It matches only node group nodes. That gives you a useful starting point: if the thing you want to find is a node group, write the query in the ng attribute space rather than relying on a general node query.
Find a group by name
Use the name attribute when the group’s identity is what matters. Its short name is n, and values are written in quotes. For example, ng.n "A" refers to a group named “A”. The reference also gives ng.n "L*" as an example expression. Quoting the value keeps the name clearly separated from the NSL syntax around it.
This is useful when a project has several groups with different roles. A name-based expression makes the intent visible: the query is about which group it is, not whether someone currently selected it. That distinction matters when you revisit a project or share a query with a collaborator.
Check selection without confusing it with identity
The selected attribute checks selection state. The examples are ng.selected and not ng.selected. In other words, the same attribute can be used to express either a positive or negative selection check.
There is one detail that can trip up people familiar with node attributes: although selected is inherited from the node attribute space, it does not have the short name s in the node-group attribute space. For node groups, use the full form ng.selected rather than assuming a familiar abbreviation applies.
Check the selection flag separately
selectionFlag is another inherited attribute, with the short name sf. The reference shows ng.sf and ng.sf false. These examples let you check the flag as a boolean condition or explicitly ask for its false value.
It is worth keeping selected and selectionFlag distinct when reading or writing expressions. The documentation lists them as separate attributes, with different names and examples. If a query is meant to test the selection flag, write ng.sf; if it is meant to test selection, write ng.selected. Choosing the precise attribute makes the query’s purpose easier to communicate and reduces ambiguity during troubleshooting.
A quick review before using a query
- Targeting a group by identity? Use
ng.nwith a quoted name. - Checking whether a group is selected? Use
ng.selectedornot ng.selected. - Checking its selection flag? Use
ng.sfor specifyfalse. - Unsure whether an abbreviation is valid? The node-group reference lists
nfornameandsfforselectionFlag, but no short name forselected.
These small distinctions are especially helpful when queries become part of a repeatable workflow: a clear expression is easier to inspect, explain, and correct than one that relies on an assumed abbreviation or an unclear selection criterion.
For the full list of node-group attributes and their examples, see the SAMSON node-group attribute reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
