Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gvcf2vcf not filling in REF allele correctly #243

Closed
mcshane opened this issue Apr 22, 2015 · 4 comments · Fixed by #244
Closed

gvcf2vcf not filling in REF allele correctly #243

mcshane opened this issue Apr 22, 2015 · 4 comments · Fixed by #244

Comments

@mcshane
Copy link
Contributor

mcshane commented Apr 22, 2015

When fixing #242 noticed that gvcf2vcf is just copying the REF allele from the beginning of the block. Command needs to take a reference fasta as input to fill in REF correctly.

@jmarshall
Copy link
Member

Nice catch.

There is a -f/--fasta-ref option that fills in args.ref_fname and args.ref for convert --tsv2vcf. So that can be reused for --gvcf2vcf (and possibly some of the code refactored and moved to destroy_data() etc).

mcshane added a commit to mcshane/bcftools that referenced this issue Apr 22, 2015
* when filling in gvcf reference blocks need the
  samtools faidx indexed reference fasta to fill in
  the REF allele for each POS. reuse the `--fasta-ref`
  option already used by `--tsv2vcf`
* updated the test and test files to use the new option
* add new option to the man page

Fixes samtools#243
mcshane added a commit to mcshane/bcftools that referenced this issue Apr 22, 2015
* when filling in gvcf reference blocks need the
  samtools faidx indexed reference fasta to fill in
  the REF allele for each POS. reuse the `--fasta-ref`
  option already used by `--tsv2vcf`
* updated the test and test files to use the new option
* add new option to the man page

Fixes samtools#243
mcshane added a commit to mcshane/bcftools that referenced this issue Apr 22, 2015
* when filling in gvcf reference blocks need the
  samtools faidx indexed reference fasta to fill in
  the REF allele for each POS. reuse the `--fasta-ref`
  option already used by `--tsv2vcf`
* updated the test and test files to use the new option
* add new option to the man page

Fixes samtools#243
@ryhui
Copy link

ryhui commented Dec 4, 2018

Hello, I just found out that this is fixed with uncompressed and compressed vcf output. If I use -Ou or -Ob, the REF allele is still copied from the beginning of the block.

@gtbil
Copy link

gtbil commented Nov 19, 2024

The issue ryhui indicated is still a problem. The workaround is to write to VCF rather than BCF.

pd3 added a commit that referenced this issue Dec 3, 2024
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
@pd3
Copy link
Member

pd3 commented Dec 3, 2024

The BCF output is now fixed, finally. Thanks for reporting the bug, better to open a new issue next time, commenting on closed issues gets easily overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants