Metadata-Version: 2.4
Name: campmc
Version: 0.1.1
Summary: Third-party portable Python package for CAMP metacell partitioning (not the official paper repo)
Project-URL: Documentation, https://campmc.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/nictru/campmc
Project-URL: Upstream, https://github.com/danrongLi/CAMP
License: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: anndata>=0.11
Requires-Dist: celltypist
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scanpy>=1.10
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: seaborn
Requires-Dist: seacells
Description-Content-Type: text/markdown

# CAMP (Coreset Accelerated Metacell Partitioning)

Third-party, installable Python reimplementation of the CAMP metacell methods for use with [AnnData](https://anndata.readthedocs.io/) and [Scanpy](https://scanpy.readthedocs.io/).

## About this project

**This repository is not maintained by the authors of the CAMP paper.** It is an independent packaging effort that ports the research code from the upstream [CAMP](https://github.com/danrongLi/CAMP) repository into a reusable library (`import campmc as cp`, PyPI name **campmc**).

Goals of this project:

- Make CAMP1–4 and related helpers **portable** (no hardcoded cluster paths, scanpy-style API).
- Provide tests, documentation, and a normal Python package layout.

For the **official reference implementation**, paper benchmarks, and experiment scripts, use the upstream CAMP repository. Behavior here should match the published algorithms in spirit, but this package is maintained separately.

If you use the CAMP method, please cite the [bioRxiv preprint](https://www.biorxiv.org/content/10.64898/2025.12.11.693725v1) (Li, Ko & Canzar, 2025; [doi:10.64898/2025.12.11.693725](https://doi.org/10.64898/2025.12.11.693725)) — see [Citation](#citation) below.

## Install

```bash
pip install campmc
```

Or with [uv](https://docs.astral.sh/uv/): `uv add campmc`.

For development from a clone:

```bash
git clone https://github.com/nictru/campmc.git
cd campmc
uv sync --group dev
```

## Usage (scanpy-style)

```python
import campmc as cp
import scanpy as sc

adata = sc.datasets.pbmc68k_reduced()
cp.tl.partition(adata, method="camp3", gamma=25, random_state=0)
cp.metrics.quality(adata, partition_key="camp", label_key="louvain")
```

## Documentation

**Published docs:** [campmc.readthedocs.io](https://campmc.readthedocs.io/en/latest/)

To build HTML locally (Sphinx, MyST, `scanpydoc` theme, same style as [Scanpy](https://scanpy.readthedocs.io/)):

```bash
uv sync --group doc
uv run sphinx-build -M html docs docs/_build
```

## Citation

If you use the CAMP method, please cite the preprint:

> Li, D., Ko, Y. K., & Canzar, S. (2025). CAMP: Coreset Accelerated Metacell Partitioning enables scalable analysis of single-cell data. *bioRxiv*. [https://doi.org/10.64898/2025.12.11.693725](https://doi.org/10.64898/2025.12.11.693725)

Preprint: [bioRxiv](https://www.biorxiv.org/content/10.64898/2025.12.11.693725v1)

```bibtex
@article{li2025camp,
  title   = {CAMP: Coreset Accelerated Metacell Partitioning enables scalable analysis of single-cell data},
  author  = {Li, Danrong and Ko, Young Kun and Canzar, Stefan},
  journal = {bioRxiv},
  year    = {2025},
  doi     = {10.64898/2025.12.11.693725},
  url     = {https://www.biorxiv.org/content/10.64898/2025.12.11.693725v1}
}
```

This **campmc** package is a third-party implementation; citing the preprint refers to the CAMP method, not this repository.

## Tests

```bash
uv run pytest -q
```

## License

MIT — see [LICENSE](LICENSE). Algorithm code is adapted from the upstream [CAMP](https://github.com/danrongLi/CAMP) repository (MIT, © danrongLi). This **campmc** package is a separate third-party distribution; it is not affiliated with or endorsed by the original CAMP authors unless they state otherwise.
