bcftools norm -m +snps doesn't combine INFO fields when combining identical SNPs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- bioinformatics
Research direction
Start with the bcftools norm -m +snps handling described in the issue and reproduce the behavior using tiny.vcf. The change is done when identical SNP records combine their INFO values as requested, including summed AC and AF, while the different-allele example continues to produce comma-separated values.
Written by the indexing model from the issue text.
Description
Below is a tiny vcf file containing two data records, each describing the same SNP. When I run bcftools norm -m +snps on it, it properly outputs only one data record, but it doesn't combine the INFO fields-- it just takes the INFO field from the second data record.
$ cat tiny.vcf
##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="All filters passed">
##contig=<ID=1,URL=ftp://somewhere.org/assembly.fa>
##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency">
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele Count">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in data sources">
##INFO=<ID=END,Number=.,Type=Integer,Description="End position">
##INFO=<ID=DS,Number=A,Type=String,Description="Data Sources containing allele">
##INFO=<ID=OLD_MULTIALLELIC,Number=1,Type=String,Description="Original chr:pos:ref:alt encoding">
##INFO=<ID=OLD_VARIANT,Number=.,Type=String,Description="Original chr:pos:ref:alt encoding">
#CHROM POS ID REF ALT QUAL FILTER INFO
1 10440 . C A . . AF=0.0002305;AC=6;AN=26028
1 10440 . C A . . AF=0.0001153;AC=3;AN=26028
$ bcftools norm -m+snps tiny.vcf #header info omitted
1 10440 . C A . . AF=0.0001153;AC=3;AN=26028
bcftools norm -m +snps does combine INFO fields when combining two different SNP alleles at the same position--it combines the AC and AF values by separating them with commas (see below).
$ cat tiny2.vcf #header info same as above; omitted
1 10440 . C A . . AF=0.0002305;AC=6;AN=26028
1 10440 . C T . . AF=0.0001153;AC=3;AN=26028
$ bcftools norm -m+snps tiny2.vcf
1 10440 . C A,T . . AF=0.0002305,0.0001153;AC=6,3;AN=26028
I'd like it to also do the right thing when the two alleles are the same--I'd like it to sum the AC and AF values, producing the following for tiny.vcf:
1 10440 . C A . . AF=0.0003458;AC=9;AN=26028
I am using this version of bcftools:
$ bcftools --version
bcftools 1.2-190-g71921ca
Using htslib 1.2.1-226-g1e5c377
- Dominant language
- C
- Stars
- 891
- Forks
- 277
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samtools/bcftools
-
needs-feedback
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
htslib-dependent P2: Desirable
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
needs-feedback requires-test-case
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in samtools/bcftools
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100