panhumanpy¶
Current version: 1.0.0 (Orion) | GitHub | PyPI
panhumanpy is a Python package for the Pan-human Azimuth neural network, enabling users to run cell type annotation on single-cell and spatial transcriptomics data.
Prerequisites¶
python >=3.9, pip, git
Installation¶
panhumanpy is available on PyPI. To install the base version of the package (with CPU support only), run:
pip install panhumanpy
If you require GPU acceleration for enhanced performance on compatible hardware, install the package with GPU dependencies:
pip install panhumanpy[gpu]
You can also install from GitHub:
# base
pip install git+https://github.com/satijalab/panhumanpy.git
# w/ GPU dependencies
pip install git+https://github.com/satijalab/panhumanpy.git#egg=panhumanpy[gpu]
Quickstart¶
from panhumanpy import AzimuthNN
obj = 'path/to/obj.h5ad'
# Normalize
obj = ...
# Run minimal annotation pipeline
azimuth = AzimuthNN(obj)
# Get cell type annotations
cell_metadata = azimuth.cells_meta
# Extract embeddings
embeddings = azimuth.azimuth_embed()
# Generate UMAP
umap = azimuth.azimuth_umap()
# Save results
obj_annotated = azimuth.pack_adata('obj_ANN.h5ad')
Tutorial¶
For an introductory tutorial, please check out this notebook (download here).
Model Versions¶
panhumanpy uses versioned models corresponding to major package releases. The package defaults to model ‘v{i}’ where i is the major package version. For panhumanpy 1.0.0 (Orion), the default model version is ‘v1’. For most users, the default version is recommended. The user can also choose to use a different model version as outlined in the tutorial.
Currently available model versions: ‘v0’, ‘v1’.
Cell Ontology Mapping¶
panhumanpy includes a built-in crosswalk that maps Pan-human Azimuth cell type annotations to Cell Ontology (CL) terms. This mapping is versioned alongside the model and can be applied to annotation outputs via the map_to_cell_ontology function in ANNotate_tools or the map_to_cell_ontology method on AzimuthNN and AzimuthNN_base.
Crosswalk provenance: Aleix Puig-Barbe, https://doi.org/10.48539/HBM727.TLKL.237.
Model Weights¶
Model weights are hosted on Zenodo. No manual download is required, as weights are downloaded automatically on first use and cached in ~/.cache/panhumanpy/.