Metadata-Version: 2.4
Name: scembed
Version: 0.1.1
Summary: Run embedding comparisons for single-cell data
Project-URL: Documentation, https://scembed.readthedocs.io/
Project-URL: Homepage, https://github.com/quadbio/scembed
Project-URL: Source, https://github.com/quadbio/scembed
Author: Marius Lange
Maintainer-email: Marius Lange <mlange@ethz.ch>
License: MIT License
        
        Copyright (c) 2025, QuadBioLab
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: numpy>=2.1
Requires-Dist: pyarrow>=21
Requires-Dist: scanpy>=1.11.4
Requires-Dist: scib-metrics>=0.5.6
Requires-Dist: scipy>=1.16
Requires-Dist: session-info2
Requires-Dist: wandb
Provides-Extra: all
Requires-Dist: faiss-gpu; extra == 'all'
Requires-Dist: harmony-pytorch; extra == 'all'
Requires-Dist: pyliger>=0.2.4; extra == 'all'
Requires-Dist: rapids-singlecell; extra == 'all'
Requires-Dist: scanorama>=1.7.4; extra == 'all'
Requires-Dist: scarches>=0.6.1; extra == 'all'
Requires-Dist: scvi-tools>=1.3; extra == 'all'
Requires-Dist: torch>=2.8; extra == 'all'
Provides-Extra: cpu
Requires-Dist: pyliger>=0.2.4; extra == 'cpu'
Requires-Dist: scanorama>=1.7.4; extra == 'cpu'
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: twine>=4.0.2; extra == 'dev'
Provides-Extra: doc
Requires-Dist: docutils!=0.18.*,!=0.19.*,>=0.8; extra == 'doc'
Requires-Dist: ipykernel; extra == 'doc'
Requires-Dist: ipython; extra == 'doc'
Requires-Dist: myst-nb>=1.1; extra == 'doc'
Requires-Dist: pandas; extra == 'doc'
Requires-Dist: setuptools; extra == 'doc'
Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
Requires-Dist: sphinx-book-theme>=1; extra == 'doc'
Requires-Dist: sphinx-copybutton; extra == 'doc'
Requires-Dist: sphinx-tabs; extra == 'doc'
Requires-Dist: sphinx>=8.1; extra == 'doc'
Requires-Dist: sphinxcontrib-bibtex>=1; extra == 'doc'
Requires-Dist: sphinxext-opengraph; extra == 'doc'
Provides-Extra: fast-metrics
Requires-Dist: faiss-gpu; extra == 'fast-metrics'
Requires-Dist: rapids-singlecell; extra == 'fast-metrics'
Provides-Extra: gpu
Requires-Dist: harmony-pytorch; extra == 'gpu'
Requires-Dist: scarches>=0.6.1; extra == 'gpu'
Requires-Dist: scvi-tools>=1.3; extra == 'gpu'
Requires-Dist: torch>=2.8; extra == 'gpu'
Provides-Extra: test
Requires-Dist: coverage>=7.10; extra == 'test'
Requires-Dist: h5py; extra == 'test'
Requires-Dist: harmony-pytorch; extra == 'test'
Requires-Dist: pyarrow; extra == 'test'
Requires-Dist: pyliger>=0.2.4; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: scanorama>=1.7.4; extra == 'test'
Requires-Dist: scarches>=0.6.1; extra == 'test'
Requires-Dist: scvi-tools>=1.3; extra == 'test'
Requires-Dist: torch>=2.8; extra == 'test'
Description-Content-Type: text/markdown

# 🧬 Comparing embeddings for single-cell and spatial data

[![Tests][badge-tests]][tests]
[![Documentation][badge-docs]][documentation]
[![Coverage][badge-coverage]][coverage]
[![Pre-commit.ci][badge-pre-commit]][pre-commit]
[![PyPI][badge-pypi]][pypi]
[![Downloads][badge-downloads]][downloads]
[![Zenodo][badge-zenodo]][zenodo]


