Skip to contents

Perform trajectory-based differential expression analysis using negative binomial regression. This function tests for genes that change expression along a continuous trajectory variable.

Usage

TrajDETest(object, ...)

# Default S3 method
TrajDETest(
  object,
  traj.var = NULL,
  latent.vars = NULL,
  features = NULL,
  fc.results = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
TrajDETest(
  object,
  layer = "counts",
  traj.var = NULL,
  latent.vars = NULL,
  samples = NULL,
  features = NULL,
  logfc.threshold = 0,
  prob.break.point = c(1/3, 2/3),
  min.pct = 0.1,
  min.count = 10,
  pseudocount.use = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
TrajDETest(
  object,
  layer = "counts",
  traj.var = NULL,
  latent.vars = NULL,
  samples = NULL,
  features = NULL,
  logfc.threshold = 0,
  prob.break.point = c(1/3, 2/3),
  min.pct = 0.1,
  min.count = 10,
  pseudocount.use = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
TrajDETest(
  object,
  assay = NULL,
  layer = "counts",
  traj.var = NULL,
  latent.vars = NULL,
  samples = NULL,
  features = NULL,
  logfc.threshold = 0,
  prob.break.point = c(1/3, 2/3),
  min.pct = 0.1,
  min.count = 10,
  pseudocount.use = 1,
  complete.resutls = FALSE,
  verbose = TRUE,
  ...
)

Arguments

object

Expression data matrix, Assay, StdAssay, or Seurat object

...

additional parameters to be passed to glmGamPoi::glm_gp or filterByExpr

traj.var

a data frame containing the trajectory variable of the samples to be tested against

latent.vars

a data frame containing the latent variables (e.g., covariates that might affect the gene expression) to include in regression.

features

Genes to test. Default is to use all genes (after QC)

fc.results

fc.results calculated by FoldChange(); if not null QC will be performed based on this

verbose

Print a progress bar once expression testing begins

layer

the data layer to be used for trajectory DE test. Currently only 'counts' is supported.

samples

the cells/samples to be included in the DE test

logfc.threshold

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the top and bottom groups of samples (see pro.break.point for details). Default is 0 (i.e., no filtering).

prob.break.point

a numeric vector of probability break points with values in (0, 1). It will be used to calculate 2 quantiles along the trajectory and to calculate the logfc.

min.pct

only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations.

min.count

Minimum count threshold for gene filtering

pseudocount.use

Pseudocount to add to averaged expression values when calculating logFC. 1 by default.

assay

the assay to be used (for Seurat objects)

complete.resutls

Whether to return complete results or summary

Value

A data frame with differential expression results

Examples

if (FALSE) { # \dontrun{
# Run trajectory DE test on a Seurat object
de_results <- TrajDETest(seurat_obj, traj.var = "pseudotime")
} # }