bcftools annotate multi-allelic weird behavior

Open
#907 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Reproduce the report with the two VCF examples and the shown bcftools annotate command, comparing the long multi-allelic ALT values with the version where the final allele is G. Start by locating the annotate allele-matching path and add a regression case for these inputs; done means the final two annotations remain 9 and 10 rather than both becoming 9.

Written by the indexing model from the issue text.

Description

hw-dependent

Hi,

I have spotted a weird behaviour when annotating some multi-allelic variants with bcftools annotate (v1.9).

Let say I have an external vcf containing the annotations Annot1 and Annot2 for a multi-allelic of 10 alternate alleles :

##fileformat=VCFv4.2
##INFO=<ID=Annot1,Number=A,Type=Integer,Description="Annot1">
##INFO=<ID=Annot2,Number=A,Type=Integer,Description="Annot2">
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
1	123456	.	C	CTA,CTATA,CTATATA,CTATATATA,CTATATATATA,CTATATATATATA,CTATATATATATATA,CTATATATATATATATA,CTATATATATATATATATA,CTATATATATATATATATA	.	.	Annot1=1,2,3,4,5,6,7,8,9,10;Annot2=1,2,3,4,5,6,7,8,9,10

This is the original vcf I want to annotate:

##fileformat=VCFv4.2
##contig=<ID=1,length=249250621,assembly=b37>
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes, for each ALT allele, in the same order as listed">
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
1	123456	.	C	CTA,CTATA,CTATATA,CTATATATA,CTATATATATA,CTATATATATATA,CTATATATATATATA,CTATATATATATATATA,CTATATATATATATATATA,CTATATATATATATATATA	.	.	AC=1,2,3,4,5,6,7,8,9,10

I use then the command
bcftools annotate -a annotation.vcf.gz -c Annot1,Annot2 original.vcf.gz
and I obtain this

1	123456	.	C	CTA,CTATA,CTATATA,CTATATATA,CTATATATATA,CTATATATATATA,CTATATATATATATA,CTATATATATATATATA,CTATATATATATATATATA,CTATATATATATATATATA	.	.	AC=1,2,3,4,5,6,7,8,9,10;Annot1=1,2,3,4,5,6,7,8,9,9;Annot2=1,2,3,4,5,6,7,8,9,9

So that I have 2 "9" in my annotations instead of 9,10 for the last 2 alleles.

Surprisingly if I rename the last allele from CTATATATATATATATATA to G in both my annotations and original vcf files I obtain the right result :

1	123456	.	C	CTA,CTATA,CTATATA,CTATATATA,CTATATATATA,CTATATATATATA,CTATATATATATATA,CTATATATATATATATA,CTATATATATATATATATA,G	.	.	AC=1,2,3,4,5,6,7,8,9,10;Annot1=1,2,3,4,5,6,7,8,9,10;Annot2=1,2,3,4,5,6,7,8,9,10

Could you explain why the behavior of the annotation command changes regarding the allele name ?

Best,

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.