Closed lgeistlinger closed 7 years ago
No, it actually makes sense that simplifyReduce
also has knowledge about the query ranges, e.g. in case of a weighted average score per query range, where the weight is proportional to the overlap widths between overlapping ranges and a query range.
weightedmean2 <- function(scores, ranges, qranges)
{
isects <- pintersect(ranges, qranges)
sum(scores * width(isects)) / sum(width(isects))
}
Perhaps this is even a better example as it illustrates usage with all three arguments.
The vignette, Section 6.4 qreduceAssay currently says:
However, the given example only uses two arguments in its body (
scores
andranges
). Is this intended? How would an example using all three arguments look like?As far as I understand the procedure underlying
qreduceAssay
, it first identifies overlapping rowRanges for each given query range and then accordingly summarizes across these ranges by applyingsimplifyReduce
.Thus,
simplifyReduce
actually only needs to know about the ranges and associated scores it summarizes over, doesn't it?