runPseudotimeDE: Perform Differential Expression Test on a List of Genes

View source: R/runPseudotimeDE.R

runPseudotimeDER Documentation

Perform Differential Expression Test on a List of Genes

Description

Test if each gene in a list of genes is differentially expressed along pseudotime. A wrapper of PseudotimeDE::pseudotimeDE.

Usage

runPseudotimeDE(
  gene.vec,
  ori.tbl,
  sub.tbl,
  mat,
  assay.use = "counts",
  model = c("nb", "zinb", "gaussian", "auto", "qgam"),
  k = 6,
  knots = c(0:5/5),
  fix.weight = TRUE,
  aicdiff = 10,
  seed = 123,
  quant = 0.5,
  usebam = FALSE,
  formula = NULL,
  seurat.assay = "RNA",
  mc.cores = 2,
  mc.preschedule = TRUE,
  SIMPLIFY = TRUE
)

Arguments

gene.vec

A vector of genes. It should be a subset of the row names in sce.

ori.tbl

A tibble or dataframe which contains the original cells and pseudotime as two columns.

sub.tbl

A list of tibbles or dataframes where each is the fit of a subsample. Each element is the same format as ori.tbl.

mat

The input expression data. It can be: (1) A SingleCellExperiment object which contain the expression data; (2) An matrix; (3) A Seurat object which contain the expression data. Its row names should be genes and col names should be cells.

assay.use

The assay used in SingleCellExperiment or slot used in Seurat. Default is counts.

model

A string of the model name. One of nb, zinb, gaussian, auto and qgam.

k

A integer of the basis dimension. Default is 6. The results are usually robust to different k; we recommend to use k from 5 to 10.

knots

A numeric vector of the location of knots. Default is evenly distributed between 0 to 1. For instance, if your k = 6, and your range is [0, 10], then the position of knots should be c(0:5)*(10-0).

fix.weight

A logic variable indicating if the ZINB-GAM will use the zero weights from the original model.

aicdiff

A numeric variable of the threshold of model selection. Only works when model = `auto`.

seed

A numeric variable of the random seed. It mainly affects the fitting of null distribution.

quant

The quantile of interest for quantile regression (qgam), range from 0 to 1, default as 0.5 (median).

usebam

A logical variable. If use mgcv::bam, which may be faster with large sample size (e.g., > 10'000 cells).

formula

An (optional) custom formula to be passed to mgcv::gam, mgcv::bam, or qgam::qgam.

seurat.assay

The assay used in Seurat. Default is 'RNA'.

mc.cores

Number of cores for computing.

mc.preschedule

See mclapply. Default is TRUE.

SIMPLIFY

A logic variable whether to return a tibble (TRUE) or a list of lists (FALSE). Default is TRUE.

Value

A tibble of summary results of genes

Author(s)

Dongyuan Song, Shiyu Ma

Examples

data("LPS_sce")
data("LPS_ori_tbl")
data("LPS_sub_tbl")
res <- PseudotimeDE::runPseudotimeDE(gene.vec = c("CCL5", "CXCL10"),
ori.tbl = LPS_ori_tbl, sub.tbl = LPS_sub_tbl[1:10], mat = LPS_sce, model = "nb")


SONGDONGYUAN1994/PseudotimeDE documentation built on Nov. 2, 2024, 7:55 p.m.