Skip to main content

scConfluence is a novel diagonal integration method combining uncoupled autoencoders and Optimal Transport on single-cell data.

Project description

scConfluence

Tests codecov Documentation Status PyPI version Code style: black

scConfluence is a novel method for the integration of unpaired multiomics data combining uncoupled autoencoders and Inverse Optimal Transport to learn low-dimensional cell embeddings. These embeddings can then be used for visualization and clustering, useful for discovering subpopulations of cells, and for imputation of features across modalities. Read the preprint!

figure

Install the package

scConfluence is implemented as a Python package seamlessly integrated within the scverse ecosystem, in particular Muon and Scanpy.

via PyPI

On all operating systems, the easiest way to install scConfluence is via PyPI. Installation should typically take a minute and is continuously tested with Python 3.10 on an Ubuntu virtual machine.

pip install scconfluence

via GitHub (development version)

git clone git@github.com:cantinilab/scconfluence.git
cd scconfluence
pip install .

Test your development installation (optional)

pip install pytest
pytest .

Getting started

scConfluence takes as an input a MuData object and populates its obsm field with the latent embeddings. Visit http://scconfluence.rtfd.io/ for more documentation and tutorials (which can be found now in the tutorials folder of this repository).

You may download a preprocessed 10X Multiome demo dataset here.

A GPU is not required for the method to run, but is strongly recommended.

import scconfluence
import mudata as md
import scanpy as sc
from scipy.spatial.distance import cdist

# Load data into a Muon object.
mdata = md.read_h5mu("my_data.h5mu")

# Compute the cross-modality distance matrix using connected features
mdata.uns["cross_modality1+modality2"] = cdist(mdata["modality1"].obsm["cm_features"], 
                                               mdata["modality2"].obsm["cm_features"])
mdata.uns["cross_keys"] = ["cross_modality1+modality2"]


# Initialize and train the model.
autoencoders = {"modality1": scconfluence.model.AutoEncoder(mdata["modality1"],
                                                             modality="modality1"),
                "modality2": scconfluence.model.AutoEncoder(mdata["modality2"],
                                                             modality="modality2")}
model = scconfluence.model.ScConfluence(mdata, unimodal_aes=autoencoders)
model.fit(save_path="results")
mdata.obsm["latent"] = model.get_latent().loc[mdata.obs_names]

# Visualize the embedding with UMAP.
sc.pp.neighbors(mdata, use_rep="latent")
sc.tl.umap(mdata)
sc.pl.umap(mdata)

Our preprint

https://www.biorxiv.org/content/10.1101/2024.02.26.582051v1

@article {Samaran2024unpaired,
  author = {Jules Samaran and Gabriel Peyre and Laura Cantini},
  title = {scConfluence : single-cell diagonal integration with regularized Inverse Optimal Transport on weakly connected features},
  year = {2024},
  doi = {10.1101/2024.02.26.582051},
  publisher = {Cold Spring Harbor Laboratory},
  journal = {bioRxiv}
}

If you're looking for the repository with code to reproduce the experiments in our preprint, here it is!

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

scconfluence-0.1.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

scconfluence-0.1.1-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file scconfluence-0.1.1.tar.gz.

File metadata

  • Download URL: scconfluence-0.1.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/22.3.0

File hashes

Hashes for scconfluence-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d1cb90255255dd4f4e93ca3e17908b6462304109a6c9ef6d16974123865dc5fa
MD5 0f709fe25e318cba336a3d59035892df
BLAKE2b-256 78d1f9e67538fce8e2480f19d1731f2d449385d6df338fb5c4db0d86d4f5c4fe

See more details on using hashes here.

File details

Details for the file scconfluence-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scconfluence-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/22.3.0

File hashes

Hashes for scconfluence-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53ef6f704afab7b3d6196c70dcf686bf7cb086561c82e18b9a2a573c565e266b
MD5 60867b2e9674fb2f7c3403408cf30c81
BLAKE2b-256 5de8fa17c44bbe74cb0dc7a515b2ed1d602716b21a96dcf0620e9c9220b414ae

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