#!/bin/bash -Ceuo pipefail
echo "HCC1395_tumor" > sample_name.list
bcftools \
mpileup \
--fasta-ref Homo_sapiens_assembly38.fasta \
\
HCC1395_tumor.recalibrated.bam \
-T SNP_GRCh38_hg38_wChr.bed \
\
| bcftools call --output-type v --no-version --ploidy 1 -c \
| bcftools reheader --samples sample_name.list \
| bcftools view --output-file HCC1395_tumor.ngscheckmate.vcf.gz --output-type z --no-version
tabix -p vcf -f HCC1395_tumor.ngscheckmate.vcf.gz
bcftools stats HCC1395_tumor.ngscheckmate.vcf.gz > HCC1395_tumor.ngscheckmate.bcftools_stats.txt
cat <<-END_VERSIONS > versions.yml
"NFCORE_SAREK:SAREK:CRAM_SAMPLE_INTEGRITY:BAM_NGSCHECKMATE:BCFTOOLS_MPILEUP":
bcftools: $(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*$//')
END_VERSIONS