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)
- 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.
- MST distance metric uses plain Euclidean on centroids; R uses Mahalanobis-style scaling by within-cluster dispersion when
dist.method = "slingshot"(default). embedCurves,predict,branchIDdeferred to v0.2.- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07cece788bef1ea806b5a1bd1f76f760ab0576e91e34600df933f80a6b0c84b0
|
|
| MD5 |
dcdf9bf35e4b0890bba79efb410ecf34
|
|
| BLAKE2b-256 |
8ff8fe8e969628f51a5d5ae10ad855f179859c6dd828ca796bd63dfa6bb0473d
|
Provenance
The following attestation bundles were made for pyslingshot_bio-0.1.0.tar.gz:
Publisher:
publish.yml on omicverse/py-Slingshot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyslingshot_bio-0.1.0.tar.gz -
Subject digest:
07cece788bef1ea806b5a1bd1f76f760ab0576e91e34600df933f80a6b0c84b0 - Sigstore transparency entry: 1628913832
- Sigstore integration time:
-
Permalink:
omicverse/py-Slingshot@7eece02f2c5a37e26f1d25fadaec31a4c738c6b1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7eece02f2c5a37e26f1d25fadaec31a4c738c6b1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyslingshot_bio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyslingshot_bio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeba5fc421b8ca6ccdbfb1ea48714cf0092eed12369386bce8c31db8fd0a541f
|
|
| MD5 |
496d900752ef385a89005a70e87b0f4a
|
|
| BLAKE2b-256 |
38c5d33c10e275f10e6d36af17ba6215c306a1102b3b65936bfcc1a8ec39e0e7
|
Provenance
The following attestation bundles were made for pyslingshot_bio-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on omicverse/py-Slingshot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyslingshot_bio-0.1.0-py3-none-any.whl -
Subject digest:
aeba5fc421b8ca6ccdbfb1ea48714cf0092eed12369386bce8c31db8fd0a541f - Sigstore transparency entry: 1628913841
- Sigstore integration time:
-
Permalink:
omicverse/py-Slingshot@7eece02f2c5a37e26f1d25fadaec31a4c738c6b1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7eece02f2c5a37e26f1d25fadaec31a4c738c6b1 -
Trigger Event:
workflow_dispatch
-
Statement type: