When working with complex molecular models in SAMSON, it’s easy to get lost in the layers of structural information—atoms, residues, chains, segments, and so on. For molecular modelers, one of the most time-consuming tasks can be identifying specific chains based on chemical composition or structural detail, such as the number of carbon atoms or hydrogen atoms in the chain.
This often becomes essential when analyzing biomolecular assemblies, coarse-grained models, or even designing new materials. Whether you’re exploring a protein’s secondary structure or investigating a ligand’s interaction pattern, you may need to select only those chains that meet a certain atom-count criterion. Fortunately, SAMSON’s Node Specification Language (NSL) makes this type of filtering straightforward.
How to filter chains by atom counts
Attributes from the structuralGroup attribute space allow you to filter chains using atom-specific counts, such as:
c.nC: Number of carbon atomsc.nH: Number of hydrogen atomsc.nN: Number of nitrogen atomsc.nO: Number of oxygen atomsc.nS: Number of sulfur atoms
For example:
c.nC < 10will match chains with fewer than 10 carbon atomsc.nH 10:20will match chains with 10 to 20 hydrogen atomsc.nO >= 5(using NSL syntax variations) can be used to find more oxygen-rich chains
Combining these filters gives you even more control:
|
1 |
c.nC > 5 and c.nO < 8 |
This selects chains that are relatively carbon-rich but have fewer oxygen atoms, which might be useful when searching for hydrophobic regions.
Why is this useful?
Using these filters means you don’t have to manually browse through the structure tree or visually scan the 3D model and risk overlooking something. Here are a few ways this can be practically useful:
- Coarse analysis: Rapidly estimate the distribution of atom types across chains in a large macromolecule.
- Model preparation: Exclude unwanted chains before simulations or rendering.
- Selective visualization: Highlight chains of interest with custom visual styles by pre-filtering them based on their atom content.
Things to keep in mind
- The syntax requires integers for these attributes, so it’s suitable for whole atom counts (e.g., you can’t use floating points).
- These filters work within the
cattribute namespace, which is specific to chain nodes.
Advanced users can combine atom count filters with attributes like visible (c.v) or numberOfResidues (c.nr) to create complex queries that speed up structure analysis.
Learn more in the original documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at www.samson-connect.net.
