Working with molecular models that include multiple chains can often feel overwhelming—especially if you’re trying to select or isolate specific chains based on unique criteria. Whether you’re preparing a simulation, analyzing a structure, or simply cleaning up a model, being able to select chains based on their properties can save you hours of manual clicking and filtering.
The Node Specification Language (NSL) in SAMSON offers a powerful way to automate this process. In this post, we’ll explore how you can use chain attributes to precisely target chains of interest in your molecules using NSL queries.
Why This Matters
Imagine a protein complex with multiple chains, but you only want to:
- Select chains visible in the viewport
- Work on chains with more than 100 residues
- Analyze chains rich in certain atom types
Doing this manually is tedious and prone to error. With the chain attribute space in NSL, it’s just a line of text away.
Example: Selecting Chains by Number of Residues
Suppose you want to select chains that contain more than 130 residues. You can use the following expression:
|
1 |
c.nr > 130 |
Need to specify a range? Use:
|
1 |
c.nr 100:130 |
This instantly highlights chains in that range. It’s accurate and incredibly fast.
Combine Attributes for More Complex Filtering
Let’s say you’re looking for chains that:
- Are visible
- Have fewer than 3 segments
Try this:
|
1 |
c.v and c.ns < 3 |
Identify Chains by Specific ID
Perhaps you’re comparing specific chains across multiple models. Use the chainID:
|
1 |
c.id 1 |
This matches the exact chain. To select chains 2 through 4 and another at ID 6, you can write:
|
1 |
c.id 2:4,6 |
Other Useful Properties
- c.fc: Formal charge
- c.nC, c.nO, c.nS: Number of Carbon, Oxygen, Sulfur atoms
- c.ncga: Coarse-grained atom count
Want to quickly find chemically unique chains in a model? Just filter by atom type counts or formal/partial charge ranges.
Putting It All Together
Let’s consider a more advanced use case: You want chains that are hidden, contain 10–20 Oxygen atoms, and have more than 10 structural groups:
|
1 |
c.h and c.nO 10:20 and c.nsg > 10 |
This is the power of NSL in action—precise targeting without clicking through menus.
To view the full list of attributes and learn more about how to use them, visit the documentation page here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
