| Schmutzi Pipeline |
| ##STEP 1: Sample preparation using BWA and SAMtools## |
| #1a: Align FASTQ sample to reference fasta and create a SAM file |
| bwa aln MT_reference_file input_file.fastq > input_file.sai |
| bwa samse MT_reference_file input_file.sai input_file.fastq > output_file_MTaligned.sam |
| #1b (optional): Realignment to mtDNA reference by CircularMapper (automatic conversion to BAM) |
| java -jar realign-1.93.5.jar -e 500 -i output_file_MTaligned.sam -r MT_reference_file.fa |
| #1c: Sort BAM file (use aligned BAM file derived in previous step) |
| samtools sort output_file_MTaligned _CM_realigned.bam -o output_file_MTaligned _CM_realigned_sort.bam |
| #1d: MD-Tagging (use aligned and sorted BAM file derived in previous step) |
| samtools calmd -b output_file_MTaligned _CM_realigned_sort.bam MT_reference_file.fa > output_file_MTaligned _CM_realigned_sort_MD.bam |
| #1e: Index the MD-tagged BAM file |
| samtools index output_file_MTaligned _CM_realigned_sort_MD.bam |
| ##STEP 2: Estimate endogenous deamination using contDeam## |
| contDeam.pl --library double --out output_name output_file_MTaligned _CM_realigned_sort_MD.bam |
| ##STEP 3: Estimate contamination and call the (unfiltered) consensus sequence using schmutzi## |
| #3a: First run the iterative procedure without the prediction of the contaminant |
| schmutzi.pl --notusepredC --uselength --ref MT_reference_file.fa --out output_name_npred freqs output_name output_file_MTaligned _CM_realigned_sort_MD.bam |
| #3b: Then repeat the above with the prediction of the contaminant |
| schmutzi.pl --uselength --ref MT_reference_file.fa --out output_name_npred freqs output_name output_file_MTaligned _CM_realigned_sort_MD.bam |
| ##STEP 4: Apply filtering in the consensus sequence derived in the previous step using log2fasta## |
| #Use the log file created via running the schmutzi application to filter by base Q-score (in this case discards bases with Q-score below 10-repeat with different cut-offs) |
| log2fasta -q 10 output_name_npred_final_endo.log > output_name_filtered_schmu_q10.fasta |
| ANGSD Pipeline |
| ##STEP 1: Sample preparation using SAMtools## |
| #1a: check whether the input BAM file is sorted |
| samtools stats input_file.bam | grep “is sorted:” |
| #1b: create a BAM index file (BAI) |
| samtools index input_file.bam input_file.bai |
| #1c: Isolate the MT chromosome as a separate BAM file (this step will not be needed if the mitocapture BAM file is available) |
| samtools view -b input_file.bam MT > input_file_MT.bam |
| ##STEP 2: Call the consensus sequence using ANGSD (no filtering)## |
| #2a: Call the mitogenome consensus sequence from the MT BAM file (option 1: use the most common base) |
| angsd -out output_file -i input_file.bam -doFasta 2 -doCounts 1 |
| #2b (optional): Call the mitogenome consensus sequence from the MT BAM file (option 2: use the base with the highest effective depth-EBD) |
| angsd -out output_file -i input_file.bam -doFasta 3 |
| ##STEP 3: Call the consensus sequence using ANGSD (with filtering)## |
| #3a: Call the mitogenome consensus sequence from the MT BAM file (option 1) and filter by trimming the first/last 1 base of each read (in this case trims first/last base of each read-repeat by setting different n of bases to be trimmed) |
| angsd -out output_file -i input_file.bam -doFasta 2 -doCounts 1 -trim 1 |
| #3b: Call the mitogenome consensus sequence from the MT BAM file (option 1) and filter by trimming the first/last 1 base of each read and setting minimum base quality to 10 (in this case discards base quality below 10-repeat with different cut-offs) |
| angsd -out output_file -i input_file.bam -doFasta 2 -doCounts 1 -trim 1 -minQ 10 |
| HaploGrep |
| #mtDNA Haplogroup prediction using Haplogrep 2, based on the fasta sequence files derived in the above pipelines |
| haplogrep classify --extend-report --format fasta --in output_file.fasta --out output_file.txt |