Large molecular structures can contain many chains, and scrolling through them one by one is a slow way to find the chain you need. Maybe you know its chain ID, want to focus on especially long chains, or need to narrow a structure to chains with a particular organization. In SAMSON, the Node Specification Language (NSL) lets you describe those criteria with compact expressions.
This guide focuses on chain-level filters: choosing the right attribute, reading the shorthand, and avoiding a common source of confusion—mixing up residues, segments, and structural groups. These filters match chain nodes, rather than individual atoms or residues.
Start with the chain ID when you know it
If the chain identifier is the key piece of information, use chainID, whose short form is c.id. For example:
c.id 1matches chains with chain ID 1.c.id 2:4, 6matches chains with IDs from 2 through 4, as well as ID 6.c.id <= 3matches chains whose ID is less than or equal to 3.
This is a useful first filter when you already have an ID from a structure file, a collaborator, or a previous inspection. The full attribute name is chain.chainID; the abbreviated form is simply quicker to type.
Use residue count to find chains by length
When “long” or “short” is more useful than a particular identifier, filter by numberOfResidues, abbreviated as c.nr:
c.nr > 100matches chains with more than 100 residues.c.nr 100:120matches chains with a residue count between 100 and 120.
This can help you direct attention toward chains in a desired size range without inspecting every chain individually. Be precise about the quantity: residue count is not the same thing as atom count. If your question is about atoms instead, the inherited numberOfAtoms attribute uses c.nat; for example, c.nat < 1000 matches chains with fewer than 1,000 atoms.
Distinguish segments from structural groups
Two other chain attributes describe organization at different levels. numberOfSegments (c.ns) counts segments, while numberOfStructuralGroups (c.nsg) counts structural groups. They are not interchangeable with residue count.
c.ns < 3matches chains with fewer than three segments.c.ns 1:3matches chains with between one and three segments.c.nsg > 10matches chains with more than ten structural groups.c.nsg 10:12matches chains with between ten and twelve structural groups.
A practical way to choose is to ask what you already know: use c.id for identity, c.nr for residue length, c.ns for segment count, and c.nsg for structural-group count. Checking the attribute name before writing a query helps prevent a plausible-looking expression from answering the wrong question.
Remember the inherited chain attributes
Chain filters also include attributes inherited from the broader node and structural-group spaces. For example, c.n filters by name, c.v tests visibility, and c.fc refers to formal charge. The documentation lists boolean examples such as c.v and not c.v, as well as numeric comparisons and ranges. The short name for selected is intentionally absent in the chain attribute list, so use c.selected rather than assuming the shorthand used elsewhere applies.
For a reliable workflow, begin with the criterion you can state most clearly, use the corresponding attribute, and then refine your inspection based on the matching chains. The examples above are individual expressions; consult the NSL reference for the language’s broader syntax and additional ways to construct queries.
Read the chain attribute reference to learn more.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
