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.
Palantir has been implemented in Python3 and can be installed using:
pip install palantirYou can also install Palantir via conda, mamba, or micromamba from the bioconda channel:
conda install -c conda-forge -c bioconda palantirmamba install -c conda-forge -c bioconda palantirmicromamba install -c conda-forge -c bioconda palantirThese methods ensure that all dependencies are resolved and installed efficiently.
A tutorial on Palantir usage and results visualization for single cell RNA-seq data can be found in this notebook: https://github.com/dpeerlab/Palantir/blob/master/notebooks/Palantir_sample_notebook.ipynb
More tutorials and a documentation of all the Palantir components can be found here: https://palantir.readthedocs.io
scanpy anndata objects are available for download for the three replicates generated in the manuscript:
This notebook details how to use the data in Python and R: http://nbviewer.jupyter.org/github/dpeerlab/Palantir/blob/master/notebooks/manuscript_data.ipynb
Notebooks detailing the generation of results comparing Palantir to trajectory detection algorithms are available here
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}
}
- fix "lightgray" error in
plot_trend
- update
LICENSEfile to be consistent with MIT - license - implement
plot_trajectoriesto show multiple poaths on the UMAP - Drop leiden dependency to allow Python >= 3.13. igrph is used instead.
- Made pygam an optional dependency that can be installed with
pip install palantir[gam]orpip install palantir[full] - Added proper conditional imports and improved error handling for pygam
- Enhanced
run_magic_imputationto return appropriate data types for different inputs - Updated code to use direct AnnData imports for newer compatibility
- Improved version detection using
importlib.metadatawith graceful fallbacks - Fixed Series indexing deprecation warnings in early cell detection functions
- Expanded and standardized documentation with NumPy-style docstrings throughout the codebase
- Added comprehensive type hints to improve code quality and IDE support
- Remove dependency from
_methods in scanpy for plotting. - add
pseudotime_intervalargument to control path length inpalantir.plot.plot_trajectory
- Added comprehensive tests for optional pygam dependency
- Improved test coverage for run_magic_imputation with various input/output types
- Added integration tests against expected results
- Enhanced test infrastructure to work with newer library versions
- Expanded test coverage to catch edge cases in data processing
run_magic_imputationnow has a boolean parametersparseto control output sparsity- bugfix:
run_local_variabilityfor dense expression arrays now runs much faster and more accurate
- avoid devision by zero in
select_branch_cellsfor very small datasets - make branch selection robust against NaNs
- do not plot unclustered trends (NaN cluster) in
plot_gene_trend_clusters
- optional progress bar with
progress=Trueinpalantir.utils.run_local_variability - avoid NaN in local variablility output
- compatibility with
scanpy>=1.10.0
- require
python>=3.9 - implement CI for testing
- fixes for edge cases discovered through extended testing
- implement
plot_trajectoryfunction to show trajectory on the umap - scale pseudotime to unit interval in anndata
- implemented
palantir.plot.plot_statsto plot arbitrary cell-wise statistics as x-/y-positions. - reduce memory usage of
palantir.presults.compute_gene_trends - removed seaborn dependency
- refactor
run_diffusion_mapsto split outcompute_kernelanddiffusion_maps_from_kernel - remove unused dependencies
tables,Cython,cmake, andtzlocal. - fixes in
run_pca(return correct projections and do not use too many components)
- Enable an AnnData-centric workflow for improved usability and interoperability with other single-cell analysis tools.
- Introduced new utility functions
palantir.utils.early_cellTo automate finding an early cell based on cell type and diffusion components.palantir.utils.find_terminal_statesTo automate finding terminal cell states based on cell type and diffusion components.palantir.presults.select_branch_cellsTo find cells associated to each branch based on fate probability.palantir.plot.plot_branch_selectionTo inspect the cell to branch association.palantir.utils.run_local_variabilityTo compute local gene expression variability.palantir.utils.run_densityA wrapper for mellon.DensityEstimator.palantir.utils.run_density_evaluationEvaluate computed density on a different dataset.palantir.utils.run_low_density_variability. To aggregate local gene expression variability in low density.palantir.plot.plot_branch. To plot branch-selected cells over pseudotime in arbitrary y-position and coloring.palantir.plot.plot_trend. To plot the gene trend on top ofpalantir.plot.plot_branch.
- Added input validation for better error handling and improved user experience.
- Expanded documentation within docstrings, providing additional clarity for users and developers.
- Updated tutorial notebook to reflect the new workflow, guiding users through the updated processes.
- Implemented gene trend computation using Mellon, providing more robust and efficient gene trend analysis.
- Enable annotation in
palantir.plot.highlight_cells_on_umap.
- Replaced PhenoGraph dependency with
scanpy.tl.leidenfor gene trend clustering. - Deprecated the
run_tsne,determine_cell_clusters, andplot_cell_clustersfunctions. Use corresponding implementations from Scanpy, widely used single-cell analysis library and direct dependency of Palantir. - Rename
palantir.plot.highlight_cells_on_tsnetopalantir.plot.highlight_cells_on_umap - Depend on
anndata>=0.8.0to avoid issues writing dataframes inad.obsm.
- Addressed the issue of variability when reproducing results (issue#64), enhancing the reproducibility and reliability of Palantir.
- Replaced rpy2 with pyGAM for computing gene expression trends.
- Updated tutorial and plotting functions
- A fix to issue#41
- A fix to issue#42
- Revamped tutorial with support for Anndata and force directed layouts
- A fix related to issue#28. When identifying terminal states, duplicate values were generated instead of unique ones.