Question: Using Genes List From Limma Venn Diagram To Make Heat Map
gravatar for Ly
7.5 years ago by
Ly130 wrote:


I am using limma to analysis data from a two color agilent chip. I've made my venn diagram using the significant genes that I've acquired from limma. However, I am having trouble trying to link my gene in each compartment of the venn diagram back to the original data to make a heat map. This is what I have so far:

Data Analysis



MA.lqav<- avereps(MA.lq, ID=MA$genes$ProbeName)

design<- modelMatrix(targets, ref="Ref")

contrast.matrix<-makeContrasts(BxM-Control, cMyc-Control,MXH-Control, TxM-Control, levels=design)


Contrasts Levels BxM - Control cMyc - Control MXH - Control TxM - Control BxM 1 0 0 0 cMyc 0 1 0 0 Control -1 -1 -1 -1 MXH 0 0 1 0 TxM 0 0 0 1

fit<-lmFit(MA.lqav, design)

fit2<, contrast.matrix)


Venn Diagram:

BxM.toptable<-topTable(fit2,coef=1, adjust="fdr", p.value=0.01 )

cMyc.toptable<-topTable(fit2,coef=2,n=40000, adjust="fdr", p.value=0.01)

MXH.toptable<-topTable(fit2,coef=3 ,n=40000, adjust="fdr", p.value=0.01)

TxM.toptable<-topTable(fit2,coef=4, n=40000, adjust="fdr", p.value=0.01)

input<-list(BxM.toptable$ProbeName, MXH.toptable$ProbeName, cMyc.toptable$ProbeName, TxM.toptable$ProbeName)


Table for Venn Diagram

results<-decideTests(fit2, method="separate", adjust.method="fdr", p.value=0.01)





VennT<-cbind(BxM.V, cMyc.V, MxH.V, TxM.V)


Getting genes that are DE in all comparisons

All<-results[,1]!=0 & results[,2]!=0 & results[,3]!=0 & results[,4]!=0

allgene<-fit2$genes[All, "GeneName"]


So now I have a list of genes that are differentially expressed in all of my comparisons but I don't know how to link it back to the individual sample and make a heat map. Any help in this would really be appreciated. I am new to R and hope I have not confused you. Also, if I am doing this all wrong or it's not a relevant thing to do, please let me know.

Thank you in advance, Ly

gene R limma • 5.7k views
ADD COMMENTlink modified 7.1 years ago by seidel6.8k • written 7.5 years ago by Ly130

Looks like your Venn diagram code is all on one line, which is hard to read.

ADD REPLYlink written 7.5 years ago by Chris Penkett480

Can you post sample data for your function. That makes it easier to help you. To post the R data you can use the function dput( object ) and copy the output.

ADD REPLYlink written 7.4 years ago by Mischa Vreeburg50
gravatar for seidel
7.4 years ago by
United States
seidel6.8k wrote:

The thing to keep in mind is that the results matrix, all the fit objects (fit, fit2), and your MA.lqav object have the same number of rows for the ratio data from the arrays, so an index into one is an index for all of them. Thus, when you build "All" using the boolean combination of the columns in "results", you end up with a vector of TRUE and FALSE that can be used to access the data for the genes in fit, fit2, and MA.lqav. Too see a heat map of the values from all the individual samples you could do:


The table of ratio data for each array is in MA.lqav$M, and since All is a boolean index (also called an index vector) with TRUE for row that has a significant gene, the statement above creates a submatrix of the ratios in all samples of the significant genes.

If you you want individual heat maps of various venn compartments, then you have to create an index vector using combinations from the results matrix which reflect the logic of the venn compartment. For instance a given compartment might be:

venn_region <- results[,1]==1 & results[,2]!=1 & results[,3]==1
ADD COMMENTlink written 7.4 years ago by seidel6.8k
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: 788 users visited in the last hour