Wrong AF from bcftools merge
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c
- Domain
- bioinformatics
Research direction
Start with the supplied bcftools merge command context and compare the INFO fields with the listed genotype counts before and after merging. Trace how AF, AC, and AN are represented or propagated by merge, then verify the expected result on this variant with a reproducible merge example. Done means explaining the unchanged AF and documenting a reliable way to generate the correct value.
Written by the indexing model from the issue text.
Description
I have the below variant with AF=0.0009107 in the INFO field as shown below:
chr18 40492946 . A T 2012.92 PASS BaseQRankSum=1.45;ClippingRankSum=0;ExcessHet=3.0585;FS=1.205;InbreedingCoeff=-0.0081;MQ=60;MQRankSum=0;QD=12.05;ReadPosRankSum=-0.76;SOR=0.587;MQ0=0;set=variant;;DP=22895;AF=0.0009107;MLEAC=1;MLEAF=0.0009091;AN=1562;AC=5
Upon inspecting, the genotype counts for the above variant are found to be:
304 ./.
776 0/0
5 0/1
Firstly, can someone enlighten me on how the AF is calcluated here? I assumed AF=AC/AN but this is not true here.
Second, I have included additional samples using bcftools merge and the INFO field looks like below with unchanged AF.
chr18 40492946 . A T 2044.2 PASS BaseQRankSum=1.45;ClippingRankSum=0;ExcessHet=3.0573;FS=1.205;InbreedingCoeff=-0.0079;MQ=60;MQRankSum=0;QD=12.24;RAW_MQ=608400;ReadPosRankSum=-0.76;SOR=0.587;DP=23085;AF=0.0009107;MLEAC=1;MLEAF=0.0009091;AN=1576;AC=5
And the genotype counts for the variant after merging are found to be:
304 ./.
783 0/0
5 0/1
The AF in unchanged after merging while AN and other tags are updated as per the new samples. Could someone help why bcftools merge resulted in incorrect AF and ways to generate correct AF?
- 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