# install.packages("devtools") # if devtools not already installed
devtools::install_github("kieranrcampbell/switchde")
Introduction
switchde is an R package for detecting switch-like differential expression along single-cell RNA-seq trajectories. It assumes genes follow a sigmoidal pattern of gene expression and tests for differential expression using a likelihood ratio test. It also returns maximum likelihood estimates (MLE) for the sigmoid parameters, which allows filtering of genes for up or down regulation as well as where along the trajectory the regulation occurs.
The parametric form of gene expression assumed is sigmoidal:
Governed by three parameters:
mu_0 The half-peak expression
k The ‘activation strength’. If positive, the gene is upregulated along the trajectory; if negative, the gene is downregulated. The magnitude of k corresponds to how fast the gene is up or down regulated.
t_0 The ‘activation time’, or where in the trajectory this behaviour occurs. Note this parameter should be interpreted with respect to the overall range of the pseudotimes supplied.
Usage
switchde accepts either an SingleCellExperiment from SingleCellExperiment or a matrix of gene expression measurents. These should ideally be in log(TPM + 1) form, but any logged non-negative expression measurements will work.
We begin with an SingleCellExperiment called sce, or equivalently a gene-by-cell expression matrix X = assay(sce, "exprs"). We also require a pseudotime vector pseudotime. Then call
switchde
Inference of switch-like differential expression along single-cell trajectories
Installation
switchdeis available on both Bioconductor and Github.Installation from Bioconductor
Installation from Github using Devtools
Introduction
switchdeis anRpackage for detecting switch-like differential expression along single-cell RNA-seq trajectories. It assumes genes follow a sigmoidal pattern of gene expression and tests for differential expression using a likelihood ratio test. It also returns maximum likelihood estimates (MLE) for the sigmoid parameters, which allows filtering of genes for up or down regulation as well as where along the trajectory the regulation occurs.The parametric form of gene expression assumed is sigmoidal:
Governed by three parameters:
mu_0The half-peak expressionkThe ‘activation strength’. If positive, the gene is upregulated along the trajectory; if negative, the gene is downregulated. The magnitude ofkcorresponds to how fast the gene is up or down regulated.t_0The ‘activation time’, or where in the trajectory this behaviour occurs. Note this parameter should be interpreted with respect to the overall range of the pseudotimes supplied.Usage
switchdeaccepts either anSingleCellExperimentfrom SingleCellExperiment or a matrix of gene expression measurents. These should ideally be inlog(TPM + 1)form, but any logged non-negative expression measurements will work.We begin with an
SingleCellExperimentcalledsce, or equivalently a gene-by-cell expression matrixX = assay(sce, "exprs"). We also require a pseudotime vectorpseudotime. Then callor equivalently
This outputs a
data.framewith six columns:with columns:
geneThe gene name, taken from eitherfeatureNames(sce)orrowNames(X)pvalThe p-value associated with differential expressionqvalThe Benjamini-Hochberg corrected q-value associated with differential expressionmu0The MLE estimate ofmu_0kThe MLE estimate ofkt0The MLE estimate oft_0We can also extract the parameters and plot the results:
Authors
Kieran Campbell & Christopher Yau
Wellcome Trust Centre for Human Genetics, University of Oxford