BASiCS_VarianceDecomp {BASiCS} | R Documentation

## Decomposition of gene expression variability according to BASiCS

### Description

Function to decompose total variability of gene expression into biological and technical components.

### Usage

    BASiCS_VarianceDecomp(Chain, OrderVariable = "BioVarGlobal",
      Plot = TRUE, main = "Overall variance decomposition",
      ylab = "% of variance", beside = FALSE, col = c("lightblue",
      "mistyrose", "lightcyan"), legend = c("Biological", "Technical",
      "Shot noise"), args.legend = list(x = "bottomright", bg = "white"),
      names.arg = if (nBatch > 1) {     c("Overall", paste("Batch ",
      seq_len(nBatch))) } else "Overall")

### Arguments

`Chain` | an object of class `BASiCS_Chain`
`OrderVariable` | Ordering variable for output. Possible values: `'GeneName'`, `'BioVarGlobal'`, `'TechVarGlobal'` and `'ShotNoiseGlobal'`. Default: `OrderVariable = "BioVarGlobal"`.
`Plot` | If `TRUE`, a barplot of the variance decomposition (global and by batches, if any) is generated. Default: `Plot = TRUE`.
`main, ylab, beside, col, legend, args.legend, names.arg` | Passed to `barplot`

### Details

See vignette

### Value

A `data.frame` whose first 4 columns correspond to

`GeneName`

  Gene name (as indicated by user)

`BioVarGlobal`

  Percentage of variance explained by a biological component (overall across all cells)

`TechVarGlobal`

  Percentage of variance explained by the technical component (overall across all cells)

`ShotNoiseGlobal`

  Percentage of variance explained by the shot noise component (baseline Poisson noise, overall across all cells)

If more than 1 batch of cells are being analysed, the remaining columns contain the corresponding variance decomposition calculated within each batch.

### Author(s)

Catalina A. Vallejos cnvallej@uc.cl

### References

Vallejos, Marioni and Richardson (2015). PLoS Computational Biology.

### See Also

`BASiCS_Chain`

### Examples

    # For illustration purposes we load a built-in 'BASiCS_Chain' object
    # (obtained using the 'BASiCS_MCMC' function)
    data(ChainSC)

    VD <- BASiCS_VarianceDecomp(ChainSC)

[Package BASiCS version 1.6.0 Index]