If you’ve ever worked with large molecular datasets, you know how valuable it is to filter and select structures based on their composition. Whether you’re modeling organic molecules, studying reaction mechanisms, or analyzing biomolecular systems, identifying specific groups based on atomic composition can save you time and improve your workflow.
SAMSON, the integrative molecular design platform, offers a feature in its Node Specification Language (NSL) that allows you to precisely filter structural groups using the number of atoms they contain—broken down by atom type.
Why filter by atom count?
Let’s consider a few scenarios:
- You’re looking for hydrophobic molecules with fewer than 10 carbon atoms.
- You suspect oxygen-rich groups to play a certain catalytic role and want to highlight those with more than 15 oxygen atoms.
- You want to isolate sulfonamide groups, so you’re filtering by both sulfur and nitrogen presence.
NASL provides a concise way to do this via the structuralGroup attribute space, using short names for attributes like numberOfCarbons (nC), numberOfHydrogens (nH), numberOfOxygens (nO), and others.
How it works in practice
Each of the atom-specific filters accepts integers and range-based queries. Examples include:
sg.nC < 10— matches structural groups with fewer than 10 Carbon atoms.sg.nO 5:15— matches those with 5 to 15 Oxygen atoms.sg.nN >= 7— matches groups with 7 or more Nitrogen atoms.
What’s particularly useful is that you can combine these queries with other structural group attributes using logical operators. For instance:
|
1 |
sg.nC 6:12 and sg.nH > 10 |
This expression selects structures that have between 6 and 12 Carbon atoms and more than 10 Hydrogen atoms.
A closer look at the atom-specific filters
Here are some of the attributes you can use to filter structural groups:
| Attribute | Short name |
|---|---|
| Number of Carbon atoms | nC |
| Number of Hydrogen atoms | nH |
| Number of Oxygen atoms | nO |
| Number of Nitrogen atoms | nN |
| Number of Sulfur atoms | nS |
| Number of Coarse-grained atoms | ncga |
Each of these allows actionable queries that can significantly improve your selectivity in large or complex molecular systems.
Getting started
To use this feature:
- Launch SAMSON and enter the NSL editor.
- Use queries like
sg.nO 10:20to highlight or filter relevant groups. - Combine multiple filters using logical conjunctions or disjunctions.
This approach is especially helpful when you want to prepare systems for simulation or visualization, and need to exclude or isolate groups based on elemental composition.
To learn more and explore the full documentation, visit the official SAMSON NSL documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON from https://www.samson-connect.net.
