Skip to main content

Pure-Python port of slingshot — cell-lineage and pseudotime inference (Street et al. BMC Genomics 2018).

Project description

py-Slingshot

A Python port of slingshot (Street et al. BMC Genomics 2018) — branching cell-lineage and pseudotime inference for single-cell RNA-seq.

  • Pure NumPy / SciPy / statsmodels implementation
  • MST over cluster centroids → DFS lineage enumeration → per-lineage principal curve fitting
  • Parity vs R Slingshot on a Y-shaped fixture: pseudotime Spearman 0.99+ along matched lineages

Install

pip install pyslingshot-bio

(module name is pyslingshot; the PyPI distribution name is pyslingshot-bio.)

Quick-start

import pyslingshot
sr = pyslingshot.slingshot(reduced_dim, cluster_labels, start_cluster="root_cluster_id")
# Per-lineage pseudotime
pt = sr.pseudotime              # (n_cells × n_lineages)
# Visualisation
from ggplot2_py import ggsave
ggsave("out.png", plot=pyslingshot.plot_slingshot(sr), width=6, height=4, dpi=120)

Function map

Python R Status
getLineages getLineages
getCurves getCurves ✅ (independent per-lineage; no shared-start fitting yet)
slingshot slingshot
plot_slingshot plot(sds) / vignette
plot_pseudotime (custom)
embedCurves embedCurves ⏳ v0.2
predict predict ⏳ v0.2
branchID branchID ⏳ v0.2

Known limitations (v0.1)

  1. Simultaneous principal-curve fitting deferred — v0.1 fits each lineage independently. R Slingshot shares the early stem across lineages during fitting, which produces cleaner branching. v0.2 will add this.
  2. MST distance metric uses plain Euclidean on centroids; R uses Mahalanobis-style scaling by within-cluster dispersion when dist.method = "slingshot" (default).
  3. embedCurves, predict, branchID deferred to v0.2.
  4. Lineage count can differ from R because of root-selection and lineage-merging differences; the matched lineages have Spearman ≥ 0.99 pseudotime parity.

Citation

Street, K. et al. Slingshot: cell lineage and pseudotime inference for single-cell transcriptomics. BMC Genomics 19, 477 (2018).

License

MIT.

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

pyslingshot_bio-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

pyslingshot_bio-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pyslingshot_bio-0.1.0.tar.gz.

File metadata

  • Download URL: pyslingshot_bio-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyslingshot_bio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07cece788bef1ea806b5a1bd1f76f760ab0576e91e34600df933f80a6b0c84b0
MD5 dcdf9bf35e4b0890bba79efb410ecf34
BLAKE2b-256 8ff8fe8e969628f51a5d5ae10ad855f179859c6dd828ca796bd63dfa6bb0473d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyslingshot_bio-0.1.0.tar.gz:

Publisher: publish.yml on omicverse/py-Slingshot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyslingshot_bio-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyslingshot_bio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeba5fc421b8ca6ccdbfb1ea48714cf0092eed12369386bce8c31db8fd0a541f
MD5 496d900752ef385a89005a70e87b0f4a
BLAKE2b-256 38c5d33c10e275f10e6d36af17ba6215c306a1102b3b65936bfcc1a8ec39e0e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyslingshot_bio-0.1.0-py3-none-any.whl:

Publisher: publish.yml on omicverse/py-Slingshot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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