scde.test.gene.expression.difference: Test differential expression and plot posteriors for a...

View source: R/functions.R

scde.test.gene.expression.differenceR Documentation

Test differential expression and plot posteriors for a particular gene

Description

The function performs differential expression test and optionally plots posteriors for a specified gene.

Usage

scde.test.gene.expression.difference(gene, models, counts, prior,
  groups = NULL, batch = NULL, batch.models = models,
  n.randomizations = 1000, show.plots = TRUE, return.details = FALSE,
  verbose = FALSE, ratio.range = NULL, show.individual.posteriors = TRUE,
  n.cores = 1)

Arguments

gene

name of the gene to be tested

models

models

counts

read count matrix (must contain the row corresponding to the specified gene)

prior

expression magnitude prior

groups

a two-level factor specifying between which cells (rows of the models matrix) the comparison should be made

batch

optional multi-level factor assigning the cells (rows of the model matrix) to different batches that should be controlled for (e.g. two or more biological replicates). The expression difference estimate will then take into account the likely difference between the two groups that is explained solely by their difference in batch composition. Not all batch configuration may be corrected this way.

batch.models

optional set of models for batch comparison (typically the same as models, but can be more extensive, or recalculated within each batch)

n.randomizations

number of bootstrap/sampling iterations that should be performed

show.plots

whether the plots should be shown

return.details

whether the posterior should be returned

verbose

set to T for some status output

ratio.range

optionally specifies the range of the log2 expression ratio plot

show.individual.posteriors

whether the individual cell expression posteriors should be plotted

n.cores

number of cores to use (default = 1)

Value

by default returns MLE of log2 expression difference, 95

Examples

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)
scde.test.gene.expression.difference("Tdh", models = o.ifm, counts = cd, prior = o.prior)


hms-dbmi/scde documentation built on April 19, 2023, 10:21 p.m.