Entering edit mode
4.9 years ago
maria2019
▴
250
Hi,
I have analyzed microarray methylation data using limma. After the differential analysis, I have plotted heat_map of 50 most differentiated CpGs based on Bvalues using heatmap.2. How can I add gene name as second Y_Axis lable to the plot (if there is a gene name for the CpG)?
below is my code and plot
targets <- read.metharray.sheet(dataDirectory, pattern="SampleSheet.csv")
rgSet <- read.metharray.exp(targets=targets)
mSetSq <- preprocessQuantile(rgSet)
tt = topTable(fit2,coef=2,adjust.method="BH",p.value= 0.05,lfc=1,number=50) # this has CpGs,B_value, gene_name, etc
idx = rownames(tt)
esetsel <- eset[idx, ]
heatmap.2(getBeta(esetsel), tracecol=NA)
Use this code to generate heatmap
I personally like
ComplexHeatmap
. Check its manual (https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html) for examples that most closely resemble what you aim to do.