When working with large molecular systems, quickly locating and analyzing specific side chains based on their atomic composition can become a challenge. Whether you’re interested in simplifying your view, isolating chemically relevant groups, or preparing a structure for coarse-grained simulations, being able to programmatically filter side chains is a major time-saver.
The Node Specification Language (NSL) in SAMSON, the integrative platform for molecular design, provides a powerful and flexible way to query and filter nodes in your molecular models. One particularly handy use case involves filtering side chains based on their number of atoms.
Why Filter by Atom Count?
Different side chains play different roles in biomolecular function. Some are bulky and hydrophobic, others are small and charged. In structure preparation, visualization tuning, or simulation setup, you might want to:
- Identify side chains with a large number of atoms (e.g., aromatic groups, long aliphatic chains).
- Detect very small side chains (e.g. glycine-like residues).
- Exclude side chains that are too small or too large for certain algorithms (e.g., docking pockets or coarse-graining).
How to Use NSL to Filter by Atom Count
In SAMSON, side chain attributes are accessed through the sideChain attribute space (short name: sc). Among many attributes, numberOfAtoms (short name: nat) is particularly useful when filtering by atom count.
Here’s how to write a few simple, powerful queries:
|
1 |
sc.nat > 20 |
This selects all side chains with more than 20 atoms.
|
1 |
sc.nat 5:15 |
Selects all side chains with a number of atoms between 5 and 15.
Combined with other filters, you can become even more specific. For example:
|
1 |
sc.nat > 10 and sc.nC > 5 |
This selects side chains that have more than 10 atoms and more than 5 carbon atoms.
Advanced Uses
Thanks to NSL’s intuitive syntax, you can build complex selection strategies easily. For instance, if you’re preparing a visual simplification of a molecular model while preparing a publication or presentation, you can:
|
1 |
not sc.nat > 100 |
This selects all side chains with 100 atoms or fewer—perfect for decluttering dense structures in large proteins.
Or in reverse, you can isolate side chains likely to appear in key functional roles or binding pockets:
|
1 |
sc.nat >= 80 and sc.pc > 1.0 |
This finds side chains that are both large and carry a significant partialCharge—a possible signal of functional importance.
Where to Learn More
To explore all available attributes and deepen your understanding of side chain attribute filtering in NSL, head over to the official documentation for sideChain attributes:
https://documentation.samson-connect.net/users/latest/nsl/sideChain/
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
