Pure-Python port of dyneval — trajectory inference benchmark metrics (Saelens et al. Nat Biotechnol 2019).
Project description
py-dyneval
A Python port of dynverse/dyneval (Saelens et al. Nat Biotechnol 2019) — the metric library used by the dynbenchmark trajectory inference benchmark.
- Pure NumPy / SciPy / NetworkX / scikit-learn — no R
- Depends on
pydynwrapfor trajectory wrappers + geodesic distances - 8/14 dyneval metric IDs ported in v0.1
Install
pip install pydyneval-bio # pulls in pydynwrap-bio
Quick-start
import pydyneval as de
import pydynwrap as dw
import numpy as np
gold = dw.wrap_data([f"c{i}" for i in range(30)])
gold = dw.add_branch_trajectory(gold,
pseudotime=np.tile(np.linspace(0,1,10), 3),
branch=np.repeat(["A","B","C"], 10))
pred = dw.wrap_data([f"c{i}" for i in range(30)])
pred = dw.add_branch_trajectory(pred,
pseudotime=np.tile(np.linspace(0,1,10), 3),
branch=np.repeat(["A","B","C"], 10))
scores = de.calculate_metrics(gold, pred)
print(scores)
# correlation him edge_flip isomorphic F1_branches F1_milestones ...
# 0 1.0 1.0 1.0 1.0 1.0 1.0
Function map
| Python | R dyneval:: |
Status |
|---|---|---|
calculate_metrics(dataset, model, metrics=...) |
same | ✅ |
calculate_him(net1, net2) |
same | ✅ (Lorentzian inline) |
calculate_edge_flip(net1, net2) |
same | ✅ (Jaccard surrogate) |
calculate_isomorphic(net1, net2) |
(implicit) | ✅ |
calculate_mapping_branches(dataset, prediction) |
same | ✅ |
calculate_mapping_milestones(dataset, prediction) |
same | ✅ |
calculate_featureimp_cor(dataset, model) |
same | ✅ |
calculate_featureimp_enrichment (ks / wilcox) |
— | ⏳ v0.2 |
calculate_position_predict (rf_mse / rf_rsq / lm_*) |
— | ⏳ v0.2 |
evaluate_ti_method |
— | ⛔ v0.3+ (depends on TI runners) |
R parity on canonical fixture (3-branch, 30 cells × 50 genes)
| Metric | R | Py | |Δ| | |---|---|---|---| | correlation | 0.9812 | 0.9813 | 0.0001 | | him | 1.0 | 1.0 | 0.0 | | edge_flip | 1.0 | 1.0 | 0.0 | | isomorphic | 1.0 | 1.0 | 0.0 | | F1_branches | 1.0 | 1.0 | 0.0 | | F1_milestones | 0.6667 | 0.6667 | 0.0 | | featureimp_cor | 0.9622 | 0.9005 | 0.0617 | | featureimp_wcor | 0.9664 | 0.9548 | 0.0115 |
featureimp_* differs slightly because of Random Forest non-determinism
between R randomForest and sklearn RandomForestRegressor — both
implement Breiman 2001 with the same hyperparameters; tree-splitting RNG
differs.
Citation
Saelens, W. et al. A comparison of single-cell trajectory inference methods. Nat Biotechnol 37, 547–554 (2019).
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 pydyneval_bio-0.1.0.tar.gz.
File metadata
- Download URL: pydyneval_bio-0.1.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
513e4598982cf650744288ef843411cb7f00f73c6a0eea06d9a8e1ff2bc1ebe1
|
|
| MD5 |
2cf939563da1d03add3ebd9ad49497ea
|
|
| BLAKE2b-256 |
1009c4da20c672662f18774259ef6252c3cc38b03dfc335913aff8a2e4f3bf20
|
Provenance
The following attestation bundles were made for pydyneval_bio-0.1.0.tar.gz:
Publisher:
publish.yml on omicverse/py-dyneval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydyneval_bio-0.1.0.tar.gz -
Subject digest:
513e4598982cf650744288ef843411cb7f00f73c6a0eea06d9a8e1ff2bc1ebe1 - Sigstore transparency entry: 1628907376
- Sigstore integration time:
-
Permalink:
omicverse/py-dyneval@5c4b4f43ddfef1e220a0e1549d1bca47b6a5675c -
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@5c4b4f43ddfef1e220a0e1549d1bca47b6a5675c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pydyneval_bio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydyneval_bio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 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 |
7b1a61f43cf2a7c253f776c0c0e42d1dfb89bf5b56571d62ce7fe03347089a5a
|
|
| MD5 |
924fc2a5f0cf625e14f88f73c400623e
|
|
| BLAKE2b-256 |
a6b6053b3cae2cbb3cabd698f02d10f052a69bbb8846f8aed3c01dc076083aee
|
Provenance
The following attestation bundles were made for pydyneval_bio-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on omicverse/py-dyneval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydyneval_bio-0.1.0-py3-none-any.whl -
Subject digest:
7b1a61f43cf2a7c253f776c0c0e42d1dfb89bf5b56571d62ce7fe03347089a5a - Sigstore transparency entry: 1628907403
- Sigstore integration time:
-
Permalink:
omicverse/py-dyneval@5c4b4f43ddfef1e220a0e1549d1bca47b6a5675c -
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@5c4b4f43ddfef1e220a0e1549d1bca47b6a5675c -
Trigger Event:
workflow_dispatch
-
Statement type: