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

bcftools annotate -x INFO does not remove INFO/END when output set in binary mode #1483

Closed
freeseek opened this issue May 7, 2021 · 1 comment

Comments

@freeseek
Copy link
Contributor

freeseek commented May 7, 2021

Generate the following VCF file:

(echo "##fileformat=VCFv4.1"
echo "##contig=<ID=1,assembly=b37,length=249250621>"
echo "##ALT=<ID=CN2,Description=\"Copy number allele: 2 copies\">"
echo "##INFO=<ID=END,Number=1,Type=Integer,Description=\"End coordinate of this variant\">"
echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"
echo -e "1\t668630\t.\tG\t<CN2>\t.\t.\tEND=850204") > in.vcf

Then the following commands output the variant:

$ bcftools annotate --no-version -x INFO -Ob -o in.bcf in.vcf
$ bcftools index -f in.bcf
$ bcftools view --no-version -H -r 1:850204-850204 in.bcf
1	668630	.	G	<CN2>	.	.	.

While the following commands output nothing:

$ bcftools annotate --no-version -x INFO -Oz -o in.vcf.gz in.vcf
$ bcftools index -f in.vcf.gz
$ bcftools view --no-version -H -r 1:850204-850204 in.vcf.gz

Similarly, when using INFO/END rather than INFO the output is empty again:

$ bcftools annotate --no-version -x INFO/END -Ob -o in.bcf in.vcf
$ bcftools index -f in.bcf
$ bcftools view --no-version -H -r 1:850204-850204 in.bcf

My guess is that, when bcftools annotate -x INFO is used, the command forgets to set the line->rlen field to the length of the reference allele.

@pd3 pd3 closed this as completed in 1c3c0a9 May 20, 2021
@pd3
Copy link
Member

pd3 commented May 20, 2021

Thank you for the bug report, this is now fixed.

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

No branches or pull requests

2 participants