multigedi

Gene Expression Decomposition for Integration

A scverse-compliant Python package for joint single-cell factor analysis and batch correction.


multigedi implements the GEDI and MultiGEDI algorithms for integrating single-cell modalities across samples and batches. It uses a hub-and-spoke latent model with block coordinate descent to learn shared cell factors and modality-specific feature programs.

Quick install

# After downloading the matching wheel from the latest GitHub release:
python -m pip install /path/to/multigedi-1.7.1-<python>-<abi>-<platform>.whl

PyPI publication is currently disabled. See the installation guide for release assets and source-build instructions.

Quick Start

import mudata as md
import multigedi as gd

mdata = md.read_h5mu("data.h5mu")

gd.tl.multigedi(
    mdata,
    modalities={
        "gene": {"obs_type": "M", "orthoZ": True},
        "splicing": {
            "obs_type": "M_list",
            "orthoZ": False,
            "layers": (None, "M2"),
        },
    },
    sample_key="sample",
    K=20,
)

result = mdata.uns["multigedi"]
gene_pca = mdata["gene"].obsm["X_multigedi_pca"]

Key Features

  • Memory-efficient: C++ backend keeps large matrices in native memory

  • Fast: OpenMP parallelization for multi-threaded optimization

  • scverse-compliant: Works seamlessly with AnnData, scanpy, and the scverse ecosystem

  • Flexible: Supports count, paired-count, and binary observation types

  • Comprehensive: Includes projections, embeddings, imputation, and differential analysis

Documentation

Modules

multigedi follows the scanpy convention with submodules for different functionality:

Module

Description

gd.tl

Tools for model training, projections, embeddings, imputation, and analysis

gd.pl

Plotting functions for embeddings, convergence, and feature visualization

gd.io

Input/output for H5AD, 10X formats, and model persistence

Citation

If you use multigedi in your research, please cite:

Mikaeili Namini, A., & Najafabadi, H.S. (2024). GEDI: Gene Expression Decomposition for Integration of single-cell RNA-seq data.

License

multigedi is released under the MIT License.