Description Usage Details Examples
draw circos plot
1 |
Please see chordDiagram,colorRamp2,circos.trackPlotRegion,highlight.sector
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(ComplexHeatmap)
library(circlize)
set.seed(123)
mat = matrix(nrow = 100, ncol = 100)
diag(mat) = 0
mat[lower.tri(mat)] = 0
mat[upper.tri(mat)] = rnorm(99*50, sd = 0.1)
ind = sample(99*50, 30)
mat[upper.tri(mat)][ind] = runif(30, min = -1, max = 1)
rownames(mat) = paste0("R", 1:100)
colnames(mat) = rownames(mat)
group_size = c(12, 8, 7, 16, 6, 2, 16, 13, 20) # sum(group_size) =100
grouplist = lapply(1:9, function(i) {
rownames(mat)[sum(group_size[seq_len(i-1)]) + 1:group_size[i]]
})
names(grouplist) = paste0("G", 1:9)
groupcolor = structure(circlize::rand_color(9), names = names(grouplist))
circos(mat,grouplist,groupcolor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.