Should a variant allele for an overlapping deletion always be variant type VCF_REF ?

Open
#817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start in vcf.c at bcf_set_variant_types around lines 3199-3258 and reproduce the supplied VCF with bcftools norm and query. Check the handling of '*' alleles with multi-base REF values, then inspect related issue #736 and existing variant-type tests. Done means the intended VCF_REF classification is decided and covered by a regression test or the behavior is documented as correct.

Written by the indexing model from the issue text.

Description

htslib-dependent

It seems that missing ALT alleles due to overlapping deletions are given different bcf variant types, based on the REF allele.

If the reference allele is a single nucleotide, the variant type is VCF_REF, if the reference allele is longer, the variant type is VCF_OTHER. Can VCF_REF variants cover more than one reference base?

My guess is that VCF_SNP is set for variants with single-nucleotide REF, '*' ALT alleles on line 3206 of bcf_set_variant_types.

If REF is longer than 1 character, the if on L3202 fails, leaving VCF_OTHER to be set on L3245.

https://github.com/samtools/htslib/blob/71b00a897bb9d6b6973c6bef2a2476f92f7a04d3/vcf.c#L3199-L3258

Related, #736 .

Example below


Given the input vcf:

##fileformat=VCFv4.3
##reference=ftp://ftp.1000genomes.ebi.ac.uk//vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
##contig=<ID=1,assembly=b37,length=249250621>
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
1	934151	.	C	CGCGGAGCGAGAGCGGAGCGGAGCGGAGCGGA	.	PASS	.
1	934155	.	GAGC	G,*	.	PASS	.
1	934158	.	C	*,G	.	PASS	.
1	934162	.	G	GCGGA	.	PASS	.
1	934164	.	G	A,GA,*	.	PASS	.
1	934180	.	C	G	.	PASS	.

I split all multiallelics to biallelic.

$bcftools norm -m -any -N -o split.vcf in.vcf
Lines   total/split/realigned/skipped:	6/3/0/0

...
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
1	934151	.	C	CGCGGAGCGAGAGCGGAGCGGAGCGGAGCGGA	.	PASS	.
1	934155	.	GAGC	G	.	PASS	.
1	934155	.	GAGC	*	.	PASS	.
1	934158	.	C	*	.	PASS	.
1	934158	.	C	G	.	PASS	.
...

And printed the variant types

$bcftools query -H -f '%CHROM\t%POS\t%REF\t%ALT\t%TYPE\n' split.vcf 
# [1]CHROM	[2]POS	[3]REF	[4]ALT	[5]TYPE
1	934151	C	CGCGGAGCGAGAGCGGAGCGGAGCGGAGCGGA	INDEL
1	934155	GAGC	G	INDEL
1	934155	GAGC	*	OTHER
1	934158	C	*	REF
1	934158	C	G	SNP
1	934162	G	GCGGA	INDEL
1	934164	G	A	SNP
1	934164	G	GA	INDEL
1	934164	G	*	REF
1	934180	C	G	SNP
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.