INNER CODE UNIT · Python

correct_vj

antigenomics/vdjtools · python/vdjtools/cli/__init__.py:345

def correct_vj(
    samples: list[Path] = typer.Argument(..., help="Two or more clonotype sample files, one per sample."),
    batches: str = typer.Option(..., "--batches", "-b", help="Comma-separated batch label per sample, in the same order as the files; or a TSV with sample_id/batch columns."),
    fmt: str = _FMT,
    outdir: Optional[Path] = typer.Option(None, "--outdir", help="Write one corrected clonotype table per sample here. Without it only the usage table is written."),
    usage_out: Optional[Path] = typer.Option(None, "--usage-out", help="Write the per-sample corrected V/J usage table here."),
    transform: str = typer.Option("location", "--transform", help="'location' (ComBat location term) or 'sigmoid' (sigma-standardised z-score, Vlasova et al. 2026)."),
    scope: str = typer.Option("vj", "--scope", help="Correction key: vj | v | j."),
    z_cap: float = typer.Option(6.0, "--z-cap", help="With --transform sigmoid: cap |Z| at this."),
    winsor_q: Optional[float] = typer.Option(None, "--winsor-q", help="Winsorize the per-batch mean/sigma at this quantile. Default off, matching the published method; 0.025 is a robustness setting for shallow/RNA-seq repertoires."),
    unweighted: bool = typer.Option(False, "--unweighted", help="Count clonotypes rather than reads when building usage."),
    rescale: bool = typer.Option(False, "--rescale", help="Deterministically rescale instead of roulette-wheel resampling."),
    seed: int = typer.Option(0, "--seed", help="Seed for the resample."),
) -> None:
    """Batch-correct V/J gene usage across samples, and optionally rewrite the clonotype tables.

    Different batches carry systematic V/J usage bias (primer mixes, amplification, extraction).
    Two transforms:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…