Hi. I am trying to create a heatmap from my data after I have analyzed it using Limma. I can get a list of genes that are shown to be significant in my analysis but would like to locate the same genes in my original data matrix to make a heat map of it. This is what I've done (below) but I can't seem to get the legions right. I would like to have the row names be the gene and rename the column. Any help to this problem will be much appreciated. Thanks in advance.
targets<-readTargets("HxMtargets.txt")
RG <- read.maimages(targets,source="agilent",columns= list( R = "rMeanSignal", G = "gMeanSignal", Rb = "rBGUsed", Gb = "gBGUsed", Rb.real = "rBGMeanSignal", Gb.real = "gBGMeanSignal"), annotation = c("FeatureNum","Row","Col","ProbeName","ControlType","GeneName", "Description","SystematicName"))
MA<-normalizeWithinArrays(RG,method="loess")
f<-factor(targets$Cy3,levels=c("Control","Twowks","Tumor"))
design<-model.matrix(~0+f)
colnames(design) <- c("Control","Twowks","Tumor")
fit<-lmFit(MA, design)
contrast.matrix<-makeContrasts(Control,Twowks,Tumor,Tumor-Control,Tumor-Twowks, Twowks-Control, levels=design)
fit2<-contrasts.fit(fit,contrast.matrix)
fit2<-eBayes(fit2)
C.top<-as.numeric(rownames(topTable(fit2, coef=1,n=50)))
heatmap(MA$M[C.top,])
Thanks you so much Sean! I did try this with some modifications of my own and it worked perfectly! Again, thank you.
Hi Ly, if you like the answer upvote and accept it.
Hi Sean,
Like the above question even I'm facing the same problem to get heatmap of differential expressed genes. Could you please hep me. I'm working on Human Gene 2.0 ST array. I have used "xps" package for the analysis.
tmp2 has differential expressed genes.
How can I get a heatmap for this?