brentp / vcfanno

annotate a VCF with other VCFs/BEDs/tabixed files
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-0973-5
MIT License
357 stars 55 forks source link

QUAL & GNOMAD rounded out #159

Open jomoxi opened 1 month ago

jomoxi commented 1 month ago

Hi We're very pleased with vcfanno performance but we found some modifications in the final vcf that annoys us a little. Basically, vcfanno rounds out "QUAL" to 1 decimal point (from 2 in the original vcf) and fields like "gnomAD_WG_AF" to 4 decimals points (6 in the original gnomad vcf)

Is there any parameter we miss to fix this? Thanks

INPUT VCF

chr1 13417 . C CGAGA **481.02** . AC=2;AF=1;AN=2;DP=13;ExcessHet=3.0103;FS=0;MLEAC=2;MLEAF=1;MQ=34.02;QD=25.36;SOR=2.494 GT:AD:DP:GQ:PL 1/1:0,11:11:33:495,33,0

GNOMAD VCF FOR THE SAME POSITION

chr1 13417 rs777038595 C CGAGA . . gnomAD_WG_AC=14710;gnomAD_WG_AC_POPMAX=159;**gnomAD_WG_AF=0.123607**;gnomAD_WG_AF_POPMAX=0.226496;gnomAD_WG_AN=119006;gnomAD_WG_AN_POPMAX=702;gnomAD_WG_POPMAX=ami;gnomAD_WG_filterStatus=Pass

VCFANNO VCF

chr1    13417   .   C   CGAGA   **481.0**   .   AC=2;AF=1;AN=2;DP=13;ExcessHet=3.0103;FS=0;MLEAC=2;MLEAF=1;MQ=34.02;QD=25.36;SOR=2.494;gnomAD_WG_AC=14710;gnomAD_WG_AC_POPMAX=159;**gnomAD_WG_AF=0.1236**;gnomAD
_WG_AF_POPMAX=0.2265;gnomAD_WG_AN=119006;gnomAD_WG_AN_POPMAX=702;gnomAD_WG_POPMAX=ami;gnomAD_WG_filterStatus=Pass;gnomAD_WG_lcr GT:AD:DP:GQ:PL  1/1:0,11:11:33:495,33,0
brentp commented 1 month ago

Hi, I see what you mean. That behavior is defined here: https://github.com/brentp/vcfgo/blob/master/variant.go#L186-L212 and here: https://github.com/brentp/vcfgo/blob/master/variant.go#L288 for QUAL.

maybe it's best to change all formatting to '%.6g' to match htslib

jomoxi commented 1 month ago

Thanks a lot! I see the problem I've cloned vcfanno and vcfgo repos locally and tried to compile them with the modifications in variant.go but, since I don't have experience with go, I've not succeeded. Do you think it's worth releasing a new version of variant.go with this change? Thanks again