diff --git a/CHANGELOG.md b/CHANGELOG.md index a19aca4..6062409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.1.2 - Adjust +## Fixes +- Fixed a bug where the output VCF has no header when the input VCF has no variants + + # 0.1.1 - Transform ## Fixes - Fixed a bug where the samples were missing from the header 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.go b/svync.go index b360c81..b986b70 100644 --- a/svync.go +++ b/svync.go @@ -13,7 +13,7 @@ func main() { Name: "svync", Usage: "A tool to standardize VCF files from structural variant callers", HideHelpCommand: true, - Version: "0.1.1", + Version: "0.1.2", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "nodate", 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