[BioC] venn diagram

Ochsner, Scott A sochsner at bcm.tmc.edu
Thu Jul 30 18:13:43 CEST 2009


Steve,

I don't remember exactly where I picked this bit of code up so I apologize for not giving credit.  I'm almost sure I got it from looking at the mail archives.  It uses the makeIndices function within affycoretools.

>vennDiagram(temp.results)

# make an index of all the probeIds with a TRUE call.  As the default for vennCounts() is "both" (and you have implicitly called vennCounts() in your call to vennDiagram()), you need to use "both" in the makeIndices call.

alls<-affycoretools:::makeIndices(temp.results,"both")
 

>length(which(alls[[3]]==T))

#extract from alls those genes in your venn diagram.

>alls.genes<-lapply(alls,function(x)row.names(temp.results)[x])

or lapply(alls,function(x)fit2$genes$Name[x])

#test to see if the lists of all.genes agree with the venn diagram

>length(alls.genes[[1]])
>length(alls.genes[[2]])
etc...

>alls.genes[[3]]
 [1] "1417023_a_at" "1417561_at"   "1417580_s_at" "1417867_at"

Hope this helps,

Scott




Scott A. Ochsner, PhD
One Baylor Plaza BCM130, Houston, TX 77030
Voice: (713) 798-6227  Fax: (713) 790-1275 
-----Original Message-----
From: bioconductor-bounces at stat.math.ethz.ch [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of Stephen V. Su
Sent: Thursday, July 30, 2009 1:13 AM
To: bioconductor at stat.math.ethz.ch
Subject: [BioC] venn diagram

To whom this may concern:

    I must first apologize for not being a bioinformaticist and really only "pretend" to know how to use R to analyze microarray.  But i do understand the concepts of Limma and when to apply it.  I think it is a really powerful way to analyze matrix data.  So, if you don't mind, I would like to ask you a question regarding Venn Diagrams.  I have generated a RMA-processed expression set for 3 different conditions (each condition has a minimum of 8 CEL files- Affy 0.5 genome rat chip), fed it through limma to create a statistical computation of all the genes that are differentially expressed and created a venn Diagram to depict the results.  A general input functions of what i just wrote is depicted here:


> fit <- lmFit(x, design)
 
> cont.matrix <- makeContrasts(x3Dvsinvivo = x3D - invivo,
+ x3Dvsx2D = x3D - x2D,
+ x2Dvsinvivo = x2D - invivo, levels = design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2 <- eBayes(fit2)
> results <- decideTests(fit2)
> vennDiagram(results)
 
My question is:  How do I extract out the genes that reside in each of the quadrant in the Venn diagram?  Is there a way for me to say, retrieve the 108 genes that are unique to condition A, 98 genes unique to condition B and C, and so on ....
 
Your help is greatly appreciated and I thank-you in advance of your considerations
 
Steve


      
	[[alternative HTML version deleted]]



More information about the Bioconductor mailing list