Find the Chain You Need: A Practical Guide to SAMSON’s Chain Queries

When a molecular structure contains many chains, finding the one you want can be more difficult than it sounds. A chain may be easy to overlook because it has an unexpected ID, a different number of residues than anticipated, or several segments where you expected one. Scanning the structure manually is slow—and it is easy to select the wrong thing.

SAMSON’s Node Specification Language (NSL) lets you describe chain properties as queries. The chain attribute space uses chain, or the shorter prefix c, and matches chain nodes. The useful shift is to search by measurable properties, rather than relying only on visual inspection or a remembered label.

Start with chain identity

If you know the chain ID, try c.id 1. To search for IDs in a range and another specific ID, the documented example is c.id 2:4, 6. The full attribute name works too: chain.id 1. This is a good first check when a structure has multiple chains and you need to verify which chain corresponds to an expected ID.

Chain IDs are only one clue. If the ID is not known—or if you want to check whether the chain’s size makes sense—use its counts.

Use residue and segment counts to spot mismatches

For residue count, use c.nr. For example, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 searches for chains in the documented 100-to-120 range. These queries can help narrow down candidates when you know roughly how long a chain should be, or identify chains that are much shorter or longer than expected.

Segment count is available as c.ns. The query c.ns > 2 finds chains with more than two segments; c.ns 2:4 searches a range. This gives you another structural clue to check when a chain’s organization matters to your inspection.

For a broader measure of chain size, try c.nsg > 10, which matches chains with more than 10 structural groups. You can also query atom counts with c.nat < 1000. These counts describe different aspects of a chain, so they are best treated as complementary checks rather than interchangeable measurements.

Check composition and charge

Chain queries also inherit attributes from the structural-group space. That means you can look at atom counts for particular elements: c.nC < 10 for carbon, c.nN < 10 for nitrogen, c.nO < 10 for oxygen, and c.nS < 10 for sulfur. Hydrogen counts use c.nH, and coarse-grained atom counts use c.ncga.

For charge-related checks, c.fc > 1 queries formal charge, while c.pc > 1.5 queries partial charge. These attributes can be useful when you want to distinguish chains using more than their identity or size. The documentation lists formal charge and atom counts as integers, and partial charge as a floating-point value.

A practical way to narrow the search

  1. Begin with a known ID, if you have one: c.id 1.

  2. Check whether the candidate’s residue count is plausible: for example, c.nr 100:120.

  3. Use segment or structural-group counts as additional checks: c.ns < 3 or c.nsg > 10.

  4. If the chain is still ambiguous, inspect elemental counts or charge attributes such as c.nS or c.fc.

This sequence is useful because it starts with simple identifiers and moves toward descriptive properties. You do not need every attribute for every structure: choose the checks that match what you already know, and use multiple independent clues when a single count is not enough.

Small syntax details that prevent confusion

Most chain attributes can be written with either the full chain prefix or the shorter c prefix. For example, chain.numberOfResidues > 100 is equivalent to c.nr > 100. The selected attribute is an exception worth remembering: chains support c.selected and not c.selected, but this attribute has no short name in the chain space. Other useful inherited state checks include c.v for visibility and c.h for hidden state.

These queries turn chain identification into a reproducible process: describe the chain you are looking for, then check its ID, size, organization, or composition. For the complete attribute reference and additional details, see the SAMSON chain attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at www.samson-connect.net.

Comments are closed.