This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to plot gene_names besides CpGs in microarray methylation heatmap?

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)

enter image description here

limma differential cpg microarray heatmap.2

Use this code to generate heatmap

# Use RColorBrewer color palette names
    library("RColorBrewer")
    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)))

0 answers

No answers yet.

Log in to answer this question.