Description Usage Arguments Details Value References See Also Examples
View source: R/esco-simulate.R
Simulate count data for a fictional single-cell RNA-seq experiment using a hierarchical copula model.
1 2 3 4 5 6 7 8 9 10 | escoSimulate(params = newescoParams(), type = c("single", "group",
"tree", "traj"), verbose = TRUE, numCores = 2, ...)
escoSimulateSingle(params = newescoParams(), verbose = TRUE, ...)
escoSimulateGroups(params = newescoParams(), verbose = TRUE, ...)
escoSimulateTree(params = newescoParams(), verbose = TRUE, ...)
escoSimulateTraj(params = newescoParams(), verbose = TRUE, ...)
|
params |
escoParams object to store simulation configurations in. |
type |
which type of heterogenounity to use. Options are : "single" which produces a single population; "group" which produces distinct groups; "tree" which produces distinct groups but admits a tree structure; "traj" which produces distinct groups but admits a smooth trajectory structure. |
verbose |
logical. Whether to print progress messages. |
numCores |
the number of cores used for parallelization, default is 2. If set as NULL, then all the detected cores are used. |
... |
any additional parameter settings to override what is provided in
|
Parameters can be set in a variety of ways. If no parameters are provided
the default parameters are used. We adopts the way in splatter
to set up parameters, particularly,
any parameters in escoParams
can be
overridden by supplying additional arguments through a call to
setParams
. This design allows the user flexibility in
how they supply parameters and allows small adjustments without creating a
new escoParams
object. See examples for a demonstration of how this
can be used.
The simulation involves the following steps:
Set up simulation object
Simulate library sizes
Simulate base mean for genes
Simulate cell structure (group / tree / trajectory) related differential factors
Simulate mean variance relationship adjusted mean for genes in different cells
Simulate true counts (with / without correlation)
Simulate techinical noise (zeroinflation / downsampling)
Create final dataset
The final output is a
SingleCellExperiment
object that
contains the simulated counts but also the values for various intermediate
steps, and the paramters used to generate the simulation.
These are stored in the colData
(for cell specific
information), rowData
(for gene specific information),
assays
(for gene by cell matrices),
or metadata
(for parameters configurations) slots.
SingleCellExperiment object containing the simulated counts and intermediate values.
Tian J, Wang J, Roeder K. ESCO: single cell expression simulation incorporating gene co-expression. bioRxiv. 2020.
Paper: https://www.biorxiv.org/content/10.1101/2020.10.20.347211v1
Code: https://github.com/JINJINT/ESCO
escoSimLib
,
escoSimGeneMeans
,
escoSimGroupDE
,
escoSimTreeDE
,
escoSimTrajDE
,
escoSimSingleCellMeans
,
escoSimGroupCellMeans
,
escoSimTreeCellMeans
,
escoSimTrajCellMeans
,
escoSimTrueCounts
,
escoSimZeroInflate
,
escoSimDownSample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Simulation with default parameters
sim <- escoSimulate()
# Simulation with different number of genes
# sim <- escoSimulate(nGenes = 1000)
# Simulation with custom parameters
params <- newescoParams(nGenes = 100, mean.rate = 0.5)
# sim <- escoSimulate(params)
# Simulation with adjusted custom parameters
# sim <- escoSimulate(params, mean.rate = 0.6, out.prob = 0.2)
# Simulate group
# sim <- escoSimulate(type = "group")
# Simulate tree
# sim <- escoSimulate(type = "tree")
# Simulate traj
# sim <- escoSimulate(type = "traj")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.