zaeleus / noodles

Bioinformatics I/O libraries in Rust
MIT License
515 stars 53 forks source link

`noodles_util`'s `alignment::io::indexed_reader` does not recognize `set_index` #303

Closed jonghwanyoon closed 2 months ago

jonghwanyoon commented 2 months ago

Here is the code I used:

let builder= alignment::io::indexed_reader::Builder::default();
let index = bam::bai::read(bai_file).unwrap();

let mut reader = builder
    .set_index(index)
    .build_from_path(bam_file).unwrap();

Case1

The bam file I used is:

├── test.bam
└── test.bai
thread 'main' panicked at src/main.rs:55:36:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Case2

The bam file I used is:

├── test.bam
└── test.bam.bai

At this time, no error appears.

The issue here seems to be that the index is not recognized even though the index is specified using set_index.

zaeleus commented 2 months ago

Thanks for reporting!

This is now fixed in noodles 0.83.0 / noodles-util 0.54.0.