Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "binseq"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
description = "A high efficiency binary format for sequencing data"
license = "MIT"
Expand Down
20 changes: 12 additions & 8 deletions src/bq/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,25 @@ impl BinseqRecord for BatchRecord<'_> {
}
/// Override this method since we can make use of block information
fn sseq(&self) -> &[u8] {
let scalar = self.config.scalar();
let mut lbound = 0;
let mut rbound = self.config.slen();
if self.config.flags {
let scalar = self.config.scalar();
&self.dbuf[scalar..scalar + self.config.slen()]
} else {
&self.dbuf[..self.config.slen()]
lbound += scalar;
rbound += scalar;
}
&self.dbuf[lbound..rbound]
}
/// Override this method since we can make use of block information
fn xseq(&self) -> &[u8] {
let scalar = self.config.scalar();
let mut lbound = scalar * self.config.schunk();
let mut rbound = lbound + self.config.xlen();
if self.config.flags {
let scalar = self.config.scalar();
&self.dbuf[scalar + self.config.slen()..]
} else {
&self.dbuf[self.config.slen()..]
lbound += scalar;
rbound += scalar;
}
&self.dbuf[lbound..rbound]
}
}

Expand Down