Question: Trying to understand differential gene expression through Venn Diagrams from the 'limma' R package: why is there a number outside my diagram?
gravatar for hmg
5.8 years ago by
hmg20 wrote:


I am using the vennDiagram function from the limma library in R in order to understand the relationship of differentially expressed genes between my conditions. For a simple example, create a matrix:

m <- matrix(nrow=5, ncol=3, c(0, 1, 1, -1, 0, 1, 1, 1, 1, 0, -1, -1, -1, -1, -1))

Where the first column represents condition A, the second condition B, and the third C. The five rows represent five separate genes, and a positive 1 means the gene is up regulated in that condition, and a negative 1 means it is down regulated. (ETA: A 0 means the gene is not expressed in that condition.)

To create a Venn diagram showing which conditions share differentially expressed genes (not distinguishing up- or down-regulated genes):

vennDiagram(m, names=c("A", "B", "C"))

This shows that three genes are expressed in all three conditions, one is expressed by both B and C, and one is expressed only in C. From my understanding, the 0 in the corner means no genes are listed in the matrix that aren't expressed by any of the three conditions. (ETA: In other words, all five genes are expressed in at least one condition.)

To distinguish which genes are up and down regulated:

vennDiagram(m, names=c("A", "B", "C"), include=c("up", "down"))

I can understand how in this diagram, the numbers move because, for example, of the 3 genes differentially expressed by all three conditions, 2 were up regulated in A and B while down regulated in C. However, where is the 1 coming from in the corner? One gene is up-regulated but not expressed by any of the conditions? I haven't changed the matrix used to generate the diagrams, so all genes should be expressed by at least one of the conditions.

Any help is appreciated.

(ETA: The matrix looks like the following:)

              A    B     C

Gene1    0    1    -1

Gene2    1    1    -1

Gene3    1    1    -1

Gene4   -1    1    -1

Gene5    0    0    -1

ADD COMMENTlink modified 5.8 years ago • written 5.8 years ago by hmg20

It looks fishy to me. Maybe you should post this on the bioconductor question site. But your matrices don't match - 3 rows vs. 5?

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by Madelaine Gogol5.2k

Thanks for pointing that out--it should be nrow=5, ncol=3 (I've corrected it now).

ADD REPLYlink written 5.8 years ago by hmg20
gravatar for karl.stamm
5.8 years ago by
United States
karl.stamm3.7k wrote:

I can't read your matrix, but if the first column is all zeros, then one 'gene' is neither "up" nor "down".

The number outside the Venn diagram notes how many elements were in no set.


ADD COMMENTlink written 5.8 years ago by karl.stamm3.7k

Thanks for your response; however, as I mentioned, the rows of the matrix represent the genes (not the columns), and I have a 0 outside the three circles in the first diagram (meaning all genes are expressed by at least one condition). I am using the same matrix to generate the diagram that distinguishes which genes are up or down regulated, so I don't understand why there is a 1 outside the three circles in that diagram.

I've added the matrix for clarification.

ADD REPLYlink written 5.8 years ago by hmg20
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: 1124 users visited in the last hour