ComplexHeatmap
ComplexHeatmap copied to clipboard
Possible to add brackets and significant stars besides the oncoprint heatmap?
Hi, I have tried to create the oncoprint and I’m wondering is it possible to add significant stars besides the oncoprint, like this?
Or this
I have tried to combined with ggplot but I feel like I’m unable to do so?
I’m wondering is there a way to do this?
Thank you so much!!
You can first add an empty annotation and later add graphics in it:
m = matrix(rnorm(40), nrow = 4)
Heatmap(m) + rowAnnotation(foo = anno_empty(border = FALSE, width = unit(2, "cm")))
decorate_annotation("foo", {
grid.lines(unit(c(1, 2, 2, 1), "mm"),
unit(c(5/8, 5/8, 7/8, 7/8), "npc"))
grid.text("***", unit(3, "mm"), unit(6/8, "npc"), rot = 90, just = "top")
grid.lines(unit(c(5, 6, 6, 5), "mm"),
unit(c(3/8, 3/8, 7/8, 7/8), "npc"))
grid.text("**", unit(7, "mm"), unit(5/8, "npc"), rot = 90, just = "top")
grid.lines(unit(c(9, 10, 10, 9), "mm"),
unit(c(1/8, 1/8, 7/8, 7/8), "npc"))
grid.text("*", unit(11, "mm"), unit(4/8, "npc"), rot = 90, just = "top")
})