Find the right node groups without confusing names and selection state

When a molecular scene contains many groups, a small filtering mistake can make the wrong objects appear in your results—or leave you wondering why the group you expected is missing. SAMSON’s Node Specification Language (NSL) lets you target node groups with the nodeGroup attribute space, abbreviated ng. Knowing which attributes belong to that space, and how their short names differ, makes queries easier to read and check.

Start by targeting node groups

The prefix ng tells an expression to use the node-group attribute space. This space matches node group nodes, so it is the useful starting point when the objects you want to find are groups rather than arbitrary nodes. For example, ng.n "A" uses the short name n for the inherited name attribute and supplies the string "A" as its value.

If you are scanning for a group whose name follows a pattern, the reference also gives ng.n "L*" as an example. The quotes matter: the documented value format for name is strings in quotes. Use the pattern that fits your naming scheme, and check the actual group names if a query does not return what you expect.

Keep the two selection attributes distinct

Node groups inherit both selected and selectionFlag from the general node attribute space. They are separate attributes with different spellings and different shorthand rules:

  • selected has no short name in the node-group attribute space. The documented forms are ng.selected and not ng.selected.
  • selectionFlag has the short name sf. The documented examples are ng.sf and ng.sf false.

This distinction is useful when checking a query: ng.s is not the documented shorthand for a node group’s selected attribute. If you mean the selected state, spell out ng.selected. If you mean the selection flag, use ng.sf. Similar-looking names are easy to mix up when writing a filter quickly, so reading the attribute name in full is a simple way to catch errors.

A practical query check

When a node-group filter does not behave as intended, work through these checks before changing the expression:

  1. Confirm the target type. Is the object you want actually a node group? The ng attribute space is specified for node group nodes.
  2. Check the prefix. Begin the attribute with ng. so the expression refers to the node-group attribute space.
  3. Check the attribute name. Use n or name for names, selected for selected state, and sf or selectionFlag for the selection flag.
  4. Check the value format. Names are strings in quotes. The selection examples use the boolean values true and false.
  5. Try the documented forms directly. For example, compare ng.selected with not ng.selected, or ng.sf with ng.sf false, depending on which attribute you intend to inspect.

These checks help separate three common sources of confusion: targeting the wrong kind of node, using the wrong attribute spelling, and supplying a value in the wrong form. They also make query expressions easier for teammates to review: an explicit ng.selected communicates its intent more clearly than an assumed abbreviation.

The node-group reference lists the inherited attributes and their examples. For the details of the underlying node attributes, consult the node attribute reference; for more NSL context, see the Node Specification Language overview.

Learn more in the node group attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.