Home

Awesome

PyPI version codecov

Palantir

Palantir is an algorithm to align cells along differentiation trajectories. Palantir models differentiation as a stochastic process where stem cells differentiate to terminally differentiated cells by a series of steps through a low dimensional phenotypic manifold. Palantir effectively captures the continuity in cell states and the stochasticity in cell fate determination. Palantir has been designed to work with multidimensional single cell data from diverse technologies such as Mass cytometry and single cell RNA-seq.

Installation and dependencies

  1. Palantir has been implemented in Python3 and can be installed using:

     pip install palantir
    
  2. Palantir depends on a number of python3 packages available on pypi and these dependencies are listed in setup.py

    All the dependencies will be automatically installed using the above commands

  3. To uninstall:

     pip uninstall palantir
     
    
  4. Palantir can also be used with Scanpy. It is fully integrated into Scanpy, and can be found under Scanpy's external modules (link)

Usage

A tutorial on Palantir usage and results visualization for single cell RNA-seq data can be found in this notebook: http://nbviewer.jupyter.org/github/dpeerlab/Palantir/blob/master/notebooks/Palantir_sample_notebook.ipynb

Processed data and metadata

scanpy anndata objects are available for download for the three replicates generated in the manuscript: Rep1, Rep2, Rep3

Each object has the following elements

Comparison to trajectory detection algorithms

Notebooks detailing the generation of results comparing Palantir to trajectory detection algorithms are available here

Convert to Seurat objects

Use the snippet below to convert anndata to Seurat objects

library("SeuratDisk")
library("Seurat")
library("reticulate")
use_condaenv(<conda env>, required = T) # before, install "anndata" into <conda env>
anndata <- import('anndata')

#link to Anndata files
url_Rep1 <- "https://s3.amazonaws.com/dp-lab-data-public/palantir/human_cd34_bm_rep1.h5ad"
curl::curl_download(url_Rep1, basename(url_Rep1))
url_Rep2 <- "https://s3.amazonaws.com/dp-lab-data-public/palantir/human_cd34_bm_rep2.h5ad"
curl::curl_download(url_Rep2, basename(url_Rep2))
url_Rep3 <- "https://s3.amazonaws.com/dp-lab-data-public/palantir/human_cd34_bm_rep3.h5ad"
curl::curl_download(url_Rep3, basename(url_Rep3))

#H5AD files are compressed using the LZF filter. 
#This filter is Python-specific, and cannot easily be used in R. 
#To use this file with Seurat and SeuratDisk, you'll need to read it in Python and save it out using the gzip compression
#https://github.com/mojaveazure/seurat-disk/issues/7
adata_Rep1 = anndata$read("human_cd34_bm_rep1.h5ad")
adata_Rep2 = anndata$read("human_cd34_bm_rep2.h5ad")
adata_Rep3 = anndata$read("human_cd34_bm_rep3.h5ad")

adata_Rep1$write_h5ad("human_cd34_bm_rep1.gzip.h5ad", compression="gzip")
adata_Rep2$write_h5ad("human_cd34_bm_rep2.gzip.h5ad", compression="gzip")
adata_Rep3$write_h5ad("human_cd34_bm_rep3.gzip.h5ad", compression="gzip")


#convert gzip-compressed h5ad file to Seurat Object
Convert("human_cd34_bm_rep1.gzip.h5ad", dest = "h5seurat", overwrite = TRUE)
Convert("human_cd34_bm_rep2.gzip.h5ad", dest = "h5seurat", overwrite = TRUE)
Convert("human_cd34_bm_rep3.gzip.h5ad", dest = "h5seurat", overwrite = TRUE)

human_cd34_bm_Rep1 <- LoadH5Seurat("human_cd34_bm_rep1.gzip.h5seurat")
human_cd34_bm_Rep2 <- LoadH5Seurat("human_cd34_bm_rep2.gzip.h5seurat")
human_cd34_bm_Rep3 <- LoadH5Seurat("human_cd34_bm_rep3.gzip.h5seurat")

Thanks to Anne Ludwig from University Hospital Heidelberg for the tip!

Citations

Palantir manuscript is available from Nature Biotechnology. If you use Palantir for your work, please cite our paper.

    @article{Palantir_2019,
            title = {Characterization of cell fate probabilities in single-cell data with Palantir},
            author = {Manu Setty and Vaidotas Kiseliovas and Jacob Levine and Adam Gayoso and Linas Mazutis and Dana Pe'er},
            journal = {Nature Biotechnology},
            year = {2019},
            month = {march},
            url = {https://doi.org/10.1038/s41587-019-0068-4},
            doi = {10.1038/s41587-019-0068-4}
    }

Release Notes

Version 1.3.1

Version 1.3.0

New Features

Enhancements

Changes

Fixes

Version 1.1.0

Version 1.0.0

Version 0.2.6

Version 0.2.5