A common challenge in molecular modeling is quickly isolating parts of a model based on structural complexity. For instance, you might want to find backbones with a specific number of atoms or carbon, hydrogen, or oxygen content—without visually scanning through the entire model. With large molecular systems, this becomes time-consuming and unreliable. Fortunately, SAMSON‘s Node Specification Language (NSL) provides an efficient solution for this.
In this post, we’ll explore how to use backbone attributes related to atom counts in NSL to perform precise, fast filtering of molecular structures. These include attributes such as:
numberOfAtoms(nat)numberOfCarbons(nC)numberOfHydrogens(nH)numberOfNitrogens(nN)numberOfOxygens(nO)numberOfSulfurs(nS)numberOfCoarseGrainedAtoms(ncga)
Why use these attributes?
These filtering attributes are ideal for examining patterns in molecular libraries, checking results from computational design tools, or preparing datasets for machine learning. You can, for example:
- Select flexible backbones based on low atom counts
- Isolate substructures likely to display certain chemical behavior (e.g., backbones rich in oxygen or nitrogen)
- Exclude coarse-grained models when working on all-atom simulations
Using the attributes in NSL
The syntax for querying these attributes is simple. Here are practical examples:
- Find backbones with fewer than 1000 atoms:
- Select backbones with 100 to 200 atoms:
- Filter for carbon-rich backbones (10 to 20 carbon atoms):
- Select hydrogen-deficient backbones:
- Exclude coarse-grained structures:
|
1 |
bb.nat < 1000 |
|
1 |
bb.nat 100:200 |
|
1 |
bb.nC 10:20 |
|
1 |
bb.nH < 10 |
|
1 |
not bb.ncga |
Combining filters
You can combine different filters to refine your search. For example:
|
1 |
bb.nO > 5 and bb.nH < 10 |
This expression finds backbones that are oxygen-rich but contain few hydrogens, which could be useful when looking for oxidized functional groups.
Working faster with short names
NSL supports shorthand versions for each attribute, such as nat for numberOfAtoms. This helps speed up your workflow, particularly during interactive exploration or scripting.
If you’re unsure which attributes are supported, you can always refer back to the documentation tables. For atom counts, all values are integers and comparisons like >, <, and ranges (e.g., 10:20) are supported.
Conclusion
Using atom count attributes for backbone nodes in SAMSON helps molecular modelers efficiently manage and analyze molecular systems based on structural complexity. Whether you’re preparing a dataset or narrowing down simulation targets, these filters let you do it with speed and accuracy—without leaving your modeling environment.
To explore the full list of backbone attributes and syntax, visit the documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
