Quickly Filter Molecular Chains by Number of Residues in SAMSON

If you’ve ever worked on a large biomolecular simulation, chances are you’ve dealt with complex systems containing dozens—or even hundreds—of chains. Whether you’re cleaning up your system, focusing only on specific interactions, or preparing subsets for visualization or analysis, selecting the right chains can be tedious. One common headache: identifying and filtering chains based on their number of residues. Fortunately, SAMSON’s Node Specification Language (NSL) offers a very efficient solution.

Why filter by number of residues?

The number of residues in a chain is a useful proxy for chain length or completeness. For example:

  • You may want to exclude short peptide chains (like linkers or tags)
  • You might want to focus only on the longest or most biologically relevant chains
  • You could be preparing chains with certain lengths for separate simulation batches

Whatever the reason, having a way to quickly isolate chains based on this criterion can save time and avoid manual selection errors.

How to use numberOfResidues in NSL

In SAMSON, the attribute to use is numberOfResidues, identified in the NSL with the short name nr. It belongs specifically to the chain attribute space (alias c), and it accepts integers.

Examples:

  • c.nr > 100 → selects chains with more than 100 residues
  • c.nr 80:120 → selects chains with between 80 and 120 residues

This precise filtering capability is especially useful when combined with other attributes. For instance, to find visible chains longer than 150 residues, you could use:

Combining multiple filters

Let’s say you want to select chains that:

  • Are currently visible
  • Have more than 75 residues
  • Are not hidden

Your expression would be:

You can paste this directly into the NSL search bar inside SAMSON’s selection tool. The result: only chains meeting all these conditions will be selected.

Working with large molecular systems doesn’t have to be overwhelming. The more features you know about NSL, the less time you’ll spend scrolling through a hierarchy of nodes and the more time you’ll save for interpretation and modeling.

Pro tip: Understand ranges and thresholds

  • c.nr 50:100 → means residue count is between 50 and 100, inclusive
  • c.nr < 80 → matches chains with fewer than 80 residues
  • c.nr 45:55, 60, 70:75 → combines precise IDs and ranges

Understanding and using these modifiers can drastically streamline workflow—especially when you’re refining your view or preparing subsets for export.

To learn more about all available attributes and how they work across hierarchical levels in SAMSON, visit the official documentation page: Chain attributes in NSL.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.

Comments are closed.