When working with complex biomolecular systems, it’s common to encounter structural groups that number in the hundreds—if not thousands. A key challenge for molecular modelers is quickly filtering these structures when looking for groups with a specific atomic composition, such as groups rich in carbon or with a limited number of hydrogens. This is where the Node Specification Language (NSL) in SAMSON can help, particularly with its structuralGroup attributes.
NSL allows you to create concise, human-readable queries that efficiently filter structural groups based on meaningful attributes. In this post, we’ll focus on attributes specific to structural groups that relate to atomic composition:
numberOfAtoms(sg.nat)numberOfCarbons(sg.nC)numberOfHydrogens(sg.nH)numberOfNitrogens(sg.nN)numberOfOxygens(sg.nO)numberOfSulfurs(sg.nS)
These attributes let you write expressions like:
|
1 |
sg.nC > 3 |
to select structural groups containing more than three carbon atoms.
How it helps in practice
Imagine you’ve imported a protein structure that contains various ligands and cofactors. You want to isolate structural groups with more than 8 carbon atoms and less than 2 sulfur atoms. Using NSL, your query would look like this:
|
1 |
sg.nC > 8 and sg.nS < 2 |
This helps reduce the noise in your analysis and focus only on chemically significant parts of your system. For example, you could exclude water clusters or inorganic ions, which usually contribute little carbon or sulfur.
Range-based searches
NSL also supports range-based queries, letting you focus on structural groups that fall within a specific atomic count window. For example:
|
1 |
sg.nH 10:20 |
selects all structural groups with between 10 and 20 hydrogen atoms. This can be helpful if you’re analyzing potential drug-like fragments and want to find groups within a particular size range.
Unlike traditional scripting or filtering through selection GUIs, NSL expressions are minimal, expressive, and easy to share with colleagues. If you’re preparing a pipeline or automating repetitive analysis tasks, composing queries like these can be a huge time saver ⏱️.
Composing multiple conditions
You can combine multiple attributes to fine-tune your selection. For example:
|
1 |
sg.nC 6:12 and sg.nH 8:20 and sg.nO >= 2 |
selects structural groups with 6-12 carbon atoms, 8-20 hydrogen atoms, and at least 2 oxygen atoms.
This is particularly useful in fragment-based drug discovery, where identifying chemically diverse and plausible fragments is key.
When shortcuts matter
Every attribute also has a shorthand name (e.g., nC for numberOfCarbons), which allows queries to remain concise. Here’s a compact example:
|
1 |
sg.nC 10:15 and sg.nH 10:15 and sg.nO < 4 |
This query identifies balanced fragments suitable for follow-up synthesis or analysis.
If you haven’t explored these atomic-count attributes in NSL yet, give them a try. They can make your structural group selection more systematic, especially when dealing with large systems like protein–ligand complexes, polymers, or nanoparticle assemblies.
To learn more about these attributes and others in the structuralGroup attribute space, visit the documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON here.