[badge-tests]: https://img.shields.io/github/actions/workflow/status/quadbio/scembed/test.yaml?branch=main
[badge-docs]: https://img.shields.io/readthedocs/scembed
[badge-coverage]: https://codecov.io/gh/quadbio/scembed/branch/main/graph/badge.svg
[badge-pre-commit]: https://results.pre-commit.ci/badge/github/quadbio/scembed/main.svg
[badge-pypi]: https://img.shields.io/pypi/v/scembed.svg
[badge-downloads]: https://static.pepy.tech/badge/scembed
[badge-zenodo]: https://zenodo.org/badge/1046168919.svg


Single-cell RNA-sequencing (scRNA-seq) 🧪 measures gene expression in individual cells and generates large datasets. Typically, these datasets consist of several samples, each corresponding to a combination of covariates (e.g. patient, time point, disease status, technology, etc.). Analyzing these vast datasets (often containing millions of cells for thousands of genes) is facilitated by data integration approaches, which learn lower-dimensional representations that remove the effects of certain unwanted covariates (such as experimental batch, the chip the data was run on, etc).

## 🎯 Overview
Here, we use `slurm_sweep` to efficiently parallelize and track different data integration approaches, and we compare their performance in terms of [scIB metrics](https://scib-metrics.readthedocs.io/en/stable/) ([Luecken et al., 2022](https://doi.org/10.1038/s41592-021-01336-8)). For each data integration method, we compute a shared latent space, quantify integration performance in terms of batch correction and bio conservation, visualize the latent space with UMAP, store the model and embedding coordinates, and store all relevant data on wandb, so that we can retrieve it after the sweep.

`scembed` consists of shallow wrappers around commonly used integration tools, a class to facilitate scIB comparisons, and another class to retrieve and aggregate sweep results.


## 🚀 Getting started

Please refer to the [documentation][],
in particular, the [API documentation][].

## 📦 Installation

You need to have Python 3.10 or newer installed on your system.
If you don't have Python installed, we recommend installing [uv][].

There are several alternative options to install scembed:

1. Install the latest release of `scembed` from [PyPI][]:

```bash
pip install scembed
```

2. Install the latest development version:

```bash
pip install git+https://github.com/quadbio/scembed.git@main
```

### 🎯 Dependency Groups

The package uses optional dependency groups to minimize installation overhead:

- **Base**: Core functionality (scanpy, scib-metrics, wandb)
- **`[cpu]`**: CPU-based methods (e.g. Harmony, LIGER, Scanorama)
- **`[gpu]`**: GPU-based methods (e.g. scVI, scANVI, scPoli)
- **`[fast_metrics]`**: Accelerated evaluation with `faiss` and `RAPIDS` ⚡
- **`[all]`**: All optional dependencies

**⚠️ Note**: If you encounter C++ compilation errors (e.g., with `louvain` or `annoy`), install those packages via conda/mamba first:
```bash
mamba install louvain python-annoy
```

## 📝 Release notes

See the [changelog][].

## 💬 Contact

For questions and help requests, you can reach out in the [scverse discourse][].
If you found a bug, please use the [issue tracker][].

## 📖 Citation

Please use our [zenodo][] entry to cite this software.

[uv]: https://github.com/astral-sh/uv
[scverse discourse]: https://discourse.scverse.org/
[issue tracker]: https://github.com/quadbio/scembed/issues
[tests]: https://github.com/quadbio/scembed/actions/workflows/test.yaml
[documentation]: https://scembed.readthedocs.io
[changelog]: https://scembed.readthedocs.io/en/latest/changelog.html
[api documentation]: https://scembed.readthedocs.io/en/latest/api.html
[pypi]: https://pypi.org/project/scembed

[coverage]: https://codecov.io/gh/quadbio/scembed
[pre-commit]: https://results.pre-commit.ci/latest/github/quadbio/scembed/main
[downloads]: https://pepy.tech/project/scembed
[zenodo]: https://doi.org/10.5281/zenodo.16982001
