consolidateClusters(data.list, result.list, equiweight=TRUE, ...)
data.list
clusterWindows
data.list
clusterWindows
.
This represents the post-hoc counterpart to consolidateSizes
.Some effort is required to equalize the contribution of the results from each analysis.
This is done by setting equiweight=TRUE
, where the weight of each window is inversely proportional to the number of windows from that analysis.
These weights are used as frequency weights for window-level FDR control (to identify DB windows prior to clustering).
Otherwise, the final results would be dominated by large number of small windows.
Users can cluster by the sign of log-fold changes, to obtain clusters of DB windows of the same sign.
However, note that nested windows with opposite signs may give unintuitive results - see mergeWindows
for details.
clusterWindows
,
consolidateSizes
# Making up some GRanges.
low <- GRanges("chrA", IRanges(runif(100, 1, 1000), width=5))
med <- GRanges("chrA", IRanges(runif(40, 1, 1000), width=10))
high <- GRanges("chrA", IRanges(runif(10, 1, 1000), width=20))
# Making up some DB results.
dbl <- data.frame(logFC=rnorm(length(low)), PValue=rbeta(length(low), 1, 20))
dbm <- data.frame(logFC=rnorm(length(med)), PValue=rbeta(length(med), 1, 20))
dbh <- data.frame(logFC=rnorm(length(high)), PValue=rbeta(length(high), 1, 20))
result.list <- list(dbl, dbm, dbh)
# Consolidating.
cons <- consolidateClusters(list(low, med, high), result.list, tol=20)
cons$region
cons$id
cons$FDR
# Without weights.
cons <- consolidateClusters(list(low, med, high), result.list, tol=20, equiweight=FALSE)
cons$FDR
# Using the signs.
cons <- consolidateClusters(list(low, med, high), result.list, tol=20, fc.col="logFC")
Run the code above in your browser using DataLab