vcfanno icon indicating copy to clipboard operation
vcfanno copied to clipboard

Annotations of type float slightly differ from values in the resource

Open bartcharbon opened this issue 3 years ago • 1 comments

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.

bartcharbon avatar Aug 07 '20 06:08 bartcharbon

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.

brentp avatar Aug 07 '20 12:08 brentp