Find the Chain You Need: A Practical Guide to Chain Filters

When a molecular structure contains many chains, finding the one you need can feel like searching a long list by eye. You might be trying to locate a particular chain, narrow the structure to longer chains, or spot chains split into several segments. In SAMSON, the Node Specification Language (NSL) lets you describe those criteria as expressions, so you can search by chain properties instead of relying only on visual inspection.

Chain expressions use the chain attribute space, abbreviated c. That prefix matters: it tells NSL to match chain nodes. The most useful starting point is often the chain ID:

  • c.id 1 matches a chain whose ID is 1.
  • c.id 2:4, 6 matches chains with IDs from 2 through 4, as well as ID 6.
  • c.id <= 3 matches chains whose IDs are no greater than 3.

This is useful when you already know the ID or want to inspect a defined set of chains. Chain IDs here are integers. If what you know is a chain’s name rather than its ID, use the inherited name attribute instead—for example, c.n "A". A name and an ID are different attributes, so choosing the right one avoids a common source of confusion.

Use size to narrow the search

If the structure has many chains, their residue counts can help you focus. For example, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 selects the documented range from 100 to 120. This can be a quick way to distinguish longer chains from short ones when inspecting a complex structure.

Other count attributes answer different questions. Use c.ns for the number of segments: c.ns > 2 matches chains with more than two segments. Use c.nsg for the number of structural groups: c.nsg 10:12 matches chains with between 10 and 12 structural groups. These counts are not interchangeable. If your question is about residues, use c.nr; if it is about segments or structural groups, use their corresponding attributes.

A small, repeatable workflow

  1. Start with what you know. Try a chain ID such as c.id 1, or a name such as c.n "A".
  2. Narrow by a measurable property. Use c.nr 100:120 for a residue-count range, or c.ns < 3 to look for chains with fewer than three segments.
  3. Check the result against the structure. A query identifies nodes that meet the stated attribute condition; it does not explain why a chain has that ID or count. Confirm that the matched chains are the ones you intended to work with.

These examples can also help you understand an unfamiliar structure: query one property at a time and observe which chains match. NSL supports many inherited chain attributes too, including visibility, selection state, atom counts, and partial charge. For example, c.v tests visibility, and c.nat < 1000 tests the number of atoms. The chain reference lists the available attributes and their short names, so you can choose a filter that matches the question you are asking rather than guessing from a label.

For the full 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.

Comments are closed.