Avoiding Selection Frustration: A Quick Guide to Node Group Attributes in SAMSON

When working with complex molecular models, it’s common to group atoms, residues, or entire molecular structures for easier manipulation. But as models become larger, selecting and filtering node groups effectively becomes a challenge. If you’ve ever struggled to isolate just the right set of groups for your operation in SAMSON, you’re not alone.

This guide explores Node Group Attributes in SAMSON’s Node Specification Language (NSL), which provide a flexible way to query and manipulate node group objects in your model.

Why Node Group Attributes Matter

Node group attributes allow you to create logical expressions to filter and select specific node groups based on criteria such as their name or selection state. This is extremely useful when working with complex systems containing multiple molecular chains, assemblies, or regions of interest. Instead of clicking through a visual tree or hoping that your manual selection holds up, these expressions give you precision, reproducibility, and speed.

The Attribute Space: ng

All node group attributes reside in the nodeGroup attribute space, which has the short name ng. This means any expression targeting node groups will be prefixed with ng. For example, ng.n "A" refers to any node group whose name is exactly “A”.

The Three Key Attributes

Attribute Description Example
ng.n (name) Select node groups by their name (supports wildcards) ng.n "L*" — selects groups whose names start with “L”
ng.selected Evaluate to true if the group is currently selected ng.selected — selects currently selected node groups
ng.sf (selectionFlag) Selects based on selection flag, which can be set programmatically ng.sf false — selects unflagged node groups

Use Cases

  • Easily isolate sidechains and ligands: Use naming conventions (e.g., L* for ligands) to filter quickly.
  • Unselect all node groups: Use not ng.selected to filter and invert selection states.
  • Script clean-up routines: Combine attributes for precise control — e.g., selecting all ligand groups that are not yet processed by a simulation protocol.

The NSL makes these commands readable and writable for both beginners and advanced users. Even if you’re scripting programmatically or building automation in SAMSON, this attribute space prevents unnecessary complexity.

A Note on Wildcards

Wildcard support in attributes like ng.n allows you to query using expressions like "L*" — making bulk selections straightforward when you’re using standardized naming.

For more in-depth usage and additional supported attributes, you can always refer to the original section in the documentation:

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.