Metadata-Version: 2.4
Name: kompot
Version: 0.7.0
Summary: Differential abundance and gene expression analysis using Mahalanobis distance with JAX backend
Author-email: Dominik Otto <dotto@fredhutch.org>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/settylab/kompot
Project-URL: Documentation, https://kompot.readthedocs.io/
Project-URL: Bug Tracker, https://github.com/settylab/kompot/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scikit-learn>=1.0.0
Requires-Dist: jax>=0.3.0
Requires-Dist: jaxlib>=0.3.0
Requires-Dist: mellon>=1.7.1
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: tqdm>=4.60.0
Requires-Dist: anndata>=0.8.0
Requires-Dist: pynndescent>=0.5.0
Requires-Dist: python-igraph>=0.10.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: filelock>=3.12.0
Requires-Dist: pyyaml>=5.0.0
Provides-Extra: docs
Requires-Dist: sphinx<8.3.0,>=7.0.0; extra == "docs"
Requires-Dist: nbsphinx>=0.9.0; extra == "docs"
Requires-Dist: furo>=2024.0.0; extra == "docs"
Requires-Dist: sphinx-github-style>=1.2.0; extra == "docs"
Requires-Dist: lxml[html_clean]; extra == "docs"
Requires-Dist: IPython; extra == "docs"
Provides-Extra: plot
Requires-Dist: scanpy>=1.9.0; extra == "plot"
Requires-Dist: matplotlib>=3.5.0; extra == "plot"
Requires-Dist: requests>=2.28.0; extra == "plot"
Requires-Dist: IPython>=7.0.0; extra == "plot"
Requires-Dist: json5~=0.9.14; extra == "plot"
Provides-Extra: recommended
Requires-Dist: palantir>=1.0.0; extra == "recommended"
Requires-Dist: dask>=2024.4.0; extra == "recommended"
Provides-Extra: dask
Requires-Dist: dask>=2024.4.0; extra == "dask"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Provides-Extra: all
Requires-Dist: scanpy>=1.9.0; extra == "all"
Requires-Dist: matplotlib>=3.5.0; extra == "all"
Requires-Dist: requests>=2.28.0; extra == "all"
Requires-Dist: IPython>=7.0.0; extra == "all"
Requires-Dist: json5~=0.9.14; extra == "all"
Requires-Dist: palantir>=1.0.0; extra == "all"
Requires-Dist: dask>=2024.4.0; extra == "all"
Dynamic: license-file

# Kompot

[![DOI](https://zenodo.org/badge/944121568.svg)](https://zenodo.org/badge/latestdoi/944121568)
[![PyPI](https://img.shields.io/pypi/v/kompot.svg)](https://pypi.org/project/kompot/)
[![Tests](https://github.com/settylab/kompot/actions/workflows/tests.yml/badge.svg)](https://github.com/settylab/kompot/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/settylab/kompot/branch/main/graph/badge.svg)](https://codecov.io/gh/settylab/kompot)
[![Documentation Status](https://readthedocs.org/projects/kompot/badge/?version=latest)](https://kompot.readthedocs.io/en/latest/?badge=latest)

![Kompot Logo](https://github.com/settylab/kompot/blob/main/docs/source/_static/images/kompot_logo.png?raw=true)

Kompot is a Python package for differential abundance and gene expression analysis using Gaussian Process models with JAX backend.

## Overview

Kompot implements methodologies from the Mellon package for computing differential abundance and gene expression, with a focus on using Mahalanobis distance as a measure of differential expression significance. It leverages JAX for efficient computations and provides a scikit-learn like API with `.fit()` and `.predict()` methods.

Key features:

- Computation of differential abundance between conditions
- Gene expression smoothing and uncertainty estimation
- Mahalanobis distance calculation for differential expression significance
- JAX-accelerated computations with optional GPU support
- Disk-backed covariance storage for sample variance estimation
- **Full scverse compatibility** with direct AnnData integration
- **Visualization tools** for volcano plots, heatmaps, and embeddings
- **Command-line interface** for pipeline integration

## Installation

```bash
pip install kompot
```

Or via conda:

```bash
conda install -c bioconda kompot
```

See the [installation guide](https://kompot.readthedocs.io/en/latest/installation.html) for optional dependencies and JAX GPU support.

## Usage

### Python API

```python
import kompot
import anndata as ad

# Load data
adata = ad.read_h5ad("data.h5ad")

# Differential expression
kompot.compute_differential_expression(
    adata,
    groupby="condition",
    condition1="control",
    condition2="treatment",
    obsm_key="X_pca"
)
```

### Command-Line Interface

```bash
# Differential expression
kompot de input.h5ad -o output.h5ad \
  --groupby condition \
  --condition1 control \
  --condition2 treatment
```

## Documentation

- [Full Documentation](https://kompot.readthedocs.io)
- [Tutorial Notebooks](https://github.com/settylab/kompot/tree/main/examples)
  - [Getting Started](https://github.com/settylab/kompot/blob/main/examples/01_getting_started.ipynb)
  - [Advanced Differential Expression](https://github.com/settylab/kompot/blob/main/examples/02_differential_expression_detailed.ipynb)
  - [Sample Variance Analysis](https://github.com/settylab/kompot/blob/main/examples/03_sample_variance.ipynb)
- [CLI Guide](https://kompot.readthedocs.io/en/latest/cli.html)

## Citation

If you use Kompot in your research, please cite:

```bibtex
@article{Otto2025.06.03.657769,
    author = {Otto, Dominik J. and Arriaga-Gomez, Erica and Thieme, Elana and Yang, Ruijin and Lee, Stanley C. and Setty, Manu},
    title = {Comparing phenotypic manifolds with Kompot: Detecting differential abundance and gene expression at single-cell resolution},
    year = {2025},
    doi = {10.1101/2025.06.03.657769},
    publisher = {Cold Spring Harbor Laboratory},
    journal = {bioRxiv},
    URL = {https://www.biorxiv.org/content/10.1101/2025.06.03.657769}
}
```

## License

GNU General Public License v3 (GPLv3)
