metaseqrPlot {metaseqR2} | R Documentation

## Diagnostic plots for the metaseqR2 package

### Description

This is the main function for producing sructured quality control and informative graphs base on the results of the various steps of the metaseqR package. The graphs produced span a variety of issues like good sample reproducibility (Multi-Dimensional Scaling plot, biotype detection, heatmaps. diagplotMetaseqr, apart from implementing certain package-specific plots, is a wrapper around several diagnostic plots present in other RNA-Seq analysis packages such as EDASeq and NOISeq.

### Usage

        metaseqrPlot(object, sampleList, annotation = NULL,
            contrastList = NULL, pList = NULL,
            thresholds = list(p = 0.05, f = 1),
            plotType = c("mds", "biodetection", "countsbio",
                "saturation", "readnoise", "rnacomp", "correl",
                "pairs", "boxplot", "gcbias", "lengthbias",
                "meandiff", "meanvar", "deheatmap", "volcano",
                "biodist", "filtered", "mastat", "deregulogram",
                "statvenn", "foldvenn"),
            isNorm = FALSE, output = "x11", path = NULL, ...)

### Arguments

`object` | a matrix or a data frame containing count data derived before or after the normalization procedure, filtered or not by the metaseqR2's filters and/or p-value.
`sampleList` | the list containing condition names and the samples under each condition.
`annotation` | a data frame containing annotation elements for each row in object. See also Details.
`contrastList` | the vector of contrasts as defined in the main help page of `metaseqr2`.
`pList` | a list of p-values for each contrast as obtained from any of the `stat*` methods of the metaseqr package. See also Details.
`thresholds` | a list with the elements `"p"` and `"f"` which are the p-value and the fold change cutoff when `diagplotType="volcano"`.
`plotType` | one or more of the diagnostic plots supported in metaseqR2 package. See also Details.
`isNorm` | a logical indicating whether object contains raw or normalized data. It is not essential and it serves only plot annotation purposes.
`output` | one or more R plotting device to direct the plot result to. See Details.
`path` | the path to create output files.
`...` | further arguments to be passed to plot devices, such as parameter from `par`.

### Details

Regarding `object`, the object can be fed to any of the `diagplotMetaseqr` plotting systems but not every plot is meaningful. For example, it's meaningless to create a `"biodist"` plot for a count matrix before normalization or statistical testing.

Regarding `annotation`, usually, it is a subset of the annotation obtained by `getAnnotation` or a subset of possibly embedded annotation with the input counts table. This parameter is optional and required only when diagplotType is any of `"biodetection"`, `"countsbio"`, `"saturation"`, `"rnacomp"`, `"readnoise"`, `"biodist"`, `"gcbias"`, `"lengthbias"` or `"filtered"`.

Regarding `contrastList`, this parameter is optional and required only when `diagplotType` is any of `"deheatmap"`, `"volcano"` or `"biodist"`. It can also be a named structured list of contrasts as returned by the internal function `metaseqR2:::makeContrastList`.

Regarding `diagplotType`, many of these plots require the presence of additional package, something that is checked while running the main metaseqr2 function. The supported plots are `"mds"`, `"biodetection"`, `"countsbio"`, `"saturation"`, `"rnacomp"`, `"boxplot"`, `"gcbias"`, `"lengthbias"`, `"meandiff"`, `"meanvar"`, `"deheatmap"`, `"volcano"`, `"biodist"`, `"filtered"`, `"readnoise"`, `"venn"`, `"correl"`, `"pairwise"`. For a brief description of these plots please see the main `metaseqr2` help page.

Regarding `pList`, this parameter is optional and required only when `diagplotType` is any of `"deheatmap"`, `"volcano"` or `"biodist"`.

Regarding `output`, supported mechanisms are: `"png"`, `"jpg"`, `"bmp"`, `"pdf"`, `"ps"` or `"json"`. The latter is currently available for the creation of interactive volcano plots only when reporting the output, through the highcharts javascript library. The default plotting (`"x11"`) is not supported due to instability in certain devices.

### Value

A named list containing the file names of the produced plots. Each list member is names according to the selected plotting device and is also a named list, whose names are the plot types. The final contents are the file names in case the plots are written to a physical location (not meaningful for `"x11"`).

### Note

In order to make the best out of this function, you should generally provide the annotation argument as most and also the most informative plots depend on this. If you don't know what is inside your counts table or how many annotation elements you can provide by embedding it, it's always best to setup a local databse so as to use predefined annotations that work better with the functions of the whole package.

### Author(s)

Panagiotis Moulos

### Examples

    dataMatrix <- metaseqR2:::exampleCountData(2000)
    sampleList <- list(A=c("A1","A2"),B=c("B1","B2","B3"))
    contrast <- "A_vs_B"
    metaseqrPlot(dataMatrix,sampleList,plotType=c("mds","boxplot"))

    normArgs <- getDefaults("normalization","deseq2")
    object <- normalizeDeseq2(dataMatrix,sampleList,normArgs)
    metaseqrPlot(object,sampleList,plotType="boxplot")

    ## More
    #p <- statDeseq2(object,sampleList)
    #metaseqrPlot(object,sampleList,contrastList=contrast,pList=p,
    #    plotType="volcano")

[Package metaseqR2 version 1.0.11 Index]