Skip to main content

Python port of the R monocle3 package (tracks cole-trapnell-lab/monocle3 1.4.26 @ 4f4239a) — AnnData-based single-cell trajectory, clustering, and differential expression.

Project description

monocle3-python

PyPI

Python port of the R monocle3 single-cell trajectory toolkit. Tracks upstream 1.4.26 at commit 4f4239a.

The port keeps monocle3's orchestration and R-side numerical behaviour while replacing the cell_data_set S4 container with anndata.AnnData and delegating non-monocle-specific algorithms to the scverse ecosystem (umap-learn, openTSNE, leidenalg, statsmodels, scanorama, …).

Installation

pip install monocle3-python                # from PyPI

For local development:

git clone https://github.com/Bio-Babel/Monocle3-python.git
cd Monocle3-python
pip install -e ".[dev]"

No R interpreter is required at runtime. Tutorial datasets are downloaded on first use and cached under ~/.cache/monocle3-python/.

Quickstart

import monocle3 as m3

adata = m3.load_packer_embryo()                  # AnnData (6188 × 20222)
m3.preprocess_cds(adata, num_dim=50)              # size-factor norm + truncated PCA
m3.align_cds(adata, alignment_group="batch")
m3.reduce_dimension(adata)                        # UMAP via umap-learn
m3.cluster_cells(adata)                           # Leiden
m3.learn_graph(adata)                             # SimplePPT principal graph
m3.order_cells(adata, root_pr_nodes=["Y_1"])      # pseudotime
m3.plot_cells(adata, color_cells_by="pseudotime")

Tutorials

Runnable notebooks that reproduce the R monocle3 vignettes live under tutorials/:

Notebook Dataset
c_elegans_embryo_v2.ipynb Packer et al. 2019 — C. elegans embryo trajectory
c_elegans_L2_v2.ipynb Cao et al. 2017 — C. elegans L2 clustering + Garnett markers

License

Artistic-2.0, matching the upstream R monocle3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monocle3_python-1.4.26.tar.gz (71.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monocle3_python-1.4.26-py3-none-any.whl (85.9 kB view details)

Uploaded Python 3

File details

Details for the file monocle3_python-1.4.26.tar.gz.

File metadata

  • Download URL: monocle3_python-1.4.26.tar.gz
  • Upload date:
  • Size: 71.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for monocle3_python-1.4.26.tar.gz
Algorithm Hash digest
SHA256 a6c20c16d75d01a7e47d394260d674fb97ba3b8fd76fd82d6a4de1f245450031
MD5 7c49e644b4a313377cc78ba4de8b4f25
BLAKE2b-256 fd445f609f17584f1531e8f924b08014fcd23441cfe713594881c3854b9ad171

See more details on using hashes here.

File details

Details for the file monocle3_python-1.4.26-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle3_python-1.4.26-py3-none-any.whl
Algorithm Hash digest
SHA256 dbaae34b5f784325c5981a3fbb5f116be2ef8ce08e4542381aabf9ecd6474891
MD5 55a98dd1ec330bb0b5b4c5112a16477e
BLAKE2b-256 8d19cb569d8c16f62887dd8e7b3725f6689209f84a29b29076d45540567dbb62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page