This release is a pre-release and may not be stable for production use.
pertkit
The small toolkit behind playground-biology-ai: pseudo-bulk, perturbation baselines, calibrated metrics and bootstrap statistics for evaluating virtual-cell models honestly. Every number comes with a baseline or an interval, and the unit you resample is a perturbation, a donor or a cell line, never a cell.
Not on PyPI yet (the registry decision is made at the 0.1.0.dev0 release). Install from this repository:
uv add "pertkit @ git+https://github.com/albertlieyingadrian/playground-biology-ai#subdirectory=packages/pertkit"
# base: numpy, scipy, pandas, anndata, scanpy, pooch; add `[models]` to the name for torch
Inside this repo, uv sync --extra cpu installs it editable.
from pertkit import pseudobulk, stats
from pertkit.io import iter_cells
bulk = pseudobulk.pseudobulk(adata, "perturbation") # one row per condition, obs["n_cells"]
bulk = pseudobulk.pseudobulk_chunks(iter_cells("big.h5ad"), "perturbation") # same, streaming
ci = stats.bootstrap_ci(scores, groups=perturbation_labels) # resample perturbations, not cells
| module | what it holds |
|---|---|
pertkit.stats |
bootstrap_ci (optionally grouped), wilson_ci, auroc, permutation_test, shuffled_baseline |
pertkit.device |
get_device(): PERTKIT_DEVICE, then cuda, mps, cpu; device_flags() |
pertkit.pseudobulk |
pseudobulk() and pseudobulk_chunks() |
pertkit.io |
iter_cells(): row chunks from a backed h5ad (parquet shards arrive with the readiness kit) |
pertkit.data.fetch |
per-part TOML manifests, hash-verified fetch(), pickle_to_npz() through a restricted unpickler |
pertkit.header |
manifest_prefixes() for the lesson header |
Later units add baselines, metrics, evals, models and screen. The statistics functions were copied from sandbagkit (MIT), see the repo's NOTICE.md.
Tests: uv run pytest packages/pertkit/tests from the repo root. Markers: slow (excluded by default), download (needs --download-tests), gpu.
MIT, see LICENSE.
Metadata
Release files for pertkit 0.1.0.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pertkit-0.1.0.dev0.tar.gz | 50.4 kB | Without provenance | Details for pertkit-0.1.0.dev0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pertkit-0.1.0.dev0-py3-none-any.whl | Python 3 | none | any | Details for pertkit-0.1.0.dev0-py3-none-any.whl |
Total release size: 86.5 kB
Release files / pertkit-0.1.0.dev0.tar.gz
| Download URL | pertkit-0.1.0.dev0.tar.gz |
|---|---|
| Size | 50.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afe8cde725a3cc2ab24de4d8229c8cfc04b1cb45969fd6ed5b70e6a971c3e716
|
|
BLAKE2b-256 checksum How to use checksums |
e81f31389edc2b277f252263020672aff5d18b05b29a84e4a53826bfcc735e2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / pertkit-0.1.0.dev0-py3-none-any.whl
| Download URL | pertkit-0.1.0.dev0-py3-none-any.whl |
|---|---|
| Size | 36.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d64d3b59236a89f19d2ffe63118c55225db1490e08aa3232d1a9f08d4543802
|
|
BLAKE2b-256 checksum How to use checksums |
da293688f3fe47baea0e8d35bdab935c39fdc48afa9ad5ae349c571ab416626a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for pertkit 0.1.0.dev0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.