When analyzing large molecular models like proteins or nucleic acids, it’s common to handle polymers made up of many repeating units—segments. But what if you only want to isolate parts of your model that meet specific structural or chemical characteristics?
Manually identifying every protein segment with more than 100 residues, a formal charge over 2, or fewer than 15 carbons isn’t just tedious—it’s unnecessary. That’s where the Node Specification Language (NSL) in SAMSON comes in.
NSL allows you to write concise text-based filters to query complex molecular structures. In this post, we’ll look at how to use segment attributes in NSL to streamline your selection workflow and focus on the parts of the molecule that matter most for your analysis or simulation.
Segment Attributes: Powerful Filters Made Simple
In NSL, the segment attribute space (s) refers specifically to segment nodes. These include chains in proteins, sections of nucleic acids, and other polymeric substructures. Segment attributes let you define boolean or numerical criteria that segments must meet to be selected.
For example, suppose you want to:
- Select only segments that are visible:
s.v - Filter segments that have more than 130 residues:
s.nr > 130 - Find segments that contain between 10 and 20 carbons:
s.nC 10:20 - Isolate segments with a partial charge between 1.5 and 2.0:
s.pc 1.5:2.0
This kind of filtering is especially useful when preparing simulations, visualizing large systems, or analyzing specific regions of a macromolecule. Instead of zooming and clicking around endlessly, you can pinpoint relevant segments instantly.
Common Segment Attributes You Should Know
Segment attributes are grouped based on what space they inherit from. Here’s a short guide to the most practical ones:
From the node attribute space:
s.v– Is the segment visible?s.n "A"– Name of the segment, supports wildcardss.om– Does it own material properties?s.h– Is it hidden?
From the structuralGroup attribute space:
s.fc– Formal charge (integer)s.nC,s.nH,s.nO– Number of specific atoms (carbons, hydrogens, oxygens, etc.)s.pc– Partial charge (float)
Specific to the segment space:
s.nr– Number of residuess.nsg– Number of structural groups
These filters don’t operate in isolation. Combined expressions let you build complex queries. For example:
|
1 |
s.nr > 100 and s.nC < 15 and s.v |
This selects visible segments with more than 100 residues and fewer than 15 carbon atoms.
Why It Matters
Whether you’re building a coarse-grained model, refining a docking site, or visualizing a specific biochemical domain, filtering segments efficiently can save time and reduce errors. Instead of relying on GUI-based selection tools, NSL gives you fast, repeatable, and scriptable control.
Segment filtering with NSL is especially valuable in larger projects involving structural comparisons, simulations, or visualization preparation. By learning a few simple attributes, you unlock the ability to manage complexity with precision.
To learn more and explore the full list of segment attributes, visit the official documentation here: https://documentation.samson-connect.net/users/latest/nsl/segment/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
