ComparativeGenomicsToolkit / taffy

This is a library C/Python/CLI for working with TAF (.taf,.taf.gz) and MAF (.maf) alignment files
MIT License
23 stars 3 forks source link

Fix index query bug where overlaps of first position missed #45

Closed glennhickey closed 6 months ago

glennhickey commented 6 months ago

For example if the indexed file starts with

a
s   hg38.chr1   10000   5   +   248956422   taacc
s   Anc6.Anc6refChr397  0   5   +   17989721    taacc
s   hs1.chr11   1509    5   +   135127769   taacc

and you query taffy view -r hg38.chr1 then you get

Region hg38.chr1:0-9223372036854775807 not found in taffy index

This only applies to the very first chromosome in the index and is due to a bug in handling the fact that it doesn't have a previous record.

Anyway, this PR fixes this case by adding an explicit check against the beginning of the index.