Skip to content

module adabmDCA.api.reintegration

High-level orchestration for experimental sequence reintegration.


function reintegrate_model

reintegrate_model(
    natural_alignment: 'AlignmentInput',
    experimental_alignment: 'AlignmentInput',
    adjustments: 'WeightInput',
    config: 'TrainingConfig | None' = None,
    natural_weights: 'WeightInput | None' = None,
    lambda_value: 'float | None' = None,
    output_dir: 'str | Path | None' = None,
    label: 'str | None' = None,
    initial_params_path: 'str | Path | None' = None,
    initial_chains_path: 'str | Path | None' = None,
    ptt_resume: 'str | Path | None' = None,
    progress: 'Callable[[TrainingProgress], None] | None' = None,
    stage_progress: 'Callable[[StageProgress], None] | None' = None,
    on_initialized: 'Callable[[TrainingInitialization], None] | None' = None,
    is_cancelled: 'Callable[[], bool] | None' = None
) → ReintegrationResult

Train a model on natural sequences plus experimentally scored ones.

Experimental sequences enter the training statistics with signed weights proportional to their adjustments: positive values pull the model towards a sequence, negative values push it away. The experimental weights are scaled by lambda_value * Meff / n_experimental, so lambda_value sets the weight of the experimental data relative to the natural alignment. Training uses PTT when config.ptt is set, and PCD otherwise.

Args:

  • natural_alignment: Natural sequences (path, Alignment or sequences).
  • experimental_alignment: Tested sequences, aligned like the natural ones.
  • adjustments: One signed score per experimental sequence (path, array or sequence of numbers), e.g. +1 for functional and -1 for non-functional.
  • config: Training settings; defaults to TrainingConfig() (PCD); set ptt=PTTConfig() to train with PTT. A pseudocount of 1e-6 (0.1 for edgeDCA) is used unless set.
  • natural_weights: Optional weights of the natural sequences; computed by sequence-identity reweighting otherwise.
  • lambda_value: Relative weight of the experimental data; defaults to 1 / max(|adjustments|).
  • output_dir: If given, training files and the combined alignment are written there.
  • label: File-name prefix; the written label is <label>-lambda_<value>.
  • initial_params_path: Optional parameter file to start from.
  • initial_chains_path: Optional FASTA of starting chains.
  • ptt_resume: Optional PTT archive of an interrupted reintegration run with the same data and settings.
  • progress: Optional callback receiving a TrainingProgress per update.
  • stage_progress: Optional callback for transient PTT stage updates.
  • on_initialized: Optional callback receiving the TrainingInitialization.
  • is_cancelled: Optional callable; returning True stops training.

Returns: A ReintegrationResult with the training result, the combined alignment and its weights.

Raises:

  • InputValidationError: If all adjustments are zero, lambda_value is not positive, or the alignments are incompatible.

This file was automatically generated via lazydocs.