transcriptionalVarianceExplained: transcriptionalVarianceExplained

Description Usage Arguments Value

View source: R/varianceExplained.R

Description

Computes for each gene the variance explained by each variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
transcriptionalVarianceExplained(
  res = NULL,
  unit = "tpm",
  logTransform = T,
  variables = c("sex", "individual"),
  doPlot = TRUE,
  mixed = TRUE,
  formula = NULL,
  ncores = NULL
)

Arguments

unit

Either "tpm" (default), "fpkm", or "counts".

logTransform

Logical; whether to log-transform the data (default T).

variables

The explanatory variables to include. Default "sex" and "individual"

doPlot

Logical; whether to plot a summary of the results (default TRUE; requires packages 'beanplot' and 'LSD' to be installed)

mixed

Logical; whether to use mixed models (via 'lme4') (default TRUE).

formula

Specify the formula to use. If specified, this overrides the 'variables' argument. If 'mixed=F', the default formula is '~.'; if 'mixed=T', each variable is considered a random variable.

ncores

The number of threads (by defaults uses all but 1 cores)

Value

a dataframe containing the square residuals, with genes as rows and explanatory variables as columns (plus a first column containing the gene's mean expression).


plger/iPSCpoweR documentation built on Feb. 2, 2022, 1:37 a.m.