Description Usage Arguments See Also Examples
This function simulates a count matrix for a scRNA-seq experiment based on parameters estimated from a real scRNA-seq count matrix. Global patterns of zero abundance as well as feature-specific mean-variance relationships are retained in the simulation.
1 2 3 4 |
dataset |
An expression matrix representing the dataset on which the simulation is based. |
group |
Group indicator specifying the attribution of the samples to the different conditions of interest that are being simulated. |
nTags |
The number of features (genes) to simulate. $1000$ by default |
nlibs |
The number of samples to simulate. Defaults to |
lib.size |
The library sizes for the simulated samples. If |
drop.extreme.dispersion |
Only applicable if |
pUp |
Numeric value between $0$ and $1$ ($0.5$ by default) specifying the proportion of differentially expressed genes that show an upregulation in the second condition. |
foldDiff |
The fold changes used in simulating the differentially expressed genes. Either one numeric value for specifying the same fold change for all DE genes, or a vector of the same length as |
verbose |
Logical, stating whether progress be printed. |
ind |
Integer vector specifying the rows of the count matrix that represent differential features. |
params |
An object containing feature-wise parameters used for simulation as created by |
randomZero |
A numeric value between $0$ and $1$ specifying the random fraction of cells that are set to zero after simulating the expression count matrix. Defaults to $0$. |
min.dispersion |
The minimum dispersion value to use for simulation. $0.1$ by default. |
max.dipserion |
The maximum dispersion value to use for simulation. $400$ by default. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(islamEset,package="zingeR")
islam=exprs(islamEset)[1:2000,]
design=model.matrix(~pData(islamEset)[,1])
gamlss.tr::gen.trun(par=0, family="NBI", name="ZeroTruncated", type="left", varying=FALSE)
params = getDatasetZTNB(counts=islam, design=design)
nSamples=80
grp=as.factor(rep(0:1, each = nSamples/2)) #two-group comparison
nTags=2000 #nr of features
set.seed(436)
DEind = sample(1:nTags,floor(nTags*.1),replace=FALSE) #10% differentially expressed
fcSim=(2 + rexp(length(DEind), rate = 1/2)) #fold changes
libSizes=sample(colSums(islam),nSamples,replace=TRUE) #library sizes
simDataIslam <- NBsimSingleCell(foldDiff=fcSim, ind=DEind, dataset=islam, nTags=nTags, group=grp, verbose=TRUE, params=params, lib.size=libSizes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.