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