pseudotimeDE: Perform Differential Expression Test on One Gene

View source: R/PseudotimeDE.R

pseudotimeDER Documentation

Perform Differential Expression Test on One Gene

Description

Test if one gene is differentially expressed along pseudotime.

Usage

pseudotimeDE(
  gene,
  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"
)

Arguments

gene

A string of gene name. It should be one 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 SingleCellExperment 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 reults 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. Used for saving time since ZINB-GAM is computationally intense.

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 parametricfitting of null distribution.

quant

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

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'.

Value

A list with the components:

fix.pv

The p-value assuming the pseudotime is fixed

emp.pv

The permutation p-value

para.pv

The permutation p-value by fitting a parametric null distribution

ad.pv

P-value of Anderson-Darling test on comparing null distribution and its parametric fit

rank

The estimated effect degree of freedom of the original model

gam.fit

The fitted gam model on original data

zinf

Whether the model is zero inflated

aic

The AIC of the orignial model

expv.quantile

Quantiles of the log counts plus 1

expv.mean

Mean of the log counts plus 1

expv.zero

Zero proportions of counts

Author(s)

Dongyuan Song, Shiyu Ma


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