Skip to content

Instantly share code, notes, and snippets.

@tkrahn
Created April 15, 2019 16:32
Show Gist options
  • Save tkrahn/484cb64430d5c4cea8a2b86c105318b3 to your computer and use it in GitHub Desktop.
Save tkrahn/484cb64430d5c4cea8a2b86c105318b3 to your computer and use it in GitHub Desktop.
Extracting mtDNA FASTA file from WGS BAM
# mtDNA allele calling $ FASTA file generation
samtools mpileup -r chrM -u -C 50 -v -f ${REF} ${BAMFILE_SORTED} | bcftools call -O z -v -m -P 0 > chrM_${VCF_FILE}.gz
tabix chrM_${VCF_FILE}.gz
samtools faidx $REF chrM | bcftools consensus chrM_${VCF_FILE}.gz -o ${YSEQID}_mtDNA.fasta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment