Skip to contents

ENTRAIN is an R and python package for analysis of single-cell RNA sequencing data.

The purpose of ENTRAIN is to predict how the cellular environment shapes cellular differentiation, and quantify the relative contribution of cell-cell communication versus cell-intrinsic mechanisms towards cell fate specification. If you have a dataset of cells that lie along a differentiation trajectory, and/or exhibit robust RNA velocity dynamics, then ENTRAIN will help you generate hypotheses for identifying the environmental signals that are driving your observed dynamics.

As input, ENTRAIN takes single-cell RNA sequencing data (and optionally, RNA velocities), and integrates with the regulatory databases to predict how cell-cell communication can play a role in cellular maturation and decision making.

ENTRAIN is based on, and can be considered a unification, of three previously separate streams of single-cell analysis: Trajectory Analysis (with monocle3), cell-cell communication/regulation (with NicheNet), and RNA Velocity (with scvelo). Furthermore, ENTRAIN works directly with popular single-cell data types, namely Seurat objects and anndata objects.

Installation

ENTRAIN is available through Github, using devtools:

if (!require(devtools)){
    install.packages("devtools")
}
devtools::install_github(c("satijalab/seurat-wrappers", "theimagelab/entrain"))
  • seurat-wrappers installation sometimes fails because it cannot find R.utils. If that occurs, try running install.packages("R.utils") first.

ENTRAIN is also available as a python package through pypi:

conda install squidpy scanpy rpy2 scvelo adjusttext r-randomforest
pip install tangram-sc
pip install pypath-omnipath

pip install entrain

Configuring Reticulate (Entrain-Velocity in R only).

Python users can skip this. For users wishing to run ENTRAIN analysis on RNA velocity data, you can do this in both R and Python. If you wish to do this in R, we we require you to install reticulate, an R interface to python for natively manipulating RNA velocity data created by scvelo. The following code installs reticulate, python (via Miniconda), and a few python packages into a standalone conda virtual environment called r-reticulate-sc. This conda environment will be isolated from any other python environments on your system, preventing package conflicts.

reticulate::install_miniconda()
reticulate::conda_create("r-reticulate-sc")
reticulate::conda_install("r-reticulate-sc", "scanpy", "leidenalg", "python-igraph", "adjustText", channel="conda-forge")
reticulate::conda_install("r-reticulate-sc", "scvelo", channel="bioconda")
reticulate::use_condaenv("r-reticulate-sc")

Using Entrain

ENTRAIN has three types of analysis. Read one of the example vignettes to learn how to use Entrain.

  1. Analysis of Pseudotime-based trajectories.

  2. Analysis of RNA Velocity-based trajectories in R and Python

  3. Analysis of RNA Velocity-based trajectories in spatially resolved datasets (PYTHON ONLY).