When working with large biomolecular systems in SAMSON, it’s easy to get overwhelmed by the volume of data. Want to quickly isolate chains that are hidden, contain a specific number of residues, or have a certain partial charge? Doing this manually can be time-consuming and error-prone.
Fortunately, SAMSON’s Node Specification Language (NSL) offers an expressive and compact way to query molecular data. This blog post dives into the attributes of chain nodes within the NSL system, focusing on how molecular modelers can leverage the c namespace to instantly filter complex systems.
Why chain-level filtering matters
Many modeling workflows—especially when preparing structures for simulations, visualizations, or analyses—require looking at specific chains or groups of them. For example, you might want to:
- Visualize only visible protein chains
- Select chains with more than 100 residues for a structural comparison
- Filter for chains with a formal charge above a certain threshold
These tasks are repeated across projects and collaborators, so having a reliable and simple way to express them becomes very useful. That’s where chain attributes shine.
Attribute spaces and c shorthand
In NSL, chains belong to their own attribute space: chain, or c for short. This means attributes prefixed with c. apply exclusively to chain nodes. Here are some commonly used attributes and what they help you with:
| Attribute | Short name | Usage example |
|---|---|---|
| chainID | id |
c.id 1 |
| numberOfResidues | nr |
c.nr > 120 |
| partialCharge | pc |
c.pc 1.2:1.8 |
| visible | v |
c.v |
Practical examples
- Find all visible chains:
c.v - Chains with chainID between 2 and 4, or 6:
c.id 2:4,6 - Chains with more than 130 residues:
c.nr > 130 - Chains with a charged residue (partialCharge > 1.5):
c.pc > 1.5 - Chains that are invisible:
not c.v
With expressions like these, you can simplify your modeling environment, and focus only on what matters. Combine multiple attributes with logical operators like and, or, and not for even more fine-grained control.
Dynamic scripting vs. manual filtering
Before NSL, filtering had to be done manually—clicking through the Document View or scripting custom selectors. Both approaches work, but NSL makes the process intuitive and reusable. Whether you’re prepping datasets or prototyping molecular scenes, a reusable selector like c.nr > 100 and not c.v can help standardize your workflow.
If you’re writing extensions or collaborating, these expressions help you document logic clearly: future you (or someone else) can see exactly which parts of a system were used and why.
Learn more and keep exploring
Interested in diving deeper into chain-level attributes? You can consult the full documentation page here: https://documentation.samson-connect.net/users/latest/nsl/chain/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
