Entering edit mode
2.6 years ago
jsw940
▴
10
Hello,
I have a question about R visualization using Circlize package.
I tried to use Circos but it was pretty hard for me so instead I used Circlize package in R.
I made my plot using this script :
library(circlize)
library(extrafont)
#read the csv file
data <- read.csv("/circos/chord2.csv", row.names = 1)
#convert the table to a martix
data <- as.matrix(data)
#assign color to each group of strains
col = c(systemdevelopment = "#488FCD",
vasculaturedevelopment = "#FEC111",
multicellularorganismdevelopment = "#90419A",
tubedevelopment = "#EF3A67",
musclestructuredevelopment = "#99CC00",
circulatorysystemdevelopment = "#39C0C4",
cellpopulationproliferation = "#F16739",
tissuedevelopment = "#607D8B",
celldifferentiation = "#FF3300",
SERPINE1 = "grey",
ANXA1 = "grey",
TAGLN2 = "grey",
BLOC1S2 = "grey",
APELA = "grey",
SRSF1 = "grey",
NPPB = "grey",
SHTN1 = "grey",
GREM1 = "grey",
PIK3C2A = "grey",
HMOX1 = "grey",
HES3 = "grey",
HOMER1 = "grey",
ATF5 = "grey",
CUZD1 = "grey",
TJP1 = "grey",
ACVR1B = "grey",
PLAU = "grey",
ARFRP1 = "grey",
TRIM54 = "grey",
CASP3 = "grey",
CD164 = "grey",
DDIT4 = "grey",
VIM = "grey",
SCN8A = "grey",
MMP24 = "grey",
CAV1 = "grey",
SLC7A11 = "grey",
SKIL = "grey",
SP3 = "grey",
TWIST1 = "grey"
)
#create a chord diagram but without labeling
cir <- chordDiagram(data, grid.col = col,
annotationTrack = c("grid"),
preAllocateTracks = 1,
transparency = 0.2,
h.ratio = 0.4,
big.gap = 1,
small.gap = 1
)
#add the labels and axis
cir <- circos.trackPlotRegion(track.index = 2, panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
#print labels
circos.text(mean(xlim), ylim[1] + 2.5, sector.name,
facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.5), cex=0.6)
})
#print axis
# circos.axis(h = "top", labels.cex = 0.5, major.tick.percentage = 0.2,
# sector.index = sector.name, track.index = 2)
#}, bg.border = NA)
And this is the result of this script :
The question that I want to ask is...
Is there any way for making a heat map color of each gene's expression instead of the grey in each bar at the rim of the circle indicating each gene?
I saw that in other plots using Circos. But I want to know I can make it with this package.
Thank you!