When a molecular structure contains many chains, finding the one you need by scrolling through a hierarchy or inspecting the viewport can become tedious. The challenge is not always identifying a chain by name: you may be looking for a long chain, one with a particular chain ID, or one with a specific number of segments. In SAMSON, the Node Specification Language (NSL) lets you express these criteria as filters over chain nodes.
This is useful when you want to turn a vague inspection task into a reproducible query. Instead of relying only on what is visible on screen, you can ask for chains by identifiers and structural counts. The examples below use the c short name for the chain attribute space.
Start with the chain ID
If you already know a chain’s ID, use c.id. For example, c.id 1 matches chains whose chain ID is 1. To include a range and an additional ID, the documented expression is c.id 2:4, 6: it matches IDs from 2 to 4, as well as ID 6.
This can help when checking a known subset of chains or when a structure’s chain identifiers are more useful to you than its display names. The important distinction is that this query concerns the chain ID—not a residue number or an atom index.
Use residue count to find long or short chains
When chain length is the real concern, use c.nr, the short name for numberOfResidues. For instance, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 matches chains with a residue count between 100 and 120.
This is a practical way to narrow down a complex model before inspecting individual chains. It can also help distinguish a substantial polymer chain from shorter components without needing to estimate length visually. Remember that this attribute counts residues; it is not the same as the number of atoms.
Check segmentation and structural-group counts
Some chains are organized into multiple segments. The c.ns attribute represents numberOfSegments: c.ns > 2 matches chains with more than two segments, and c.ns 2:4 matches chains with between two and four.
For a different structural count, use c.nsg, the short name for numberOfStructuralGroups. For example, c.nsg > 10 selects chains with more than ten structural groups. These counts offer different ways to describe a chain, so choose the one that matches the question you are asking rather than treating them as interchangeable measures of length.
Bring chemical composition into the search
Chain nodes also inherit several attributes from the structuralGroup attribute space. These include counts of atoms and selected elements, as well as formal and partial charge. For example, the documented expressions c.nC < 10, c.nO 10:20, and c.pc > 1.5 refer respectively to carbon count, oxygen count, and partial charge.
These inherited properties can help you explore chains from a chemical perspective, not just by ID or organization. Keep the attribute’s meaning in view: c.nat is a number of atoms, whereas c.nr is a number of residues.
A small, reusable workflow
- Decide what you need to identify: an ID, residue count, segment count, structural-group count, or chemical property.
- Choose the corresponding attribute, such as
c.id,c.nr, orc.ns. - Use a comparison or range that reflects your criterion, following the documented examples.
- Inspect the matching chain nodes in the context of your model before drawing conclusions about their role.
NSL chain attributes make structural exploration more precise by letting you describe what you are looking for instead of relying solely on visual scanning. For the complete attribute reference and additional examples, see the SAMSON chain attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
