8.2 years ago by
Washington University, St Louis, USA
In this vignette, there are three groups of samples being compared (three arrays with RNA1, two arrays with RNA2, and three arrays with RNA3). In this case, all three pairwise comparisons are said to be of interest (group2-group1, group3-group2, group3-group1). Therefore, the 'results' object should contain three lists of genes found to be significantly differentially expressed according to the limma method. These three lists are being visualized in a Venn diagram showing overlap between the lists (if any). The fact that all three Venn diagram circles intersect doesn't necessarily have anything to do with whether the comparisons are pairwise. Comparisons could possibly be done in some non-pairwise manner. But if more than one comparison was done, and the results of that comparison had overlap in their gene lists then the venn diagram would overlap.
design <- model.matrix(~ 0+factor(c(1,1,1,2,2,3,3,3)))
colnames(design) <- c("group1", "group2", "group3")
fit <- lmFit(eset, design)
contrast.matrix <- makeContrasts(group2-group1, group3-group2, group3-group1, levels=design)
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)
results <- decideTests(fit2)
To answer you questions specifically: (1) No, the 'makeContrasts' call does not do a three-way comparison implicitly. It was explicitly set up in this case to do a three-way comparison. But, it could have just done a two-way comparison with something like the following if you were only interested in comparing group2 and group3 to a common reference (imagine two different drug-treatments versus a single control).
contrast.matrix <- makeContrasts(group2-group1, group3-group1, levels=design)
(2) The portion of the venn diagram where A intersects B and intersects C represents those genes which were found to be significantly differentially expressed in all three comparisons. The area of A specific only to A represents those genes which were significantly differentially expressed in just one comparison (group2-group1) and not in either of the two other comparisons.
The code illustrated in this vignette is for a relatively simple scenario but can be re-worked for many other more complex situations. Keep digging into what is going on until you understand how it works and then you will be able to modify it to your own needs.