scde.posteriors | R Documentation |
Calculates expression magnitude posteriors for the individual cells, and then uses bootstrap resampling to calculate a joint expression posterior for all the specified cells. Alternatively during batch-effect correction procedure, the joint posterior can be calculated for a random composition of cells of different groups (see batch
and composition
parameters).
scde.posteriors(models, counts, prior, n.randomizations = 100, batch = NULL,
composition = NULL, return.individual.posteriors = FALSE,
return.individual.posterior.modes = FALSE, ensemble.posterior = FALSE,
n.cores = 20)
models |
models models determined by |
counts |
read count matrix |
prior |
gene expression prior as determined by |
n.randomizations |
number of bootstrap iterations to perform |
batch |
a factor describing which batch group each cell (i.e. each row of |
composition |
a vector describing the batch composition of a group to be sampled |
return.individual.posteriors |
whether expression posteriors of each cell should be returned |
return.individual.posterior.modes |
whether modes of expression posteriors of each cell should be returned |
ensemble.posterior |
Boolean of whether to calculate the ensemble posterior (sum of individual posteriors) instead of a joint (product) posterior. (default: FALSE) |
n.cores |
number of cores to utilize |
a posterior probability matrix, with rows corresponding to genes, and columns to expression levels (as defined by prior$x
)
a list is returned, with the $jp
slot giving the joint posterior matrix, as described above. The $modes
slot gives a matrix of individual expression posterior mode values on log scale (rows - genes, columns -cells)
a list is returned, with the $post
slot giving a list of individual posterior matrices, in a form analogous to the joint posterior matrix, but reported on log scale
data(es.mef.small)
cd <- clean.counts(es.mef.small, min.lib.size=1000, min.reads = 1, min.detected = 1)
data(o.ifm) # Load precomputed model. Use ?scde.error.models to see how o.ifm was generated
o.prior <- scde.expression.prior(models = o.ifm, counts = cd, length.out = 400, show.plot = FALSE)
# calculate joint posteriors
jp <- scde.posteriors(o.ifm, cd, o.prior, n.cores = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.