library(IRanges)
lambda <- c(rep(0.001, 4500), seq(0.001, 10, length = 500),
seq(10, 0.001, length = 500))
xVector <- rpois(1e4, lambda)
xRle <- Rle(xVector)
xRleList <- RleList(xRle, 2L * xRle)
ggplot(xRle) + stat_slice(lower = 5)
ggplot(xRle) + stat_slice(lower = 5, geom = "bar")
ggplot(xRle) + stat_slice(lower = 5, geom = "heatmap")
p1 <- ggplot(xRle) + stat_slice(type = "viewMeans", lower = 5,
geom = "bar")
p2 <- ggplot(xRle) + stat_slice(type = "viewSums", lower = 5,
geom = "bar")
## y scale are different.
tracks(viewMeans = p1, viewSums = p2)
ggplot(xRleList) + stat_slice(lower = 5)
ggplot(xRleList) + stat_slice(lower = 5, geom = "bar")
ggplot(xRleList) + stat_slice(lower = 5, geom = "heatmap")
p1 <- ggplot(xRleList) + stat_slice(type = "viewMeans", lower = 5,
geom = "bar")
p2 <- ggplot(xRleList) + stat_slice(type = "viewSums", lower = 5,
geom = "bar")
## y scale are different.
tracks(viewMeans = p1, viewSums = p2)
Run the code above in your browser using DataLab