broadinstitute / gamgee

A C++14 library for NGS data formats
http://broadinstitute.github.io/gamgee/
MIT License
40 stars 13 forks source link

missing(float) is returning true for float_vector_ends as well #157

Closed MauricioCarneiro closed 10 years ago

MauricioCarneiro commented 10 years ago

it should differentiate between the two.

MauricioCarneiro commented 10 years ago

this should be addressed following #120

droazen commented 10 years ago

See the following test program I wrote:

https://gist.github.com/droazen/7eabfc2cd9054ba9886a

The output of this program is:

missing_value:
val is a NaN
val converted to int is missing

end_of_vector_value:
val is a NaN
val converted to int is vector end

What this shows is that:

I will do a pull request in a bit to implement this.

kgururaj commented 10 years ago

You can use functions bcf_float_is_missing and bcf_float_is_vector_end from htslib (htslib/vcf.h)