Finding the Right Chains Fast in Your Molecular Model with NSL

When working with large molecular systems, it’s easy to feel overwhelmed trying to isolate the chains that matter most for your research. Whether you’re targeting specific biomolecular chains for visualization, simulation, or export, filtering them manually can quickly get tedious and error-prone.

Fortunately, SAMSON’s Node Specification Language (NSL) provides a simple yet powerful way to filter chains based on their attributes—such as number of residues, chain ID, visibility, and even elemental composition. In this tutorial, we’ll focus on how to quickly and accurately select chains using NSL’s chain attribute space, especially when managing complex multi-chain models. This can help reduce time spent scrolling, clicking, and zoning in on the data that matters.

Why focus on chains?

Chains represent major structural units in biomolecular models, corresponding often to full proteins, DNA strands, or coarse-grained macromolecules. Selecting specific chains—or filtering chains that meet particular criteria—is often the first step prior to rendering, analysis, or exporting subsets of a system.

Step-by-step: Filtering chains using attributes

In NSL, chains are accessible through the chain attribute space, abbreviated as c. Here’s how you can use some of the most useful attributes to refine your chain selections.

1. Filter by chain ID

Each chain has a unique identifier. To select the chain with ID 1:

To select chains with IDs between 2 and 4 and ID 6:

2. Filter by number of residues

Need to focus on longer chains with a certain number of residues?

This selects chains with more than 100 residues. You can also specify a range:

3. Filter by number of structural groups or segments

Bounding models based on functional domains can benefit from filtering via segments:

Or use the number of structural groups (e.g., secondary structures or grouped entities):

4. Combine visibility or selection flags

Only want visible chains?

…or only the invisible ones:

Similarly, filter based on those that are selected or not:

Practical example

Let’s say you are analyzing a PDB file with several chains but only want to view chains that:

  • Contain more than 150 residues
  • Are currently visible

The NSL expression would be:

This selects and filters exactly what you want, avoiding manual sifting.

Takeaways

Powerful selections like these are particularly useful when working with large systems, such as multi-protein complexes, virus capsids, or large assemblies. Instead of clicking through a scene, a single NSL command can immediately highlight what you need. This is especially helpful for preparing structures before simulation workflows or for exporting visuals.

To explore the full range of chain attributes available in SAMSON’s Node Specification Language, visit the full documentation page: Chain Attributes in NSL.

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON here to try out NSL in your molecular modeling workflows.

Comments are closed.