Skip to main content

Cell DISentangled Experts for Covariate counTerfactuals (CellDISECT). Causal generative model designed to disentangle known covariate variations from unknown ones at test time while simultaneously learning to make counterfactual predictions.

Project description

celldisect-logo

PyPI version License Stars

Cell DISentangled Experts for Covariate counTerfactuals (CellDISECT)

CellDISECT is a causal generative model designed to disentangle known covariate variations from unknown ones at test time while simultaneously learning to make counterfactual predictions. CellDISECT finds multiple latent representations for each cell, one unsupervised, and the rest weakly supervised by the provided covariates.

Its latent space captures not only covariate-specific information but also new biology, thereby offering users a multifaceted view of the data and enhancing the ability for cell type discovery.

Moreover, by using different "expert" models to learn each latent it achieves flexible fairness in single-cell analysis. This flexibility allows choosing which covariates to use as biological and which as batch, at test time, as opposed to at train time like with most methods.

Finally, it can model the effect of perturbations on one or many covariates by calculating the counterfactual gene expression under the perturbations.

Installation

Prerequisites

Conda Environment

We recommend using Anaconda/Miniconda to create a conda environment for using CellDISECT. You can create a python environment using the following command:

conda create -n CellDISECT python=3.9

Then, you can activate the environment using:

conda activate CellDISECT
  • Install pytorch (This version of CellDISECT is tested with pytorch 2.1.2 and cuda 12, install the appropriate version of pytorch for your system.)
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia
  • (Optional) if you plan to use RAPIDS/rapids-singlecell:
pip install \
    --extra-index-url=https://pypi.nvidia.com \
    cudf-cu12==24.4.* dask-cudf-cu12==24.4.* cuml-cu12==24.4.* \
    cugraph-cu12==24.4.* cuspatial-cu12==24.4.* cuproj-cu12==24.4.* \
    cuxfilter-cu12==24.4.* cucim-cu12==24.4.* pylibraft-cu12==24.4.* \
    raft-dask-cu12==24.4.* cuvs-cu12==24.4.*

pip install rapids-singlecell
  • Install CellDISECT You can either install the stable version published on pypi using pip:
pip install celldisect

Or you can install the latest developed version directly from our github:

pip install git+https://github.com/Lotfollahi-lab/CellDISECT
  • (Optional) to install cuda enabled jax:
pip install -U "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

How to use CellDISEC

Description Link
Counterfactual prediction and DEG analysis Open In Colab - Open In Github

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

celldisect-0.1.1.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

celldisect-0.1.1-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: celldisect-0.1.1.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for celldisect-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8acb5f92c08654ca2bc7864d5b309ba6e19a1b15efcad09a94dc74b17e9dc204
MD5 c7bfb39eb68b8bc572f642d9112422d1
BLAKE2b-256 bcfe4e09424c6ab1995305768621ea7a3409423f6af6dba27c6eec0a3bf3a839

See more details on using hashes here.

File details

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

File metadata

  • Download URL: celldisect-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for celldisect-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f508f1741f114164979134829665f22a2b345c699b84bf073dd1959b8a9b7c2d
MD5 63ac2bc494ee26e6c6b6aace1557424c
BLAKE2b-256 f0a25da181f7b8e0b8bf0725e30b679b448c8a85db3da82932d249f58037b656

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