Merge branch '19868-pca-in-ml' into main
[lightning.git] / cwl / gvcf2fasta / src / bcftools-consensus.sh
1 #!/bin/bash
2 # Copyright (C) The Lightning Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 set -eo pipefail
7
8 sampleid="$1"
9 vcf="$2"
10 ref="$3"
11 mask="$4"
12
13 haplotypes=(1 2)
14
15 for haplotype in ${haplotypes[@]}; do
16   bcftools consensus --fasta-ref $ref --haplotype $haplotype --mask $mask $vcf | bgzip -c > "$sampleid"."$haplotype".fa.gz
17 done