A pipeline for detecting mitochondrial homoplasmies and heteroplasmies from sequencing data.
- Detects homoplasmies and heteroplasmies in mitochondria
- Supports short paired and long reads
- Multiple SNV callers
- Runs 2 iterations: the first uses a standard reference, the second uses the sample consensus sequence
- Handles NUMTs and origin regions carefully
- Supports human and mouse genomes, with multiple reference versions
- Allows multiple heteroplasmy thresholds
- Calls maternal haplogroup , consensus sequence
- Detects sample contamination
- Processes multiple samples in parallel and combines results
- Provides detailed output summaries
- Optimized for low CPU, memory, and runtime usage
If you use this pipeline, please cite:
Battle et al., NAR 2022: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9112767/
For additinal information please check (MitoHPC v1)[https://github.com/dpuiu/MitoHPC]
- Prerequisites
- Input
- Input
- Installation
- Setup environment
- Running the Pipeline
- Output & Evaluation
- Examples
The pipeline requires the following tools:
-
bwa 0.7.17, minimap2 2.28, htslib 1.21, samtools 1.21, bcftools 1.21, bedtools 2.31.1, fastp 0.24.0, samblaster 0.1.26, GATK Mutect2 4.6.0.0, mutserve 2.0.0-rc15, freebayes 1.3.6, VarScan 2.4.6, Clair3 1.2.0, ClairS-TO 0.4.2, DeepVariant 1.10.0-beta, DeepSomatic 1.9.0, GRIDSS 2.13.2, Haplogrep 2.4.0, Haplocheck 1.3.3, plink2 2.0
Reference Genomes:
- Default: hg38
- Setting available in scripts/init.sh
The pipeline expects pre-aligned, coordinate sorted reads:
- File formats:
.bamor.cram - Sequencing platforms: Illumina paired-end, PacBio HiFi, Oxford Nanopore (ONT) Dorado R9+
- Index files:
.baior.crai - Indexstats files:
.idxstats: contain the number of reads aligned to each chromosome
count.tab– total reads & mtDNA-CNcvg.tab– coverage stats
snvcaller.*.vcf– SNVs at multiple heteroplasmy levelsnvcaller.*.tab/.summary/.pos– SNV counts & summariessnvcaller.fa– consensus sequencesnvcaller.haplogroup.tab– maternal haplogroupsnvcaller.haplocheck.tab– contamination check
snvcaller.snvcaller.*– final results
- snvcaller is usuall mutect2(Illumina), deepsomatioc (PacBio hifi), clairs-to (ONT)
git clone https://github.com/dpuiu/MitoHPC2.gitcd MitoHPC2/
git pull
# or
git checkout .cd MitoHPC2/scripts
export HP_SDIR=`pwd` # set script directory
echo "export HP_SDIR=`pwd`" >> ~/.bashrc # add variable to .bashrc
. ./init.sh # or init.{hs38DH,hg19,mm39}.sh for different referencessudo $HP_SDIR/install_sysprerequisites.sh # installs perl, python, java, wget, etc.$HP_SDIR/install_prerequisites.sh # installs bwa, samtools, bedtools, etc.
# or force latest versions
$HP_SDIR/install_prerequisites.sh -fList and download pre-built Singularity images to $HP_BDIR:
curl -s ftp://ftp.ccb.jhu.edu/pub/dpuiu/Homo_sapiens_mito/MitoHPC2/bin/
# example files:
# clair3_v1.2.0.sif
# clairs-to_v0.4.2.sif
# deepsomatic_1.9.0.sif
# deepvariant_1.10.0-beta.sif
curl -LO ftp://ftp.ccb.jhu.edu/pub/dpuiu/Homo_sapiens_mito/MitoHPC2/bin/clairs-to_v0.4.2.sif
curl -LO ftp://ftp.ccb.jhu.edu/pub/dpuiu/Homo_sapiens_mito/MitoHPC2/bin/deepsomatic_1.9.0.sifConvert to sandbox for faster execution:
singularity build --sandbox ~/clairs-to_sandbox/ $HP_BDIR/clairs-to.sif
singularity build --sandbox ~/deepsomatic_sandbox/ $HP_BDIR/deepsomatic.sif
du -hs ~/clairs-to_sandbox/ ~/deepsomatic_sandbox/- The pipeline uses
MitoHPC2/RefSeq/*.{vcf,bed}.gzfor annotation. - Copy any custom VCF/BED files to
MitoHPC2/RefSeq/. - Ensure files are bgzipped and indexed.
$HP_SDIR/checkInstall.sh
cat checkInstall.log"Success message!" expected
nano scripts/init.sh # check/edit local init file
...
export HP_O=Human # organism
export HP_MT=chrM
export HP_MTLEN=16569
export HP_RNAME=hs38DH # reference assembly used for alignment (Ex: hs38DH, hg19)
export HP_RMT=chrM # MT sequence name
export HP_RNUMT="chr1:629084-634672 ..." # NUMT regions to be considered
export HP_RURL=https://hgdownload..." # URL location (if needed to be downloaded)
export HP_IN=$PWD/in.txt # input TSV file, contains sample names, file paths (automatically generated by runnng ". ./init.sh")
export HP_ADIR=$PWD/bams/ # pre-existing alignment dir; contains .bam, .bai, [.idxstats] files, or
export HP_ADIR=$PWD/crams/ # .cram, .crai, [.idxstats] files
export HP_ODIR=$PWD/out/ # output dir
export HP_L=222000 # Use at most 222K reads (random subsampling; ~2K cvg of MT for 150bp reads); if empty, use all the reads
export HP_M=mutect2 # SNV caller: mutect2, mutserve, or freebayes
export HP_I=2 # number of SNV calling iterations
# 1: one, uses rCRS or RSRS as reference
# 2: two, the 2nd one used the sample consensus
# computed in the 1st iteration; higher accuracy
export HP_T1=03 # heteroplasmy thold 1: 3%
export HP_T2=05 # heteroplasmy thold 2: 5%
export HP_T3=10 # heteroplasmy thold 3: 10%
export HP_SH=bash # job scheduling: bash, qsub,sbatch, ...
...
# difference compared to scripts/init.sh
nano scripts/init3.sh
...
export HP_M=
export HP_M1=mutect2
export HP_M2=varscan
export HP_M3=freebayes
export HP_M=merge3
...
# difference compared to scripts/init.sh
nano scripts/init.hifi.sh
...
export HP_L=4000 # maximum number of alignments sampled
export HP_M=deepsomatic # SNV caller: deepsomatic, clairs-to ... varscan,bcftools,clair3,deepvariant
export HP_MODELTYPE="PACBIO_TUMOR_ONLY" # deepsomatic:WGS,WES,PACBIO,ONT,FFPE_WGS,FFPE_WES,WGS_TUMOR_ONLY,PACBIO_TUMOR_ONLY,ONT_TUMOR_ONLY
export HP_MINLEN=6000 # min total alignment (> longest NUMT)
export HP_MINPC="0.95" # min alignment coverage
export HP_MAXDP=2000 # max depth
export HP_MINAF=0.05 # min AF
...
# difference compared to scripts/init.sh , scripts/init.hifi.sh
nano scripts/init.ont.sh
...
export HP_M=clairs-to # SNV caller: varscan,...
export HP_PLATFORM="ont_r10_dorado_sup_5khz" # clairs-to {ont_r10_dorado_sup_4khz, ont_r10_dorado_hac_4khz, ont_r10_dorado_sup_5khz, ont_r10_dorado_sup_5khz_ss, ont_r10_dorado_sup_5khz_ssrs
...
cp $HP_SDIR/init.sh .
nano ./init.sh
. ./init.sh
$HP_SDIR/run.sh | tee run.all.sh | bashcp $HP_SDIR/init3.sh .
nano ./init3.sh
. ./init3.sh
$HP_SDIR/run3.sh | tee run.all.sh | bashcp $HP_SDIR/init.hifi.sh .
nano ./init.hifi.sh
. ./init.hifi.sh
$HP_SDIR/run.lr.sh | tee run.all.sh | bashcp $HP_SDIR/init.ont.sh .
nano ./init.ont.sh
. ./init.ont.sh
$HP_SDIR/run.lr.sh | tee run.all.sh | bashls $HP_ODIR/.*- Compare results to Illumina mutect2 (T=10):
$HP_SDIR/eval.sh Illumina/out/mutect2.10.concat.vcf $HP_M.10.concat.vcf | uniq.pl | column -t > $HP_M.10.eval- Download example files via FTP
- 500x cvg of Illumina paired end reads (2*150bp) were simulated using the best HiFi10 raeds (avg Q30)
- commands: wgsim -N 22200 -1 150 -2 150 -d 300 -e 0 -r 0 -R 0
- There reads were processed using the MitoHPC2 pipeline ("mutect2" SNV caller) 10.10
- 500x cvg of Illumina paired end reads (2*150bp) were simulated using the best ONT10 raeds (avg Q20)
- commands: wgsim -N 22200 -1 150 -2 150 -d 300 -e 0 -r 0 -R 0
- There reads were processed using the MitoHPC2 pipeline ("mutect2" SNV caller) 10.10
Note: 1st number: short read heteroplasmy thold; 2nd: long read heteroplasmy thold