Explanation:
In the case where nrow(dt1) <= num.of.bins and dt2 has no rows, break.points2 will be numeric (empty).
As a result, the length of break.points is not longer than num.of.bins and there will be an error in the call to
list <- lapply(1:num.of.bins, FUN = GetExpLevel, exp.value = dt$exp.value, break.points = break.points)
For example, if num.of.bins = 4 and break.points = [0, 0.00339, 8.83416], an NA result is got for lower/upper when GetExpLevel tries to access break.points[i] for i = 3 (upper) and i = 4 (both lower and upper).
Suggestion:
Would it be possible to do something to lengthen break.points in the case break.points is of the same length or shorter than num.of.bins?
Debug environment - CalculateExpressionLevelDinuc (an 2bp-indel adapted version of CalculateExpressionLevel )
@JiaGengChang
Thanks a lot for giving detailed information about this issue. I have updated the code in master branch for this edge case. If you find other bug in ICAMS, please let us know. Thanks!
Explanation: In the case where
nrow(dt1) <= num.of.bins
anddt2
has no rows,break.points2
will benumeric (empty)
. As a result, the length ofbreak.points
is not longer thannum.of.bins
and there will be an error in the call tolist <- lapply(1:num.of.bins, FUN = GetExpLevel, exp.value = dt$exp.value, break.points = break.points)
For example, if
num.of.bins = 4
andbreak.points = [0, 0.00339, 8.83416]
, an NA result is got forlower
/upper
whenGetExpLevel
tries to access break.points[i] for i = 3 (upper
) and i = 4 (bothlower
andupper
).Suggestion: Would it be possible to do something to lengthen break.points in the case
break.points
is of the same length or shorter thannum.of.bins
?Debug environment - CalculateExpressionLevelDinuc (an 2bp-indel adapted version of CalculateExpressionLevel )
Thank you very much