How to plot gene_names besides CpGs in microarray methylation heatmap?
0
1
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)

enter image description here

limma Differential CpG microarray heatmap.2 • 1.3k views
ADD COMMENT
3
Entering edit mode

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)))
ADD REPLY
1
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2109 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6