Filtering Molecular Backbones by Atomic Composition in SAMSON

Molecular modelers often need to filter structural elements based on their atomic composition. Whether you’re studying peptides, coarse-grained models, or large macromolecular complexes, being able to select parts of molecules that meet specific atom count criteria can save time and reduce errors.

In this post, we’ll focus on how the Node Specification Language (NSL) in SAMSON helps you pinpoint molecular backbones with precision using numberOfAtoms, numberOfCarbons, numberOfHydrogens, and other similar attributes.

Backbone Attributes for Atomic Filtering

In NSL, the backbone attribute space (short name: s) lets you specify queries that only match backbone nodes. This is especially useful when you only want to filter or select high-level molecular structures.

When dealing with atomic composition, the following attributes—inherited from the structuralGroup attribute space—come into play:

  • bb.nat – Total number of atoms
  • bb.nC – Number of carbon atoms
  • bb.nH – Number of hydrogen atoms
  • bb.nN – Number of nitrogen atoms
  • bb.nO – Number of oxygen atoms
  • bb.nS – Number of sulfur atoms
  • bb.ncga – Number of coarse-grained atoms

These attributes take integers and support powerful operations such as threshold-based expressions and ranges. Here are some usage examples:

Why Is This Useful?

Filtering by atomic counts is useful in a variety of scenarios:

  • Pre-simulation cleanup: Identify fragments or structural regions with incomplete atomic data.
  • Model optimization: Focus on heavily carbonated domains or reduce complexity by trimming surplus hydrogen atoms.
  • Visual clarity: Simplify the view by showing only components with a specified size (e.g., nat ≥ 500 atoms).

Atomic filtering also works well in combination with visibility or selection flags:

Related Attributes

In addition to atom counts, you can also filter by:

  • formalCharge (bb.fc): Useful in electrostatics analyses.
  • partialCharge (bb.pc): For more fine-grained electronic property filtering.

Quick Tip

You might be tempted to use bb.selected or bb.sf to focus only on currently selected regions, but remember—these are status flags, not structural filters. Combine them when needed, but use them thoughtfully.

Conclusion

Being able to specify molecular backbones by their atomic makeup brings flexibility and precision to your modeling workflow in SAMSON. Try combining these filters for more advanced queries—like isolating coarse-grained models (bb.ncga > 200) with minimal nitrogen content (bb.nN < 5).

To explore all backbone attributes in SAMSON’s Node Specification Language, visit the official documentation here: https://documentation.samson-connect.net/users/latest/nsl/backbone/

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

Comments are closed.