You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
fncontig(&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?
The text was updated successfully, but these errors were encountered:
xosxos
changed the title
rust-htslib panics on record.contig() call
rust-htslib panics on bam record.contig() call
Nov 5, 2024
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 thetid
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 insrc/bam/record.rs
.It's understandable that returning a
Result
here would be inconvenient, but maybe it would be possible to return "*" or something like "unmapped" instead?The text was updated successfully, but these errors were encountered: