﻿# RFdiffusion contigs distinguish source residues, generated lengths, and chain breaks

Interpret RFdiffusion contig maps as structured residue constraints, preserve sampled lengths and chain breaks, and retain source-to-output motif correspondence.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-rfdiffusion-contig-source-generated-residue-map/
Language: en

## A contig is more than a requested sequence length

A scaffold-generation experiment may specify a known motif surrounded by new backbone segments. The input must describe which residues come from the source structure and which positions are to be generated. Collapsing that description into a total length loses the distinction the model needs.

The [RFdiffusion guide](https://github.com/RosettaCommons/RFdiffusion) documents contig syntax for its original workflow. Keep that syntax tied to the actual parser and configuration revision used by the job.

## Source segments and generated spans use different meanings

Letter-prefixed segments refer to source-chain residues, while unprefixed length specifications describe generated segments in the documented interface. A range for a generated span can be sampled, so repeated jobs can expand the same specification into different concrete layouts.

Store the expanded layout with each design. Otherwise a downstream tool may assume that an output position identifies the same source residue across all candidates, even though preceding generated spans have different lengths.

## Chain breaks are structural metadata

The [contig mapper implementation](https://raw.githubusercontent.com/RosettaCommons/RFdiffusion/main/rfdiffusion/contigs.py) constructs mappings between source residues, output positions, and model indices. Its chain-break handling is part of that transformation, not a cosmetic separator in the final filename.

A wrapper that normalizes or splits contig text without respecting the documented syntax can change its interpretation. Preserve the exact parsed specification and inspect a small expansion before scaling. The [span-integrity guide](/journal/data-guide-unicode-normalization-span-integrity/) illustrates why seemingly harmless text transformations can damage coordinate correspondence.

## Configuration selects the actual computation

The [base inference configuration](https://raw.githubusercontent.com/RosettaCommons/RFdiffusion/main/config/inference/base.yaml) separates inference, contig, and diffusion settings. A saved command fragment alone may omit inherited configuration and checkpoint choices.

Retain the resolved configuration rather than only manual overrides. When comparing designs, distinguish changes in length sampling, source motif selection, and model conditions. Those changes define different experiments, even when a shared output naming scheme groups them together.

## Verify correspondence before downstream scoring

Map the reported motif back to the source structure and check the intended residue identities and chain relationships. Keep the generated-region map available to sequence-design and structural-analysis stages instead of asking them to infer it from residue numbers.

The [artifact validation guide](/journal/safetensors-artifact-validation/) motivates this linked provenance. A correctly mapped computational scaffold remains a candidate for further investigation; contig validity alone does not prove experimental folding or biological function.
