PHATE - Potential of Heat-Diffusion for Affinity-Based Transition Embedding

PHATE is a tool for visualizing high dimensional single-cell data with natural progressions or trajectories. PHATE uses a novel conceptual framework for learning and visualizing the manifold inherent to biological systems in which smooth transitions mark the progressions of cells from one state to another. To see how PHATE can be applied to single-cell RNA-seq datasets from hematopoietic stem cells, human embryonic stem cells, and bone marrow samples, check out our publication in Nature Biotechnology at .

phateR v0.4.0

Latest PyPIversion Latest CRANversion Travis CIBuild Read theDocs bioRxivPreprint Twitter GithubStars

This R package provides an implementation of the PHATE dimensionality reduction and visualization method.

For a thorough overview of the PHATE visualization method, please see the bioRxiv preprint

For our Python and Matlab implementations, please see KrishnaswamyLab/PHATE.


In order to use PHATE in R, you must also install the Python package.

If python or pip are not installed, you will need to install them. We recommend Miniconda3 to install Python and pip together, or otherwise you can install pip from

Installation from CRAN and PyPi

First install phate in Python by running the following code from a terminal:

pip install --user phate

Then install phateR from CRAN by running the following code in R:


Installation with devtools and reticulate

The development version of PHATE can be installed directly from R with devtools:

if (!suppressWarnings(require(devtools))) install.packages("devtools")
reticulate::py_install("phate", pip=TRUE)

Installation from source

The latest source version of PHATE can be accessed by running the following in a terminal:

git clone --recursive git://
cd PHATE/Python
python install --user
cd ../phateR

If the phateR folder is empty, you have may forgotten to use the --recursive option for git clone. You can rectify this by running the following in a terminal:

git submodule init
git submodule update
cd Python
python install --user
cd ../phateR

Quick Start

If you have loaded a data matrix data in R (cells on rows, genes on columns) you can run PHATE as follows:

data_phate <- phate(data)

phateR accepts R matrices, Matrix sparse matrices, data.frames, and any other data type that can be converted to a matrix with the function as.matrix.


This is a basic example running phate on a highly branched example dataset that is included with the package. You can read a tutorial on running PHATE on single-cell RNA-seq at or in inst/examples. Running this tutorial from start to finish should take approximately 3 minutes.

First, let’s load the tree data and examine it with PCA.

#> Loading required package: Matrix

Now we run PHATE on the data. We’ll just go ahead and try with the default parameters.

# runs phate
tree.phate <- phate($data)
#> PHATE embedding
#> k = 5, alpha = 40, t = auto
#> Data: (3000, 100)
#> Embedding: (3000, 2)

Let’s plot the results.

# plot embedding
plot(tree.phate, col =$branches)

Good news! Our branches separate nicely. However, most of the interesting activity seems to be concentrated into one region of the plot - in this case we should try the square root potential instead by using gamma=0. We can also try increasing t to make the structure a little clearer - in this case, because synthetic data in unusually structured, we can use a very large value, like 120, but in biological data the automatic t selection is generally very close to ideal. Note here that if we pass our previous result in with the argument init, we won’t have to recompute the diffusion operator.

# runs phate with different parameters
tree.phate <- phate($data, gamma=0, t=120, init=tree.phate)
# plot embedding
plot(tree.phate, col =$branches)

We can also pass the PHATE object directly to ggplot, if it is installed.

#> Warning: package 'ggplot2' was built under R version 3.5.3
ggplot(tree.phate, aes(x=PHATE1, y=PHATE2,$branches)) +



  • Should genes (features) by rows or columns?

To be consistent with common dimensionality reductions such as PCA (stats::prcomp) and t-SNE (Rtsne::Rtsne), we require that cells (observations) be rows and genes (features) be columns of your input data.

  • I have installed PHATE in Python, but phateR says it is not installed!

Check your reticulate::py_discover_config("phate") and compare it to the version of Python in which you installed PHATE (run which python and which pip in a terminal.) Chances are reticulate can’t find the right version of Python; you can fix this by adding the following line to your ~/.Renviron:


You can read more about Renviron at


Please let us know of any issues at the GitHub repository. If you have any questions or require assistance using PHATE, please read the documentation by running help(phateR::phate) or contact us at


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.7 by Scott Gigante, 10 months ago

Browse source code at

Authors: Krishnan Srinivasan [aut] , Scott Gigante [cre]

Documentation:   PDF Manual  

GPL-2 | file LICENSE license

Imports methods, stats, graphics, reticulate, ggplot2, memoise

Depends on Matrix

Suggests gridGraphics, cowplot

Suggested by Rmagic.

See at CRAN