﻿# ESMFold multichain input: synthetic linkers must not become reported residues

Preserve ESMFold chain separators, synthetic linker masks, residue indexing, and output confidence meaning when exporting predicted protein structures.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-esmfold-chain-linker-output-residue-identity/
Language: en

## A chain separator changes the encoded structure

A structure-processing job may supply several protein chains to ESMFold and expect a file whose residues correspond directly to the input strings. The internal sequence representation can include synthetic positions introduced to express chain structure. Exporting every internal position as an ordinary residue would change the reported molecule.

The [ESM repository](https://github.com/facebookresearch/esm) documents colon-separated multichain input for its original ESMFold interface. This article concerns that implementation rather than every later folding package.

## Linkers and residue indices carry different information

The [sequence encoding helper](https://raw.githubusercontent.com/facebookresearch/esm/main/esm/esmfold/v1/misc.py) splits chains, inserts a linker sequence, constructs a linker mask, and maintains chain metadata. It also adjusts residue indices across chains. These are separate mechanisms: a synthetic connecting segment and an index discontinuity are not the same representation.

An adapter should preserve both the original chain sequences and their correspondence to encoded positions. Input concatenation without the documented chain encoding loses information even when the combined amino-acid string remains valid.

## Follow the mask into output construction

The [ESMFold implementation](https://raw.githubusercontent.com/facebookresearch/esm/main/esm/esmfold/v1/esmfold.py) uses the linker mask in its inference/output path. A custom exporter must retain the distinction between model working positions and real residues instead of inferring chain boundaries solely from array length.

Inspect a short multichain example end to end. Verify chain identifiers, residue counts, and mapping to the original sequences. The [tensor-axis guide](/journal/tensor-axes-batch-sequence-hidden/) explains why an internal sequence axis need not be identical to the final application domain.

## Confidence fields need their model meaning

The original workflow writes predicted confidence information into a structure-file field commonly used for another purpose. Reading that field through a generic structural-analysis library does not turn it into an experimentally measured property.

Preserve a label for the generating model and confidence interpretation with the exported file. A plausible chain arrangement and a confidence summary should not be promoted into experimental verification of a complex or evidence that every interface is accurate.

## Validate export before scaling the job

Compare the documented exporter with any custom conversion using identical model outputs. Check that synthetic positions are absent where required and real residue identities remain recoverable. Record preprocessing and export revisions alongside the checkpoint.

Then apply the [benchmark methodology](/journal/inference-benchmark-method/) to the actual sequence-length distribution. The total encoded length, including internal preprocessing, can matter operationally; raw input character count alone is an incomplete description of the model workload.
