-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The command `convert --gvcf2vcf` was not filling the REF allele when BCF was output because VCF API was not used, the alleles were rewritten directly. That works for VCF, but not BCF output. Fixes #243, finally
- Loading branch information
Showing
3 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* vcfconvert.c -- convert between VCF/BCF and related formats. | ||
Copyright (C) 2013-2023 Genome Research Ltd. | ||
Copyright (C) 2013-2024 Genome Research Ltd. | ||
Author: Petr Danecek <[email protected]> | ||
|
@@ -1583,6 +1583,7 @@ static void gvcf_to_vcf(args_t *args) | |
char *ref = faidx_fetch_seq(args->ref, (char*)bcf_hdr_id2name(hdr,line->rid), line->pos, line->pos, &len); | ||
if ( !ref ) error("faidx_fetch_seq failed at %s:%"PRId64"\n", bcf_hdr_id2name(hdr,line->rid),(int64_t) line->pos+1); | ||
strncpy(line->d.allele[0],ref,len); | ||
bcf_update_alleles(hdr,line,(const char**)line->d.allele,line->n_allele); | ||
if ( bcf_write(out_fh,hdr,line)!=0 ) error("[%s] Error: cannot write to %s\n", __func__,args->outfname); | ||
free(ref); | ||
} | ||
|