Making Sense of Node Group Selection in SAMSON

In complex molecular models, clarity and control are essential. When working with numerous nodes in a model — atoms, molecules, fragments, and related groups — being able to efficiently select and manipulate specific elements can be a real time-saver. This is especially true when dealing with node groups, which represent structured collections of nodes in SAMSON, the integrative platform for molecular design.

If you’ve ever struggled to filter out just the parts of a model you need — for example, selecting only certain fragments or disabling everything except a specific group — you might not be using the full power of the nodeGroup attribute space in the Node Specification Language (NSL).

Understanding the nodeGroup attribute space

To interact specifically with node groups in SAMSON, you can use the nodeGroup attribute space — short name: ng. This space is tailored for querying node groups and provides seamless access to a handful of useful attributes. Some of these attributes are inherited from the general node space, but with nuances specifically adapted for node groups.

Key attributes for node group query

Here are some useful attributes you can use within ng:

  • ng.n: Use this to select a node group by name. You can use wildcards as well.
  • ng.selected: Check whether a node group is selected. Since this attribute isn’t shortened (unlike in the general node space), this provides clearer syntax in group-specific queries.
  • ng.sf (Selection Flag): This attribute helps you identify nodes that are flagged for selection without necessarily being selected.

Using combinations of these attributes, you can express very precise selection logic. For instance, you can select all node groups with names starting with “L” that are currently selected:

Or filter out everything except unselected groups not marked for selection:

When does this become useful?

Node group queries become particularly helpful when doing operations en masse. Whether you’re hiding sections of your structure, applying simulations selectively, managing layers in a large macromolecular complex, or preparing materials for rendering, being able to clearly reference and filter node groups by name and state makes your workflow much smoother.

Rather than click through dozens of elements in the Document View, try using NSL expressions instead. They’re faster, more reproducible, and can even be saved and reused as needed. If you’re already using NSL to interact with atoms and bonds, make sure you’re not overlooking node groups—especially since many biologically meaningful components (like chains, ligands, and domains) are treated as groups.

For full details on node group attributes, including inheritance from general nodes, visit the NSL documentation page:

https://documentation.samson-connect.net/users/latest/nsl/nodeGroup/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.