makeVenn(fit, contrast, design, groups = NULL, collist = NULL,
p.value = 0.05, lfc = 0, method = "both", adj.meth = "BH",
titleadd = NULL, fileadd = NULL, baseUrl = ".",
reportDirectory = "./venns", affy = TRUE, probecol = "PROBEID", ...)
makeContrasts
NULL
, all columns will
be used.decideTests
.MArrayLM
object that contains the Affymetrix IDs. Defaults to
"PROBEID", which is the expected result if the data are annotated using a BioC annotation package.vennSelect2
on the
columns specified by the collist argument. This is intended as input to
vennPage
, which will use those data to create the HTML page with Venn
diagrams with clickable links.decideTests
as well as the direction of differential
expression. This is a high-level function that calls vennSelect2
internally, and is intended to be used with vennPage
to create a set
of Venn diagrams (on an HTML page) that have clickable links in each cell of
the diagram. The links will then pass the end user to individual HTML pages
that contain the genes that are represented by the counts in a given cell of
the Venn diagram.In general, the only thing that is needed to create a set of Venn diagrams is a list of numeric vectors that indicate the columns of the contrast matrix that are to be used for a given diagram. See the example below for a better explanation.
Some important things to note: First, the names of the HTML and text tables
are extracted from the colnames
of the TestResults
object,
which come from the contrasts matrix, so it is important to use something
descriptive. Second, the method argument is analogous to the include
argument from vennCounts
or
vennDiagram
. Choosing "both" will select genes
that are differentially expressed in one or more comparisons, regardless of
direction. Choosing "up" or "down" will select genes that are only
differentially expressed in one direction. Choosing "same" will select genes
that are differentially expressed in the same direction. Choosing "sameup"
or "samedown" will select genes that are differentially expressed in the
same direction as well as 'up' or 'down'.
Note that this is different than sequentially choosing "up" and then "down". For instance, a gene that is upregulated in one comparison and downregulated in another comparison will be listed in the intersection of those two comparisons if "both" is chosen, it will be listed in only one comparison for both the "up" and "down" methods, and it will be listed in the union (e.g., not selected) if "same" is chosen.
Unlike vennSelect
, this function automatically creates both HTML and
CSV output files.
Also please note that this function relys on annotation information contained in the "genes" slot of the "fit" object. If there are no annotation data, then just statistics will be output in the resulting HTML tables.
mat <- matrix(rnorm(1e6), ncol = 20)
design <- model.matrix(~factor(1:4, each=5))
colnames(design) <- LETTERS[1:4]
contrast <- matrix(c(1,-1,0,0,1,0,-1,0,1,0,0,-1,0,1,-1,0,0,1,0,-1),
ncol = 5)
colnames(contrast) <- paste(LETTERS[c(1,1,1,2,2)],
LETTERS[c(2,3,4,3,4)], sep = " vs ")
fit <- lmFit(mat, design)
fit2 <- contrasts.fit(fit, contrast)
fit2 <- eBayes(fit2)
## two Venn diagrams - a 3-way Venn with the first three contrasts
## and a 2-way Venn with the last two contrasts
collist <- list(1:3,4:5)
venn <- makeVenn(fit2, contrast, design, collist = collist)
vennPage(venn, "index.html", "Venn diagrams")
Run the code above in your browser using DataLab