Find the right molecular chain without searching atom by atom

In a large molecular structure, the hard part is often not finding an atom—it is narrowing the model down to the chain that matters. You may know a chain by its ID, approximate length, or number of segments, but scanning a crowded structure or checking chains one at a time can be tedious. SAMSON’s Node Specification Language (NSL) lets you describe those criteria directly at the chain level.

Chain queries use the chain attribute space, abbreviated c. This matters: these expressions match chain nodes, rather than individual atoms. You can write an attribute with its full name, such as chain.numberOfResidues > 100, or use the shorter form, c.nr > 100.

Start with a chain ID

If you already know the chain ID, use chainID, whose short name is id. For example, c.id 1 matches a chain with ID 1. To describe more than one ID or a range, the documented syntax includes c.id 2:4, 6. That expression matches IDs from 2 through 4, as well as ID 6.

This is useful when you need to focus on a known chain or a small set of chains in a multi-chain model. One practical check: the chain ID attribute is documented as accepting integers, so use the integer values available in your structure rather than assuming every chain identifier format is supported.

Use size as a clue

When you do not know the ID, chain size can help narrow the search. The numberOfResidues attribute has the short name nr. For instance, c.nr > 100 matches chains with more than 100 residues, while c.nr 100:120 specifies a range.

Other counts can help describe a chain in a different way:

  • c.ns < 3 looks for chains with fewer than three segments.
  • c.nsg > 10 looks for chains with more than ten structural groups.
  • c.nat < 1000 uses the inherited number-of-atoms attribute.

These measurements answer different questions. Residue count is a useful length-based clue; segment and structural-group counts give other ways to distinguish chains; atom count describes the chain at the atom level. Choose the attribute that reflects what you actually know about the model, rather than treating the counts as interchangeable.

Know what the prefix is telling you

The chain attribute space also inherits attributes from the broader node and structuralGroup spaces. For example, c.n refers to the chain’s name, while c.fc and c.pc refer to formal and partial charge. Structural counts such as c.nC and c.nO represent numbers of carbons and oxygens. These inherited attributes can help describe a chain using information beyond its ID or length.

Some inherited attributes concern display or state rather than molecular composition: c.v checks visibility, c.h checks whether a chain is hidden, and c.selected checks selection state. The chain page notes that selected has no short name in this attribute space, so use the full form.

A simple way to build a useful query

Begin with the clue you trust most: an ID, residue count, or segment count. Use one expression to test that criterion, then refine your search with another relevant chain attribute if needed. Keeping the criteria explicit makes a query easier to read, reuse, and check later. The examples above use the short c prefix, but the corresponding full attribute names are available too.

For the complete chain attribute reference and more examples, see the SAMSON chain NSL documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.