diagplotVenn: Venn diagrams when performing meta-analysis

View source: R/plot.R

diagplotVennR Documentation

Venn diagrams when performing meta-analysis

Description

This function uses the R package VennDiagram and plots an up to 5-way Venn diagram depicting the common and specific to each statistical algorithm genes, for each contrast. Mostly for internal use because of its main argument which is difficult to construct, but can be used independently if the user grasps the logic.

Usage

    diagplotVenn(pmat, fcmat = NULL, pcut = 0.05,
        fcut = 0.5, direction = c("dereg", "up", "down"),
        nam = as.character(round(1000 * runif(1))),
        output = "x11", path = NULL, altNames = NULL, ...)

Arguments

pmat

a matrix with p-values corresponding to the application of each statistical algorithm. See also Details.

fcmat

an optional matrix with fold changes corresponding to the application of each statistical algorithm. See also Details.

pcut

if fcmat is supplied, an absolute fold change cutoff to be applied to fcmat to determine the differentially expressed genes for each algorithm.

fcut

a p-value cutoff for statistical significance. Defaults to 0.05.

direction

if fcmat is supplied, a keyword to denote which genes to draw in the Venn diagrams with respect to their direction of regulation. See Details.

nam

a name to be appended to the output graphics file (if "output" is not "x11").

output

one or more R plotting device to direct the plot result to. Supported mechanisms: "x11" (default), "png", "jpg", "bmp", "pdf" or "ps".

path

the path to create output files. If "path" is not NULL, a file with the intersections in the Venn diagrams will be produced and written in "path".

altNames

an optional named vector of names, e.g. HUGO gene symbols, alternative or complementary to the unique gene names which are the rownames of pmat. The names of the vector must be the rownames of pmat.

...

further arguments to be passed to plot devices, such as parameter from par.

Details

Regarding pmat, the p-value matrix must have the colnames attribute and the colnames should correspond to the name of the algorithm used to fill the specific column (e.g. if "statistics"=c("deseq","edger", "nbpseq") then colnames(pmat) <- c("deseq","edger","nbpseq").

Regarding fcmat, the fold change matrix must have the colnames attribute and the colnames should correspond to the name of the algorithm used to fill the specific column (see the parameter pmat).

Regarding direction, it can be one of "dereg" for the total of regulated genes, where abs(fcmat[,n])>=fcut (default), "up" for the up-regulated genes where fcmat[,n]>=fcut or "down" for the up-regulated genes where fcmat[,n]<=-fcut.

Value

The filenames of the plots produced in a named list with names the which.plot argument. If output="x11", no output filenames are produced.

Author(s)

Panagiotis Moulos

Examples

require(VennDiagram)
p1 <- 0.01*matrix(runif(300),100,3)
p2 <- matrix(runif(300),100,3)
p <- rbind(p1,p2)
rownames(p) <- paste("gene",1:200,sep="_")
colnames(p) <- paste("method",1:3,sep="_")
vennContents <- diagplotVenn(p)

pmoulos/metaseqR2-local documentation built on March 15, 2024, 10:58 p.m.