From 3e0ea1b872b80136039b8fab230d24ae74977ae4 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Tue, 23 Jan 2024 14:02:44 +0100 Subject: [PATCH] output header for empty VCFs --- data/test1.delly.empty.vcf | 46 ++++++++++++++++++++++++++++++++++++++ svync_api/execute.go | 5 +++++ 2 files changed, 51 insertions(+) create mode 100644 data/test1.delly.empty.vcf diff --git a/data/test1.delly.empty.vcf b/data/test1.delly.empty.vcf new file mode 100644 index 0000000..1f86684 --- /dev/null +++ b/data/test1.delly.empty.vcf @@ -0,0 +1,46 @@ +##fileformat=VCFv4.2 +##FILTER= +##fileDate=20231204 +##ALT= +##ALT= +##ALT= +##ALT= +##ALT= +##FILTER= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##reference=reference.fasta +##contig= +##contig= +##contig= +#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT PosCon1 \ No newline at end of file diff --git a/svync_api/execute.go b/svync_api/execute.go index fc28462..fbbd396 100644 --- a/svync_api/execute.go +++ b/svync_api/execute.go @@ -91,6 +91,11 @@ func Execute(Cctx *cli.Context, config *Config) { } } + if !headerIsMade { + writeHeader(config, Cctx, header, outputFile, stdout) + headerIsMade = true + } + } // readBgzipLine reads a line from a bgzip file