Previously, calling refine_assembly on a bam with no aligned reads caused us to write an empty output file manually because GATK would fail in such scenarios. But we forgot to emit an "empty" VCF file as well (causing downstream bcftools invocations in the WDL to fail). And an "empty" VCF file is not actually empty (it has a header). This PR ensures the VCF is written properly in the empty data scenario, and adds to the unit test to cover this.
Previously, calling
refine_assembly
on a bam with no aligned reads caused us to write an empty output file manually because GATK would fail in such scenarios. But we forgot to emit an "empty" VCF file as well (causing downstream bcftools invocations in the WDL to fail). And an "empty" VCF file is not actually empty (it has a header). This PR ensures the VCF is written properly in the empty data scenario, and adds to the unit test to cover this.