View source: R/kersplat-simulate.R
kersplatSample | R Documentation |
Sample cells for the Kersplat simulation
kersplatSample(params, sparsify = TRUE, verbose = TRUE)
params |
KersplatParams object containing simulation parameters. |
sparsify |
logical. Whether to automatically convert assays to sparse matrices if there will be a size reduction. |
verbose |
logical. Whether to print progress messages |
The second stage is a two-step Kersplat simulation is to generate cells based
on a complete KersplatParams
object.
intermediate parameters.
The sampling process involves the following steps:
Simulate library sizes for each cell
Simulate means for each cell
Simulate endogenous counts for each cell
Simulate ambient counts for each cell
Simulate final counts for each cell
The final output is a
SingleCellExperiment
object that
contains the simulated counts but also the values for various intermediate
steps. These are stored in the colData
(for cell specific
information), rowData
(for gene specific information) or
assays
(for gene by cell matrices) slots. This additional
information includes:
colData
Unique cell identifier.
Whether the cell is a Cell, Doublet or Empty.
The expected number of endogenous counts for that cell.
The expected number of ambient counts for that cell.
The path the cell belongs to.
How far along the path each cell is.
For doublets the path of the first partner in the
doublet (otherwise NA
).
For doublets the step of the first partner in the
doublet (otherwise NA
).
For doublets the path of the second partner in the
doublet (otherwise NA
).
For doublets the step of the second partner in the
doublet (otherwise NA
).
rowData
Unique gene identifier.
The base expression level for that gene.
The ambient expression level for that gene.
assays
The mean expression of genes in each cell after any differential expression and adjusted for expected library size.
Endogenous count matrix.
Ambient count matrix.
Final count matrix.
Values that have been added by Splatter are named using UpperCamelCase
in order to differentiate them from the values added by analysis packages
which typically use underscore_naming
.
SingleCellExperiment object containing the simulated counts and intermediate values.
kersplatSimLibSizes
, kersplatSimCellMeans
,
kersplatSimCellCounts
, kersplatSimAmbientCounts
,
kersplatSimCounts
if (requireNamespace("igraph", quietly = TRUE)) {
params <- kersplatSetup()
sim <- kersplatSample(params)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.