diagplot.venn {metaseqR} | R 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

        diagplot.venn(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, alt.names = NULL, ...)

### Arguments

`pmat` | a matrix with p-values corresponding to the application of each statistical algorithm. 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")`.
`fcmat` | an optional matrix with fold changes corresponding to the application of each statistical algorithm. 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`).
`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. 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`.
`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"`.
`alt.names` | 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`.

### 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="_")
    venn.contents <- diagplot.venn(p)

[Package metaseqR version 1.26.0 Index]