#380 closed defect (fixed)
Bug in Lowess
Reported by: | Owned by: | Johan Enell | |
---|---|---|---|
Priority: | critical | Milestone: | BASE 2.0.2 |
Component: | coreplugins | Version: | 2.0 |
Keywords: | Cc: |
Description
There is a bug in the Lowess plugin. Looping through the blocks misses the last block, in cases where (maxblock % blockGroupSize == 0) which is of course all cases where blockGroupSize is 1.
the loop statement is
for (int i = 0; i < maxBlock; i += blockGroupSize) { Restriction blockRestriction = Restrictions.between ( Expressions.selected(Dynamic.selectRawData("block")), Expressions.integer(i), Expressions.integer(i+blockGroupSize) );
the Between expression is converted to (i<=block AND block < i +blockGroupSize) Note the lack of inclusivity on the end
if there is one block (like Agilent) nothing is ever captured in this loop if there are 10 blocks and a block size of 5 it does 0-4 and 5-9
Since as far as I know blocks are always number 1... (never 0) the following should work
for (int i = 1; i <= maxBlock; i += blockGroupSize)
Change History (5)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
I just noticed that the MedianRatioNormalization plugin has a similar loop as in the Lowess plugin. It should probably be changed there as well.
comment:3 by , 18 years ago
Status: | new → assigned |
---|
I think it is possible that there are blocks with a block number of 0. This means that we should select both maxBlock and minBlock in the query and then iterate as: