PowSim: Power Simulations for RNA-seq experiments

Description Usage Arguments Value Author(s) See Also Examples

Description

This function is a wrapper function including estimation, simulation and evaluation necessary for power analysis.

Usage

1
2
3
4
5
6
7
8
PowSim(input=NULL,
RNAseq=c('bulk', 'singlecell'),
ngenes=10000, nsims=25,
p.DE=0.1, LFC=NULL,
size.factors='equal',
n1=NULL, n2=NULL,
ncores=NULL, DEmethod=NULL,
save.plots=TRUE, verbose=TRUE)

Arguments

input

This can be one of the following: 1) NULL (Default): The parameters are defined by the function insilicoNBParam (see details). 2) A matrix of read counts with rows=genes and columns=samples. In this case, the user should provide the counts of one group only, as the 'MatchMoments' estimation framework is used. 3) If a character string is defined, then the precalculated negative binomial parameters are used (see details).

RNAseq

is a character value: "bulk" or "singlecell".

ngenes

Number of genes to be simulated. Default is 10000.

nsims

Number of simulations to run. Default is 25.

p.DE

Percentage of genes being differentially expressed (DE). Default is 10%.

LFC

The log2 fold change for DE genes. This can be: (1) a constant, e.g. 2; (2) a vector of values with length being number of DE genes. If the input is a vector and the length is not the number of DE genes, it will be sampled with replacement to generate log-fold change; (3) a function that takes an integer n, and generates a vector of length n, e.g. function(x) rnorm(x, mean=0, sd=1.5). The default is NULL, i.e. the log2 fold changes are defined by a gamma distribution: function(x) sample(c(-1,1), size=x,replace=T)*rgamma(x, 4, 2).

size.factors

Size factors representing sample-specific differences/biases in expected mean values of the NB distribution: "equal" or "given". The default is "equal", i.e. equal size factor of 1. If the user defines it as given, the size factors are sampled from the size factors provided by the output of estimateNBParam for count matrix input, precalculated estimates or defined as a sampling function (see details).

n1, n2

Integer vectors specifying the number of biological replicates in each group. Default values are n1=n2=c(2,4,6,10,15,20) and n1=n2=c(24,48,96,192,384,800) for single cell and bulk RNAseq experiments, respectively.

ncores

integer positive number of cores for parallel processing. Default is NULL, i.e. 1 core.

DEmethod

String to specify the DE detection method to be used. Available options are: edgeRglm, edgeRQL, DESeq2, limma, ROTS, baySeq, NOISeq, DSS, MAST, scde, BPSC, scDD. Default is limma for bulk and MAST for single cell RNA-seq experiments.

save.plots

Logical vector indicating whether plots should be saved as pdf files in the current working directory. Default is TRUE.

verbose

Logical vector indicating whether progress messages and additional notifications should be printed. Default is TRUE.

Value

Parameters

The parameters of the negative binomial. This will be estimated if an input is provided, a precalculated estimates (see details) or in silico parameters. For details, see the result values of estimateNBParam and insilicoNBParam, respectively.

SimulationResults

The results of differential expression simulation. For details, see the result values of simulateDE.

EvaluationResults

The results of error matrices evaluation. For details, see the result values of evaluateSim.

SummaryTable

The marginal TPR and FDR per sample sizes. For details, see printEvalRes.

MarginalPlot, ConditionalPLot

The marginal and conditional TPR and FDR plots. See plotEvalRes.

Author(s)

Beate Vieth

See Also

estimateNBParam, insilicoNBParam, DESetup, SimSetup, simulateDE, evaluateSim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## simulating in silico single cell RNAseq data
## DE testing with  MAST
## NOTE: If parallel computing is not possible, consider using DEmethod="ROTS"!
powsim <- PowSim(input=NULL,
RNAseq='singlecell',
ngenes=10000,
nsims=25,
p.DE=0.1,
LFC=function(x) sample(c(-1,1), size=x,replace=T)*rgamma(x, 3, 3),
size.factors='equal',
ncores=10,
DEmethod="MAST",
save.plots=TRUE, verbose=TRUE)

## End(Not run)

bvieth/powsim documentation built on May 13, 2019, 9:04 a.m.