I am using the ComplexHeatmap
package to represent the intersection among different GRanges
. The vignette has some nice example to plot it:
library(circlize)
library(ComplexHeatmap)
library(GenomicRanges)
lt2 = lapply(1:4, function(i) generateRandomBed())
lt2 = lapply(lt2, function(df) GRanges(seqnames = df[, 1],
ranges = IRanges(df[, 2], df[, 3])))
names(lt2) = letters[1:4]
m = make_comb_mat(lt2)
UpSet(m)
It is very handy. However, the UpSet
function do not plot the intersection numbers above each bar such as the sister function upset
in the UpSetR
package:
library('UpSetR')
movies <- read.csv( system.file("extdata", "movies.csv", package = "UpSetR"),
header=T, sep=";" )
require(ggplot2); require(plyr); require(gridExtra); require(grid);
upset(movies,
sets = c("Action", "Comedy", "Drama"),
order.by="degree", matrix.color="blue", point.size=5,
sets.bar.color=c("maroon","blue","orange"))
The upset
function do not allow the m
object. Thus, I suppose I need to use UpSet
in my case. However, could someone help me to get the correspondent number above the bars? I could not find a parameter to easily plot it or even how the internal functions define it. I would be grateful for any help.