Question: How to plot gene_names besides CpGs in microarray methylation heatmap?
gravatar for maria2019
12 months ago by
maria2019130 wrote:


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)

enter image description here

ADD COMMENTlink modified 12 months ago • written 12 months ago by maria2019130

Use this code to generate heatmap

# Use RColorBrewer color palette names
    col <- colorRampPalette(brewer.pal(10, "RdYlBu"))(256)
    heatmap(df, scale = "none", col =  col, 
            RowSideColors = rep(c("blue", "pink"), each = 16),
            ColSideColors = c(rep("purple", 5), rep("orange", 6)))
ADD REPLYlink modified 12 months ago • written 12 months ago by skjobs0123170

I personally like ComplexHeatmap. Check its manual ( for examples that most closely resemble what you aim to do.

ADD REPLYlink written 12 months ago by ATpoint44k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2357 users visited in the last hour