When a structure contains several chains, finding the one you need can be surprisingly tedious. Chain labels may be unfamiliar, and a long protein can make visual inspection a poor way to distinguish candidates. SAMSON’s Node Specification Language (NSL) lets you describe a chain by properties such as its ID, residue count, or number of segments, then match chains against those criteria.
The key is to target the right level: the chain attribute space, abbreviated c, matches chain nodes. Its attributes include chain-specific properties and properties inherited from other node types. That gives you a practical way to narrow a structure using either identity or measurable characteristics.
Start with chain identity
If you already know the chain ID, use c.id. For example, c.id 1 matches a chain whose ID is 1. You can also specify a range and an additional ID: c.id 2:4, 6 matches IDs 2 through 4 and ID 6. This is useful when you know which chain labels matter but do not want to rely on clicking each chain in the scene.
Chain ID is an integer-valued attribute. It is distinct from a chain’s name: if you need to search by name instead, the inherited name attribute has the short form c.n. For example, the reference gives c.n "A" as a name query. Keeping ID and name separate helps avoid a common mix-up when inspecting imported structures.
Use size to find candidates
When the chain ID is unknown or unhelpful, the number of residues can be a better starting point. The short form c.nr refers to numberOfResidues. For instance, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 matches chains in the 100–120 range.
These filters are especially handy when you are looking for a large protein chain among smaller chains, or checking whether an imported model has the approximate size you expect. They do not identify a biological role by themselves; they simply narrow the set of chains to inspect.
Check structure and composition
Chains also expose numberOfSegments (c.ns) and numberOfStructuralGroups (c.nsg). For example, c.ns > 2 matches chains with more than two segments, and c.nsg 10:12 matches chains with 10 to 12 structural groups. These counts can help you spot chains whose organization or size differs from what you expect.
The inherited structural-group attributes provide additional summaries, including atom counts, element counts, formal charge, and partial charge. Their short forms include c.nat for atom count, c.nC for carbon count, c.nO for oxygen count, c.fc for formal charge, and c.pc for partial charge. For example, c.nat < 1000 matches chains with fewer than 1,000 atoms, while c.pc > 1.5 matches chains with partial charge greater than 1.5.
A small, repeatable workflow
- Use
c.idwhen you know the chain ID; usec.nwhen you are looking for a name. - Use
c.nrto narrow candidates by residue count. - Check segment, structural-group, or composition counts when size alone is not enough.
- Use visibility and selection attributes, such as
c.vandc.selected, when you need to query whether chains are visible or selected.
Each example above is a standalone expression. The main benefit is not that one number tells you everything about a chain; it is that a few clear, testable criteria can replace a lot of manual scanning. For the complete attribute list and additional details, see the SAMSON chain attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
