Easily Filter and Organize Molecular Models with Node Group Attributes in SAMSON

As molecular models grow in complexity, efficiently managing and analyzing components becomes a challenge. One common pain for molecular modelers is filtering and operating on specific groups without manually selecting them repeatedly. If this sounds familiar, SAMSON’s Node Specification Language (NSL) offers a solution that might make your daily workflow easier.

More specifically, the node group attributes in NSL allow for streamlined querying and manipulation of entire node groups within your molecular model. This can be especially useful when you want to apply operations to selected sub-assemblies, ligand groups, or any other logical grouping of nodes.

What Are Node Group Attributes?

In SAMSON, nodes are the fundamental building blocks of a molecular model — atoms, bonds, groups, etc. A node group is a set of nodes you logically organize together. The nodeGroup attribute space (short name: ng) specifically targets these groups, and you can use it to filter, label, or manipulate them efficiently.

Common Use Cases

  • Filter only selected node groups: You can quickly find all currently selected groups and manipulate or analyze only those.
  • Use names as filters: Assign meaningful names to your node groups—like “Ligands”, “DomainA”—and filter via patterns, e.g., ng.n "Lig*".
  • Toggle visibility or color nodes only in specific groups: Comes in handy during presentations or when preparing publication-ready figures.

Key Attributes at a Glance

Attribute Short Name Usage Example
name n Filter groups by name ng.n "A" or ng.n "L*"
selected (none) Check if a group is selected ng.selected or not ng.selected
selectionFlag sf Checks internal selection status ng.sf or ng.sf false

Why Use These Attributes?

Molecular modelers using SAMSON often face situations where they want to either:

  • Target particular regions for analysis
  • Export only a subset of the model
  • Apply visual effects or measurements selectively

Without NSL and node group attributes, these tasks would require repetitive GUI interaction. Instead, a short NSL query like ng.selected does the job instantly, which not only saves time but also reduces errors.

Inherited Simplicity

A nice feature of node group attributes is that some attributes are inherited from the more general node space. That means if you’re already familiar with filtering individual nodes, you can carry over your knowledge to entire groups. For example, name and selectionFlag work the same way—they just apply to groups instead of single nodes.

This structure encourages consistency and simplifies learning, even if you’re only working with small parts of a large model.

Conclusion

If you often need to organize and interact with complex molecular models, take a few minutes to explore node group attributes in NSL. They’ll likely save you significant time and help you keep large models manageable.

Read the full documentation on node group attributes to learn more.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.

Comments are closed.