From ed3c94f612826e680032242f56dcd452ec2db84f Mon Sep 17 00:00:00 2001 From: Sebastian Mackowiak Date: Fri, 22 Nov 2019 11:01:18 +0100 Subject: [PATCH] Correct binsize calculation Binsize calculation is based on the gff input file and thus needs to add 1 for the region size. Since this was missing an offset error accumulated with the number of bins used and the end of a region was never been used for calculation. E.g. A region with 60 bins would lack the last 60bp of a region due to the offset error accumulation. --- bamliquidator_internal/bamliquidator.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bamliquidator_internal/bamliquidator.cpp b/bamliquidator_internal/bamliquidator.cpp index 86bc69d..8b6c443 100755 --- a/bamliquidator_internal/bamliquidator.cpp +++ b/bamliquidator_internal/bamliquidator.cpp @@ -198,11 +198,13 @@ std::vector liquidate(const samfile_t* fp, const bam_index_t* bamidx, only deal with coord, so use generic item */ int startArr[spnum], stopArr[spnum]; - int pieceLength = (stop-start) / spnum; + + // gff has fully closed intervals thus the length needs +1 + int pieceLength = (stop-start+1) / spnum; for(int i=0; i items = bamQuery_region(fp,bamidx,coord,strand,extendlen);