Open
Description
Hey, thank you for this great library. When working with unmapped reads, a call on bam record.contig()
panics. I suppose it's due to the crate internally setting the tid
of unmapped reads to -1? This is a bit problematic, as the user has no way of handling the internal panic and just has to avoid calling .contig()
on unmapped reads. The code responsible is starting from line 1192 in src/bam/record.rs
.
fn contig(&self) -> &str {
let tid = self.tid();
if tid < 0 {
panic!("invalid tid, must be at least zero");
}
}
It's understandable that returning a Result
here would be inconvenient, but maybe it would be possible to return "*" or something like "unmapped" instead?
Metadata
Metadata
Assignees
Labels
No labels