Skip to main content

Compositional Perturbation Autoencoder (CPA)

Project description

CPA - Compositional Perturbation Autoencoder PyPI version Documentation Status Downloads

What is CPA?

Alt text

CPA is a framework to learn the effects of perturbations at the single-cell level. CPA encodes and learns phenotypic drug responses across different cell types, doses, and combinations. CPA allows:

  • Out-of-distribution predictions of unseen drug and gene combinations at various doses and among different cell types.
  • Learn interpretable drug and cell-type latent spaces.
  • Estimate the dose-response curve for each perturbation and their combinations.
  • Transfer pertubration effects from on cell-type to an unseen cell-type.

Installation

Requirements

Conda Environment

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

conda create -n cpa python=3.8

Then, you can activate the environment using:

conda activate cpa

Pytorch

CPA is implemented in Pytorch and requires Pytorch version >= 1.13.1.

OSX
pip install torch==1.13.1
Linux and Windows

If you have access to GPUs, you can install the GPU version of Pytorch following the instructions here.

Sample command for installing Pytorch 1.13.1 on different CUDA versions:

# ROCM 5.2 (Linux only)
pip install torch==1.13.1+rocm5.2 --extra-index-url https://download.pytorch.org/whl/rocm5.2
# CUDA 11.6
pip install torch==1.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
# CUDA 11.7
pip install torch==1.13.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
# CPU only
pip install torch==1.13.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu

Installing CPA

You can install CPA using pip:

pip install cpa-tools

How to use CPA

Several tutorials are available here to get you started with CPA. The following table contains the list of tutorials:

Dataset Year Description Link
Combo Sci-Plex 2022 CPA Training demo on combo sciplex Open In Colab - Open In Documentation
Combo Sci-Plex 2022 CPA Training demo on combo sciplex with rdkit embeddings as pretrained drug embeddings Open In Colab - Open In Documentation
Norman et al. 2019 CPA Training demo on Norman CRISPR scRNA perturbation dataset Open In Colab - Open In Documentation
Kang et al. 2018 Context transfer (i.e. predict the effect of a perturbation (e.g. disease) on unseen cell types or transfer perturbation effects from one context to another) demo on IFN-β scRNA perturbation dataset Open In Colab - Open In Documentation

How to optmize CPA hyperparamters for your data

Datasets and Pre-trained models

Datasets and pre-trained models are available here.

Support and contribute

If you have a question or new architecture or a model that could be integrated into our pipeline, you can post an issue

Reference

If CPA is helpful in your research, please consider citing the Lotfollahi et al. 2023

@article{lotfollahi2023predicting,
    title={Predicting cellular responses to complex perturbations in high-throughput screens},
    author={Lotfollahi, Mohammad and Klimovskaia Susmelj, Anna and De Donno, Carlo and Hetzel, Leon and Ji, Yuge and Ibarra, Ignacio L and Srivatsan, Sanjay R and Naghipourfar, Mohsen and Daza, Riza M and 
    Martin, Beth and others},
    journal={Molecular Systems Biology},
    pages={e11517},
    year={2023}
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cpa_tools-0.8.0-py3-none-any.whl (45.0 kB view hashes)

Uploaded Python 3

Supported by

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