bcftools icon indicating copy to clipboard operation
bcftools copied to clipboard

Feature request: make `sort` reproducible

Open pd3 opened this issue 1 year ago • 0 comments

Discussed in https://github.com/samtools/bcftools/discussions/1926

Originally posted by jrm5100 May 19, 2023 The cmp_bcf_pos function looks at:

  • id
  • pos
  • alleles

However, if all of these match the records are considered equivalent and qsort is unstable. Theoretically it would be possible to track the original index of the records as they are read and use that as a final tiebreaker.

Is this something that would be worthwhile? This isn't entirely theoretical- I ran into it but I could accept that it shouldn't matter how those records are sorted.

pd3 avatar May 23 '23 13:05 pd3