Skip to main content

MIOFlow is a Python package for modeling and analyzing single-cell RNA-seq data using optimal flows.

Project description

MIOFlow

arXiv Latest PyPI version Twitter GitHub Stars

MIOFlow is a Python package for modeling and analyzing single-cell RNA-seq data using optimal flows. It leverages neural ordinary differential equations (neural ODEs) and optimal transport to reconstruct cell developmental trajectories from time-series scRNA-seq data.

Features

  • Trajectory inference using optimal transport and neural ODEs
  • GAGA embedding — geometric autoencoder that preserves PHATE distances in latent space
  • Gene-space decoding — map trajectories back to full gene expression via PCA inverse projection
  • Flexible I/O for AnnData and standard scRNA-seq formats

Installation

Install from PyPI

pip install MIOFlow

Install from GitHub (Development Version)

pip install git+https://github.com/yourusername/MIOFlow.git

Usage

Basic Workflow

from MIOFlow.gaga import Autoencoder, train_gaga_two_phase, train_valid_loader_from_pc
from MIOFlow.mioflow import MIOFlow

# 1. Train a GAGA autoencoder on PCA coordinates + PHATE distances
gaga_model = Autoencoder(input_dim=50, latent_dim=10)
train_loader, val_loader = train_valid_loader_from_pc(X_pca, D_phate, batch_size=64)
train_gaga_two_phase(gaga_model, train_loader, encoder_epochs=50, decoder_epochs=50)

# 2. Fit MIOFlow
mf = MIOFlow(
    adata,
    gaga_model=gaga_model,
    gaga_input_scaler=scaler,   # StandardScaler fitted on X_pca
    obs_time_key='day',
    n_epochs=200,
)
mf.fit()

# 3. Inspect results
print(mf.trajectories.shape)          # (n_bins, n_trajectories, latent_dim)
gene_traj = mf.decode_to_gene_space() # (n_bins, n_trajectories, n_genes)

Full worked examples are in the tutorials/ directory.

Citation

If you use MIOFlow in your research, please cite:

@misc{https://doi.org/10.48550/arxiv.2206.14928,
  doi = {10.48550/ARXIV.2206.14928},
  url = {https://arxiv.org/abs/2206.14928},
  author = {Huguet,  Guillaume and Magruder,  D. S. and Tong,  Alexander and Fasina,  Oluwadamilola and Kuchroo,  Manik and Wolf,  Guy and Krishnaswamy,  Smita},
  keywords = {Machine Learning (cs.LG),  FOS: Computer and information sciences,  FOS: Computer and information sciences},
  title = {Manifold Interpolating Optimal-Transport Flows for Trajectory Inference},
  publisher = {arXiv},
  year = {2022},
  copyright = {arXiv.org perpetual,  non-exclusive license}
}

License

MIOFlow is distributed under the terms of the Yale License.

Support

Acknowledgments

  • Built with PyTorch and torchdiffeq for neural ODE integration
  • Integrates with the scanpy / AnnData ecosystem for single-cell analysis
  • Optimal transport via the POT library
  • Geometric embedding via PHATE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mioflow-0.1.13.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mioflow-0.1.13-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file mioflow-0.1.13.tar.gz.

File metadata

  • Download URL: mioflow-0.1.13.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for mioflow-0.1.13.tar.gz
Algorithm Hash digest
SHA256 5a7b093c0c917cbe8c13b85a7a5d66c7d98648cf7ec90290fb3aa4afb65a67f0
MD5 5fe90226a9fefeb272be09713f6e5059
BLAKE2b-256 75de1df3d4fdcb33cc3c073d84d55d4029aec11f5bee3f9ad6aec5d51802dea5

See more details on using hashes here.

File details

Details for the file mioflow-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: mioflow-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for mioflow-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 efe868a2abe28702974d3d7199c4bfb15bd5d516114622182ac2fb046bf42c9d
MD5 d9f0dacc203f00afb6b78cdc8d63f477
BLAKE2b-256 303b820b9647e26bc1f8937ffc66ea39b88980e36c7a525d66a608bd6c8b98b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page