dnanexus-rnd / GLnexus

Scalable gVCF merging and joint variant calling for population sequencing projects
Apache License 2.0
149 stars 38 forks source link

nondeterministic sorting of "usable half-calls" #176

Closed mlin closed 4 years ago

mlin commented 5 years ago

Obscure corner case where GLnexus generates nondeterministic results:

https://github.com/dnanexus-rnd/GLnexus/blob/237e9bcbcd685445ab0aa65ecbc6c29cefe1b26e/src/genotyper.cc#L441-L448

https://github.com/dnanexus-rnd/GLnexus/blob/237e9bcbcd685445ab0aa65ecbc6c29cefe1b26e/src/genotyper.cc#L471

This sorts the "usable half-calls" by decreasing QUAL value, but it's possible that multiple such records share the same QUAL value. Then the order we get depends on the arbitrary/uncontrollable memory address pointers.