track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
highlight.sector(rownames(mat1), track.index = 1, col = "red",
text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, col = "green",
text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, col = "blue",
text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(rownames(mat1), track.index = 1, col = "",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, col = "", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, col = "",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
highlight.sector(colnames(mat2), track.index = 1, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.4, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.4, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 2, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.4, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 0.5, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(rownames(mat1), track.index = 1, col = "lightblue", text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat1), track.index = 1, col = "lightblue", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(colnames(mat2), track.index = 1, col = "lightblue", text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(c("A1", "A2", "A3", "A4", "A5"), track.index = 1, col = "lightblue", text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(c("B1", "B2", "B3", "B4", "B5"), track.index = 1, col = "lightblue", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(c("C1", "C2", "C3", "C4", "C5"), track.index = 1, col = "lightblue", text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(c("A1", "A2", "A3", "A4", "A5"), track.index = 1, col = "lightblue", text = "A", cex = 0.8, text.col = "black", niceFacing = TRUE)
highlight.sector(c("B1", "B2", "B3", "B4", "B5"), track.index = 1, col = "lightblue", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
highlight.sector(c("C1", "C2", "C3", "C4", "C5"), track.index = 1, col = "lightblue", text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(c("A1", "A2", "A3", "A4", "A5"), track.index = 1, col = "lightblue", text = "A", cex = 0.8, text.col = "black", niceFacing = TRUE)
highlight.sector(c("B1", "B2", "B3", "B4", "B5"), track.index = 1, col = "lightblue", text = "B", cex = 0.8, text.col = "black", niceFacing = TRUE)
highlight.sector(c("C1", "C2", "C3", "C4", "C5"), track.index = 1, col = "lightblue", text = "C", cex = 0.8, text.col = "black", niceFacing = TRUE)
circos.clear()
rm(list=ls())
library(circlize)
options(digits = 2)
mat1 = matrix(rnorm(25), nrow = 5)
rownames(mat1) = paste0("A", 1:5)
colnames(mat1) = paste0("B", 1:5)
mat2 = matrix(rnorm(25), nrow = 5)
rownames(mat2) = paste0("A", 1:5)
colnames(mat2) = paste0("C", 1:5)
mat3 = matrix(rnorm(25), nrow = 5)
rownames(mat3) = paste0("B", 1:5)
colnames(mat3) = paste0("C", 1:5)
mat = matrix(0, nrow = 10, ncol = 10)
rownames(mat) = c(rownames(mat2), rownames(mat3))
colnames(mat) = c(colnames(mat1), colnames(mat2))
mat[rownames(mat1), colnames(mat1)] = mat1
mat[rownames(mat2), colnames(mat2)] = mat2
mat[rownames(mat3), colnames(mat3)] = mat3
# Set larger gaps between groups. Here we manually adjust gap.after in circos.par().
circos.par(gap.after = rep(c(rep(1, 4), 8), 3))
chordDiagram(mat, annotationTrack = c("grid", "axis"),
preAllocateTracks = list(
track.height = uh(4, "mm"),
track.margin = c(uh(4, "mm"), 0)
))
# highlight.sector(rownames(mat1), track.index = 1, col = "red",   text = "A", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat1), track.index = 1, col = "green", text = "B", cex = 0.8, text.col = "white", niceFacing = TRUE)
# highlight.sector(colnames(mat2), track.index = 1, col = "blue",  text = "C", cex = 0.8, text.col = "white", niceFacing = TRUE)
print(rownames(mat1))
print(colnames(mat1))
print(colnames(mat2))
highlight.sector(c("A1", "A2", "A3", "A4", "A5"), track.index = 1, col = "lightblue", text = "A", cex = 0.8, text.col = "black", niceFacing = TRUE)
highlight.sector(c("B1", "B2", "B3", "B4", "B5"), track.index = 1, col = "lightblue", text = "B", cex = 0.8, text.col = "black", niceFacing = TRUE)
highlight.sector(c("C1", "C2", "C3", "C4", "C5"), track.index = 1, col = "lightblue", text = "C", cex = 0.8, text.col = "black", niceFacing = TRUE)
circos.clear()
rm(list=ls())
install.packages("randomcoloR")
#!/usr/bin/env Rscript
library(randomcoloR)
color_list = c('#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080', '#ffffff', '#000000', "pink1", "violet", "mediumpurple1", "slateblue1", "purple", "purple3",
"turquoise2", "skyblue", "steelblue", "blue2", "navyblue",
"orange", "tomato", "coral2", "palevioletred", "violetred", "red2",
"springgreen2", "yellowgreen", "palegreen4",
"wheat2", "tan", "tan2", "tan3", "brown",
"grey70", "grey50", "grey30", "#466791","#60bf37","#953ada","#4fbe6c","#ce49d3","#a7b43d","#5a51dc","#d49f36","#552095","#507f2d","#db37aa","#84b67c","#a06fda","#df462a","#5b83db","#c76c2d","#4f49a3","#82702d","#dd6bbb","#334c22","#d83979","#55baad","#dc4555","#62aad3","#8c3025","#417d61","#862977","#bba672",
"#403367","#da8a6d","#a79cd4","#71482c","#c689d0","#6b2940","#d593a7","#895c8b","#bd5975")
color_list_uniq = unique(color_list)
print(length(color_list))
print(length(color_list_uniq))
color_list = c('#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe',
'#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080',
"#466791", "#60bf37", "#953ada", "#4fbe6c", "#ce49d3", "#a7b43d", "#5a51dc", "#d49f36", "#552095", "#507f2d",
"#db37aa", "#84b67c", "#a06fda", "#df462a", "#5b83db", "#c76c2d", "#4f49a3", "#82702d", "#dd6bbb", "#334c22",
"#d83979","#55baad","#dc4555","#62aad3","#8c3025","#417d61","#862977","#bba672","#403367","#da8a6d","#a79cd4",
"#71482c","#c689d0","#6b2940","#d593a7","#895c8b","#bd5975", '#ffffff', '#000000', "pink1", "violet",
"mediumpurple1", "slateblue1", "purple", "purple3","turquoise2", "skyblue", "steelblue", "blue2", "navyblue",
"orange", "tomato", "coral2", "palevioletred", "violetred", "red2","springgreen2", "yellowgreen", "palegreen4",
"wheat2", "tan", "tan2", "tan3", "brown","grey70", "grey50", "grey30", )
color_list_uniq = unique(color_list)
print(length(color_list))
print(length(color_list_uniq))
color_list = c('#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe',
'#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080',
"#466791", "#60bf37", "#953ada", "#4fbe6c", "#ce49d3", "#a7b43d", "#5a51dc", "#d49f36", "#552095", "#507f2d",
"#db37aa", "#84b67c", "#a06fda", "#df462a", "#5b83db", "#c76c2d", "#4f49a3", "#82702d", "#dd6bbb", "#334c22",
"#d83979","#55baad","#dc4555","#62aad3","#8c3025","#417d61","#862977","#bba672","#403367","#da8a6d","#a79cd4",
"#71482c","#c689d0","#6b2940","#d593a7","#895c8b","#bd5975", '#ffffff', '#000000', "pink1", "violet",
"mediumpurple1", "slateblue1", "purple", "purple3","turquoise2", "skyblue", "steelblue", "blue2", "navyblue",
"orange", "tomato", "coral2", "palevioletred", "violetred", "red2","springgreen2", "yellowgreen", "palegreen4",
"wheat2", "tan", "tan2", "tan3", "brown","grey70", "grey50", "grey30")
color_list_uniq = unique(color_list)
print(length(color_list))
print(length(color_list_uniq))
princomp()
colors()
print(colors())
selected_color = sample(colors(), 1)
selected_color
rainbow()
install.packages("grDevicies")
library(grDevices)
rainbow()
rainbow_hcl()
Rainbow.colors()
rainbow(10)
rainbow()
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 1))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(sample(terrain.colors(50), 4))
print(col = terrain.colors(length(label_order_on_plot))[1])
print(col = terrain.colors(length(20))[1])
terrain.colors(20)
terrain.colors(20)[1]
terrain.colors(20)[[1]]
col = terrain.colors(20)
col
col[[1]]
col[[2]]
col = terrain.colors(50)
col
