plotRowStats {psichomics} | R Documentation

## Plot sample statistics per row

### Description

Plot sample statistics per row

### Usage

    plotRowStats(data, x, y, xmin = NULL, xmax = NULL, ymin = NULL,
      ymax = NULL, xlim = NULL, ylim = NULL)

### Arguments

`data` | Data frame or matrix
`x, y` | Character: statistic to calculate and display in the plot per row; choose between `mean`, `median`, `var` or `range` (or transformations of those variables, e.g. `log10(var)`)
`xmin, xmax, ymin, ymax` | Numeric: minimum and maximum X and Y values to draw in the plot
`xlim, ylim` | Numeric: X and Y axis range

### Value

Plot of `data`

### Examples

    library(ggplot2)

    # Plotting gene expression data
    geneExpr <- readFile("ex_gene_expression.RDS")
    plotRowStats(geneExpr, "mean", "var^(1/4)") +
        ggtitle("Mean-variance plot") +
        labs(y="Square Root of the Standard Deviation")

    # Plotting alternative splicing quantification
    annot <- readFile("ex_splicing_annotation.RDS")
    junctionQuant <- readFile("ex_junctionQuant.RDS")
    psi <- quantifySplicing(annot, junctionQuant, eventType=c("SE", "MXE"))

    medianVar <- plotRowStats(psi, x="median", y="var", xlim=c(0, 1)) +
        labs(x="Median PSI", y="PSI variance")
    medianVar

    rangeVar  <- plotRowStats(psi, x="range", y="log10(var)", xlim=c(0, 1)) +
        labs(x="PSI range", y="log10(PSI variance)")
    rangeVar

[Package psichomics version 1.8.2 Index]