Skip to content

Commit

Permalink
Merge pull request #1343 from deeptools/maturin
Browse files Browse the repository at this point in the history
better out of bounds check in binsize mode
  • Loading branch information
WardDeb authored Nov 27, 2024
2 parents 4e35caa + 60d91f0 commit 027ec1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/covcalc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub fn bam_pileup(
// split off first entry
for block in blocks.into_iter() {
// Don't count blocks that exceed the chromosome
if block.0 as u64 > region.2 {
if block.0 as u64 >= region.2 {
continue;
}
binix = block.0 as u64 / *binsize as u64;
Expand All @@ -131,7 +131,7 @@ pub fn bam_pileup(
changedbins.push(binix);
}
// Don't count blocks that exceed the chromosome
if block.1 as u64 > region.2 {
if block.1 as u64 >= region.2 {
continue;
}
// if block.1 is at the end of a region, it should be counted in the block before (if different from first block)
Expand Down

0 comments on commit 027ec1b

Please sign in to comment.