When a molecular structure contains several chains, the first challenge is often simply finding the one you need. Maybe you are looking for a long chain, checking which chain has an unexpected number of segments, or narrowing down a chain by its identifier. Clicking through the structure and counting residues manually is slow—and easy to get wrong.
SAMSON’s Node Specification Language (NSL) lets you describe the chain you want using attributes. The chain attribute space matches chain nodes, and its short prefix is c. This means you can filter chains by properties such as chain ID, residue count, segment count, or number of structural groups.
Start with the question you are trying to answer
Different chain attributes answer different questions. Choosing the right one makes a query more useful and easier to interpret:
- How long is the chain in residues? Use
numberOfResidues, shortened tonr. For example,c.nr > 100matches chains with more than 100 residues. - Which chain has a particular identifier? Use
chainID, shortened toid. For example,c.id 1matches the chain whose ID is 1. - How many segments does it contain? Use
numberOfSegments, orns. For example,c.ns < 3matches chains with fewer than three segments. - How many structural groups does it contain? Use
numberOfStructuralGroups, ornsg. For example,c.nsg > 10matches chains with more than ten structural groups.
These counts describe different properties. A residue count is not the same query as a segment count or a structural-group count. If you are investigating a chain that looks unexpectedly large or fragmented, checking the relevant count directly can help you focus the inspection.
Use ranges to narrow the search
Exact values are useful when you already know what to look for. Ranges help when you want to inspect a broader group. For example, c.nr 100:120 matches chains with a residue count between 100 and 120, while c.ns 2:4 matches chains with two to four segments.
You can also specify more than one chain ID in a query. The expression c.id 2:4, 6 matches chains with IDs from 2 to 4, as well as the chain with ID 6. This is handy when you want to revisit a small set of chains without treating every chain in the structure alike.
Remember what the identifier means
The documented chainID attribute takes integer values. In other words, the examples here query chain IDs such as 1 or 2; they do not demonstrate matching letter-based identifiers. If an expression returns no match, check that the identifier and the attribute’s expected value type agree.
Chain attributes also include properties inherited from other NSL attribute spaces. For example, you can query whether a chain is visible with c.v, or test the chain name with an expression such as c.n "A". The full reference lists inherited attributes, including visibility, selection, material, atom counts, and charge-related properties.
A practical way to work
- Decide what you need to identify: a chain by ID, size, segmentation, or another property.
- Choose the matching attribute—for example,
c.nrfor residue count orc.idfor chain ID. - Start with a broad range or threshold, then adjust it to focus your inspection.
- Use the full attribute name when it is easier to read, or the short form when you want a compact expression.
Thinking in terms of the question first—rather than trying several unrelated filters—makes chain searches easier to reproduce and share with collaborators. For the complete list of chain attributes and examples, see the SAMSON chain attribute reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
