[meta]
name = "shapeit4"
category = "population-genomics"
description = "Statistical method for haplotype phasing of whole-genome sequencing data"
tags = ["phasing", "haplotype", "population-genetics", "gwas", "imputation", "vcf"]
author = "oxo-call built-in"
source_url = "https://odelaneau.github.io/shapeit4/"

[context]
concepts = [
    "SHAPEIT4 phases genotype data (unphased VCF) into haplotypes using statistical methods.",
    "Input: bgzipped and tabix-indexed VCF; optionally a genetic map and a scaffold panel.",
    "Use -I for input VCF; -O for output phased VCF; -R for region; -T for threads.",
    "A genetic map (-M) improves phasing accuracy — download from SHAPEIT4 documentation.",
    "Use --scaffold for a reference haplotype panel (improves accuracy in cosmopolitan populations).",
    "Chromosome-by-chromosome phasing is standard — run separately for each chromosome.",
    "SHAPEIT4 output is a phased VCF with phased genotypes (| separator).",
    "Use --sequencing for sequencing data; --genotyping for array genotype data.",
]

pitfalls = [
    "Input VCF must be bgzipped and tabix-indexed — run bgzip + tabix before SHAPEIT4.",
    "SHAPEIT4 phases one chromosome at a time — use -R to specify chromosome region.",
    "Without a genetic map, phasing accuracy is reduced, especially for distant markers.",
    "SHAPEIT4 requires high-quality variant calls — filter low-confidence variants before phasing.",
    "Phasing is most accurate with large sample sizes (>100 samples).",
]

[[examples]]
task = "phase a chromosome using SHAPEIT4"
args = "--input variants.vcf.gz --map genetic_map_chr1.txt --region chr1 --output phased_chr1.vcf.gz --thread 8"
explanation = "--input unphased VCF; --map genetic map for chr1; --region restricts to chr1; --output phased VCF"

[[examples]]
task = "phase with a reference haplotype scaffold panel"
args = "--input variants.vcf.gz --scaffold reference_panel.vcf.gz --map genetic_map_chr22.txt --region chr22 --output phased_chr22.vcf.gz --thread 8"
explanation = "--scaffold reference panel improves phasing; often used with 1000 Genomes or HGSVC panel"

[[examples]]
task = "phase sequencing data with higher accuracy settings"
args = "--input variants.vcf.gz --map genetic_map.txt --region chr1 --sequencing --output phased.vcf.gz --thread 16 --mcmc-iterations 8b,1p,1b,1p,1b,1p,5m"
explanation = "--sequencing mode for WGS data; --mcmc-iterations for convergence tuning"
