When working with complex molecular models, navigating and filtering through large systems can become a challenge. If you are dealing with sizable biomolecules or hybrid materials in SAMSON, you’ve probably found yourself wanting to quickly isolate key parts of a structure: a segment with a specific number of atoms, a formal charge range, or perhaps the presence (or absence) of a particular element. That’s where segment attributes in the Node Specification Language (NSL) come into play.
NSL lets you concisely express queries to search molecular models based on specific properties. Today, we’ll take a closer look at segment-level filtering — a smart and efficient way to select portions of your system based on structural and chemical features.
Why segments?
Segments in SAMSON refer to higher-order nodes that group together residues and structural groups. These are especially relevant in biomolecular systems (like proteins or nucleic acids), coarse-grained models, or user-defined logical groupings of atoms.
The segment attribute space in NSL is identified using the prefix s. This space gives you access to many inherited and specific attributes you can use in your queries.
Useful filters you may not know about
Here are just a few examples of useful segment attributes and how to use them:
- Formal charge: Use
s.fcto find charged segments. For example:s.fc > 0selects segments with a net positive formal charge. - Number of atoms: Use
s.natto query segment size. For example:s.nat 100:500selects segments with 100 to 500 atoms. - Number of hydrogens:
s.nH < 10might help find hydrophobic or coarse-grained parts of your model. - Partial charge: Use
s.pcto identify highly polarized segments. Example:s.pc 1.5:2.0 - Number of residues: Specific to segments,
s.nrhelps in finding relevant biological units. Trys.nr > 100for larger peptide chains or domains. - Elemental content: Narrow down by number of carbons (
s.nC), nitrogens (s.nN), sulfurs (s.nS), etc.
These attributes make it easy to structure your search in powerful combinations. For instance, to find smaller segments that are partially charged and contain sulfur, you could combine:
|
1 |
s.nat < 200 and s.pc > 1.2 and s.nS > 0 |
You might find such queries helpful when identifying potential active sites, binding pockets, or synthetic moieties in hybrid systems.
Tips for effective use
- Short names save time: Use codes like
nat,fc, andpcwith prefixsto speed up query typing. - Ranges work great: You can write
s.nC 10:20to match a range of carbon counts. - Combine conditions: NSL supports logical operators like
and,or, andnot.
Segment filters are especially helpful when coupled with selection workflows, either for visualization or post-processing. For instance, highlighting segments with high partial charges or those containing specific heteroatoms can guide electrostatics calculations, visualization of active domains, or data export for external analysis.
NSL in SAMSON transforms model navigation from manual zooming into precision targeting with scriptable ease.
You can learn more about segment attributes here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
