zaeleus / noodles

Bioinformatics I/O libraries in Rust
MIT License
490 stars 52 forks source link

`csi::Index` does not return the same values as `bai::Index` did for `first_record_in_last_linear_bin_start_position` #172

Closed mmalenic closed 1 year ago

mmalenic commented 1 year ago

For this bai file: https://github.com/umccr/htsget-rs/blob/main/data/bam/htsnexus_test_NA12878.bam.bai, csi::Index does not return the closest position to the unplaced, unmapped records - I'm trying to figure out if I've missed something.

For example:

let position = bai::read("htsnexus_test_NA12878.bam.bai")?.first_record_in_last_linear_bin_start_position();
println!("{:#?}", position);

On noodles 0.39 shows this:

Some(
    VirtualPosition(
        0,
    ),
)

whereas on 0.34 it shows:

Some(
    VirtualPosition(
        135056308030,
    ),
)
zaeleus commented 1 year ago

Thanks for reporting! As you noticed, binning index types were consolidated in noodles 0.35.0/noodles-csi 0.15.0 (2023-04-06), so this affected BAI and tabix but not CSI. It's now fixed in noodles 0.40.0/noodles-csi 0.19.0.