Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat regions [-1,n) as [0,n) when indexing
In VCF files, 1-based POS=0 represents an event in a telomere. POS=0 is represented as 0-based [-1,0), which previously led to a crash during indexing. Instead treat [-1,0) as [0,1) and larger [-1,n) as [0,n) so that such regions will be placed in an appropriately-sized leftmost bin. (Treat [-1,0) slightly more specially as [0,0) winds up in bin 0.) The previous crash occurred within insert_to_l(); this fixes the crash and alters beg/end for [-1,n) regions for both insert_to_l() and insert_to_b(). Fixes samtools#406.
- Loading branch information