API reference

Contents

API reference#

Import the package as:

import campmc as cp

Symbol

Role

campmc.preprocess()

Preprocessing (filter, normalize, HVG, PCA)

campmc.partition()

Metacell partitioning (CAMP1–4)

campmc.mt

Quality, sizes, and rare-type recovery

campmc.pl

Plotting helpers

Minimal example#

Runnable examples are on each API function page. A typical flow:

import campmc as cp
import scanpy as sc
adata = sc.datasets.pbmc68k_reduced()
cp.partition(adata, method="camp3", gamma=50, random_state=0)
cp.mt.quality(adata, partition_key="camp", label_key="louvain").head()
metacell_id size compactness separation sc_ratio INV purity label_entropy
0 seed0-50-__all__ 65 -0.001010 0.140312 4.415655 30.340631 0.984615 0.114676
1 seed1-50-__all__ 34 -0.000305 0.181345 10.381738 17.158705 0.911765 0.511578
2 seed10-50-__all__ 3 -0.000724 0.063904 2.374693 5.376963 0.666667 0.918296
3 seed11-50-__all__ 158 -0.000695 0.074471 2.823893 32.220764 0.708861 0.945308
4 seed12-50-__all__ 42 -0.000890 0.048984 1.641697 26.113123 0.809524 0.884264

For raw counts, call campmc.preprocess() before partitioning. See the User guide for method choice and AnnData keys.