runPower: Function runPower (DGE.Tools2)

Description Usage Arguments Details Value Author(s) Examples

View source: R/runPower.R

Description

Take a counts matrix and design matrix and return a power analysis using the RNASeqPower package. The counts matrix should be prefiltered to remove non-expressed genes by your favorite filtering critera. The design matrix should describe the major sources of variation so the procedure can dial out those known effects for the power calculations.

Usage

1
2
3
4
5
6
7
8
9
runPower(
  counts,
  designMatrix,
  depth = c(10, 100, 1000),
  N = c(3, 6, 10, 20),
  FDR = c(0.05, 0.1),
  effectSize = c(1.2, 1.5, 2),
  return = "both"
)

Arguments

counts

A counts matrix (required)

designMatrix

A design matrix (required)

depth

A set of depth to use in the calculations. The default depths of c(10, 100, 1000) respectively represent a detection limit, below average expression and median expression levels, express in readcount units.

N

A set of N value to report power for (default = c(3, 6, 10, 20))

effectSize

A set of fold change values to test (default = c(1.2, 1.5, 2))

return

One of "dataframe", "plots", "both" (default = "both"). Two plots are generated; a ROC curve (FDR vs Power) and a plot of N vs Power.

Details

If return = "dataframe" the function will return a tall skinny dataframe of power calculation for various requested combinations of N and signficance thresholds. If return = "plots" or "both", a list is returned with two ggplots (plots) or the plots plus the dataframe (both).

Value

A list of result objects defined by the "return" argument.

Author(s)

John Thompson, jrt@thompsonclan.org

Examples

1
   MyResults <- runPower(counts, designMatrix)

jrthompson54/DGE.Tools2 documentation built on May 12, 2021, 8:47 p.m.