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

Annotations of type float slightly differ from values in the resource #125

Open bartcharbon opened 4 years ago

bartcharbon commented 4 years ago

I'm using VCF anno to annotate a INFO field of the float datatype: Input infofield:

##INFO=<ID=CAP,Number=A,Type=Float,Description="CAP">

The resource contains values for this INFO field like: 1.4696171E-4 0.13309044 7.423004E-5

conf.toml is very simple:

file="test/tmp/cap.vcf.gz"
fields = ["CAP"]
ops=["self"]
names=["CAP"]

After annotation the values I find in the resulting VCF are slightly different from the input: 0.00014696 0.1331 7.423e-05

I would expect the annotated values to be the exactly same as the one in the resource.

brentp commented 4 years ago

vcfanno must decide how to render a 32 bit float. The method chosen is a good trade-off between side and precision. This is not unexpected.