Quickly Select Backbone Groups with Specific Atomic Composition in SAMSON

In molecular modeling projects involving large biomolecular systems, tasks such as identifying backbone structural groups with specific atomic counts or charge characteristics can be time-consuming. Whether you’re preparing a dataset, analyzing systems, or building coarse-grained models, manually filtering and inspecting backbone groups can slow you down.

Fortunately, SAMSON’s Node Specification Language (NSL) allows you to perform these kinds of queries efficiently. In this post, we’ll walk through how to filter molecular backbone nodes based on atomic and charge attributes, helping you streamline your workflow and avoid repetitive tasks.

Why filter by atomic composition?

Backbone groups form the structural spine of biomolecules. When dealing with hundreds or thousands of backbones across a system, you may want to filter those that:

  • Are highly charged (e.g., formalCharge > 1),
  • Have an unusually high number of carbon atoms (e.g., nC > 10),
  • Are within a specific size window (e.g., numberOfAtoms between 100 and 200),
  • Contain specific elements (nitrogens, sulfurs, etc.) for feature-based modeling or property predictions.

The NSL syntax lets you navigate this complexity with just a few characters. For example, to select backbone groups with more than 10 carbon atoms, you simply use:

Here, bb refers to backbone nodes, and nC is the number of carbon atoms in that group.

Useful attributes in Backbone filtering

Here’s a quick summary of some useful NSL attributes specific to backbone filtering, inherited from the structuralGroup space:

  • bb.fcformalCharge: integers
    Example: bb.fc > 1 or bb.fc 2:5
  • bb.natnumberOfAtoms: total atoms in the group
    Example: bb.nat 100:200
  • bb.nC, bb.nH, bb.nN, bb.nO, bb.nS: count of each major element
    Example: bb.nN < 5, bb.nS 1
  • bb.pcpartialCharge: use this if you want to filter groups based on partial atomic charges
    Example: bb.pc 1.5:2.0

Combining these conditions allows precise selections. For instance:

This selects backbone groups with positive formal charge, more than two oxygens, and between 5 and 10 carbons.

Where this becomes powerful

Rather than browsing through your molecular model manually, you can paste these expressions into SAMSON’s selection field or script them into workflows. You’ll save time, reduce errors, and ensure repeatable selections.

No short name for selected

Note that while many attributes in NSL have short forms (e.g., nC for number of carbons), selected in the context of backbones does not. To test whether a backbone is selected, use:

There is no short form like bb.s for this.

If you’re new to NSL or just discovering the backbone attribute space, you can explore the full documentation here.

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

Comments are closed.