Reconstruction, Visualization, and Analysis of Branching Trajectories from Single-cell Expression Data

Software implementation by Daniel Christian Ellwanger

Department of Otolaryngology - Head & Neck Surgery, and Institute for Stem Cell Biology and Regenerative Medicine, Stanford University School of Medicine, Stanford, CA 94305, US

#   ____     _ _ _____          _ _

#  / ___|___| | |_   _| __ __ _(_) |___

# | |   / _ \ | | | || '__/ _` | | / __|

# | |__|  __/ | | | || | | (_| | | \__ \

#  \____\___|_|_| |_||_|  \__,_|_|_|___/


#  (c) Daniel C. Ellwanger, 2018.

CellTrails algorythm 

CellTrails is an unsupervised algorithm for the de novo chronological ordering, visualization and analysis of single-cell expression data. CellTrails makes use of a geometrically motivated concept of lower-dimensional manifold learning, which exhibits a multitude of virtues that counteract intrinsic noise of single cell data caused by drop-outs, technical variance, and redundancy of predictive variables. CellTrails enables the reconstruction of branching trajectories and provides an intuitive graphical representation of expression patterns along all branches simultaneously. It allows the user to define and infer the expression dynamics of individual and multiple pathways towards distinct phenotypes.

We confirmed that CellTrails can be applied to analysis of single-cell RNA-Seq datasets. We are pleased that you consider using CellTrails in your research. A detailed theoretical description of the algorithm and its application to biological uses has been published in:

Ellwanger, Daniel C., Mirko Scheibinger, Rachel A. Dumont, Peter G. Barr-Gillespie, and Stefan Heller. “Transcriptional Dynamics of Hair-Bundle Morphogenesis Revealed with CellTrails.” Cell Reports 23, no. 10 (June 2018): 2901-2914.e13.



CellTrails is an extension for R (, which is a free software environment for statistical computing and graphics. Please note that an installation of R is required for using CellTrails. A simple yet efficient way to work with R consists in writing source code with your favorite text editor and sending it to the R console. It is suggested to use a development environment, such as Rstudio (, or a rich text editor with R functionalities, such as Emacs (, which greatly eases the work. We also recommend to download and install the graph visualization software yEd ( It provides great capabilities to visualize and analyze a trajectory graph produced by CellTrails.



The CellTrails package itself can be installed directly from Bioconductor within an active R session:

if (!requireNamespace("BiocManager", quietly=TRUE))
BiocManager::install("CellTrails", version = "3.8")

Alternatively, the most recent developmental version can be obtained from Github using the devtools package within an active R session:

devtools::install_github("dcellwanger/CellTrails", build_vignettes=TRUE)


Load package

After its successful installation, the package can be loaded within an active R session as follows:




Version 1.7.1
+ Compatible with R 4.0.0
+ Bugfixes:
- Removed isSpike
- Resolved error with extracting latent space information at 'showTrajInfo'
- Resolved inverted color palette for 'plotManifold' and 'plotMaps'
- Resolved machine precision issue for 'findStates'

Version 1.0.0
+ Package published at Bioconductor

Version 0.99.15
+ Bugfixes:
- Adjusted NAMESPACE for most recent 'SingleCellExperiment' release

Version 0.99.14
+ Bugfixes:
- Filtering. Captures invalid user input.
- Clustering. Parameter settings resulting in a minimum number of samples per
initial state <= 1 are captured.

Version 0.99.13
+ Bugfixes:
- Visualization. Package is compatible with most recent 'ggplot2'
release (3.x.x).
+ Updated CITATION

Version 0.99.0 - 0.99.12
+ Public pre-release for Bioconductor submission
+ CellTrails is fully compatible with a 'SingleCellExperiment' object
+ Bugfixes

User Manual

The CellTrails Handbook is available here.