Description Usage Arguments Details Value Author(s) Examples
This function simulates count data from Negative-Binomial distribution for two-sample RNA-seq experiments with given mean, dispersion and fold change. A count data matrix is generated.
1 2 | sim.counts(nGenes = 10000, pi0 = 0.8, m, mu, disp, fc, up = 0.5,
replace = TRUE)
|
nGenes |
total number of genes, the default value is |
pi0 |
proportion of non-differentially expressed genes,
the default value is |
m |
sample size per treatment group. |
mu |
a vector (or scalar) of mean counts in control group from which to simulate. |
disp |
a vector (or scalar) of dispersion parameter from which to simulate. |
fc |
a vector (or scalar, or a function that takes an integer n and generates a vector of length n) of fold change for differentially expressed (DE) genes. |
up |
proportion of up-regulated genes among all DE genes,
the default value is |
replace |
sample with or without replacement from given parameters. See Details for more information. |
If the total number of genes nGenes
is larger
than length of mu
or disp
,
replace
always equals TRUE
.
counts |
RNA-seq count data matrix. |
group |
treatment group vector. |
lambda0 |
mean counts in control group for each gene. |
phi0 |
dispersion parameter for each gene. |
de |
differentially expressed genes indicator:
|
delta |
log2 fold change for each gene between treatment group and control group. |
Ran Bi biranpier@gmail.com, Peng Liu pliu@iastate.edu
1 2 3 4 5 6 7 8 9 10 11 12 | m <- 3 ## sample size per treatment group
mu <- 10 ## mean counts in control group for all genes
disp <- 0.1 ## dispersion for all genes
fc <- 2 ## 2-fold change for DE genes
sim <- sim.counts(m = m, mu = mu, disp = disp, fc = fc)
sim$counts ## count data matrix
## varying fold change
fc1 <- function(x){exp(rnorm(x, log(2), 0.5*log(2)))}
sim1 <- sim.counts(m = m, mu = mu, disp = disp, fc = fc1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.