Quickly Identify Selected Node Groups While Modeling Molecules

When working with large molecular systems, it’s common to organize atoms and molecules into node groups in SAMSON, the integrative platform for molecular modeling. These groups help you manage complex scenes—from protein-ligand interactions to nanoscale assemblies. But once the complexity increases, a common user pain becomes obvious: how do you efficiently filter and select only the node groups you’ve already selected for inspection or modification?

This is where understanding selected attributes in SAMSON’s Node Specification Language (NSL) becomes practical.

Why this matters

Imagine you’ve grouped several parts of a protein according to their role—binding site, catalytic residues, cofactors. During your analysis, you manually select relevant groups to apply transformations, visualize electron density overlaps, or change representation styles. But when scripting or filtering them in NSL for automation or reproducibility, how do you identify just those selected groups?

The ng.selected attribute handles this gracefully.

Filtering selected node groups

In NSL, you can specify criteria for node groups by referring to the nodeGroup attribute space (short name: ng). Specifically, the selected attribute lets you check or filter only those node groups you’ve manually or programmatically selected in SAMSON’s interface. Here’s the syntax:

This returns all selected node groups.

If you want all node groups not selected, use:

This allows for rapid creation of filters or scripts that act only on currently active areas of interest. Whether highlighting, isolating, modifying, or exporting data, knowing how to target just the selected groups significantly speeds up your workflow.

Common use case: Validation step

Before applying transformations or simulations, it’s often a good idea to validate the groups you’ve selected. A simple command like:

…helps ensure you’re working on the correct subset of your data.

Bonus: Combine with other attributes

Since NSL supports logical combinations, you could filter selected groups with matching names using wildcards:

This command targets all selected node groups whose names begin with “Binding”. Useful for running batch operations on sets with structured naming.

Visual feedback and confirmation

Don’t forget that visual confirmation is often just as useful. Combine NSL filtering with SAMSON’s style scripts or selection-based highlighting to see precisely which parts your filters are acting on.

To learn more, view the full documentation page for node group attributes at https://documentation.samson-connect.net/users/latest/nsl/nodeGroup/.

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

Comments are closed.