One common challenge in molecular modeling is isolating and selecting specific structures or substructures from large molecular systems. If you’ve ever found yourself lost in a sea of atoms while trying to select just the right molecular backbone that meets specific criteria (e.g., visible, named, charged, etc.), SAMSON’s Node Specification Language (NSL) helps make that easier.
In this post, we show how to use backbone attributes in SAMSON to precisely filter and select backbones based on meaningful attributes like visibility, material ownership, atom counts, charges, and more.
Working with Backbone Attributes
Backbone nodes in SAMSON have a set of associated attributes inherited from multiple attribute spaces, including node and structuralGroup. With the NSL syntax, it’s possible to write concise queries using these attributes to locate just what you need.
By default, backbone attributes are prefixed with bb.. Here are a few practical examples of queries you can compose:
bb.v— select backbones that are visiblebb.hm— filter backbones that have materialbb.fc > 1— find backbones with a formal charge greater than onebb.n "A*"— match backbones whose name starts with ‘A’bb.nO 5:10— select backbones with 5 to 10 oxygen atoms
These filters can be combined to make more advanced selections. For example, if you’re looking for a visible backbone that has more than 10 carbon atoms and a partial charge above 1.5, you could write:
|
1 |
bb.v and bb.nC > 10 and bb.pc > 1.5 |
Attribute Overview
The complete list of backbone attributes includes elements such as:
- Boolean Flags:
hasMaterial (hm),hidden (h),ownsMaterial (om),visible (v),selected - String Match:
name (n) - Integer Values:
formalCharge (fc),numberOfAtoms (nat),numberOfCarbons (nC), etc. - Float Values:
partialCharge (pc)
Many of these are inherited from higher-level attribute spaces—either the node or structuralGroup space—which means that understanding these general attribute groups helps in mastering backbone attributes too.
Use Cases
Here are a few real-world scenarios where this becomes invaluable:
- Visualization: Hide all backbones that don’t have material, improving scene clarity.
not bb.hm - Simulation Preparation: Select charged backbones for electrostatic analysis.
bb.fc > 0 - Filtering Coarse-Grained Models: Identify backbones with a specific number of coarse-grained atoms.
bb.ncga 100:500
Speed Up Your Workflow
This attribute-based querying saves time, especially in complex scenes. No more manual clicking around to find and select specific molecular fragments. It’s also script-friendly and integrates naturally into workflows that involve structure generation, editing, and analysis.
Whether you’re inspecting macromolecular assemblies or working on custom nanostructures, mastering these backbone selection attributes brings more control to your modeling process.
To learn more and see the complete documentation on backbone attributes, visit the official NSL backbone attribute page.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON today at https://www.samson-connect.net.
