A cleaner way to select node groups in your molecular models

Managing large molecular models can quickly get overwhelming, especially when you’re working with complex assemblies made of thousands of parts. One common challenge that molecular modelers face is selecting and organizing groups of nodes — whether those are domains in a protein, specific regions of interest, or logical components that should be addressed together.

In SAMSON’s Node Specification Language (NSL), node groups offer an efficient way to organize your models. But did you know that you can also directly query and manipulate node group attributes using a dedicated attribute space called nodeGroup or simply ng?

What is the ng Attribute Space?

The ng attribute space targets node group nodes specifically. This allows you to query or filter these nodes with clarity, without accidentally grabbing unrelated ones.

Here’s a quick overview of three useful attributes you can use with node groups:

Attribute Short Name Value Type Example Usage
name n string ng.n "ActiveSite"
ng.n "L*"
selected true / false ng.selected
not ng.selected
selectionFlag sf true / false ng.sf false
ng.sf

Practical Uses

Let’s say you’re working with a protein model where you’ve grouped all ligand-binding sites into node groups. If you want to focus only on the ones that are currently selected, try this filter:

Or, if you’ve created specific naming conventions for groups (e.g. “L1”, “L2”, …), and want to find all that match the pattern “L*”, use:

This is especially helpful if you’re planning simulations, generating visuals, or running batch operations on regions of interest in your model. Not only does this reduce manual selection, but it increases repeatability in your workflows.

What’s the Difference Between selected and selectionFlag?

This might be confusing at first, but they serve different purposes. The selected attribute tells whether a node group is currently selected in the UI, while selectionFlag represents whether the selection flag is set internally. This distinction matters when scripting or generating automated selections.

For example, you might want to ensure some groups are unflagged before a new analysis step:

Cleaner Commands, Better Modeling

Using the ng attribute space improves readability and precision. Instead of writing general expressions, you can target exactly what matters within the structure of your model. Try grouping parts of your system logically, name them consistently, and then use ng.n, ng.selected, and ng.sf to simplify your work.

To learn more and see the full documentation page, visit the Node group attributes documentation.

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

Comments are closed.