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 Distribution

cpa_tools-0.7.2.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

cpa_tools-0.7.2-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file cpa_tools-0.7.2.tar.gz.

File metadata

  • Download URL: cpa_tools-0.7.2.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.4.0-132-generic

File hashes

Hashes for cpa_tools-0.7.2.tar.gz
Algorithm Hash digest
SHA256 a49c7c90b315ed122714fa3a4331cab099cad90425e652a79f41e31c54baa0b4
MD5 cd6c98532f1f41982c8fb6af4f7cb156
BLAKE2b-256 c90b76861a8127cbf8833fac5be0b22bc6c6e62b9e9c04812f75f8ccb5d6faa1

See more details on using hashes here.

File details

Details for the file cpa_tools-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: cpa_tools-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.4.0-132-generic

File hashes

Hashes for cpa_tools-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4411f93600a57b971f424fa4de3eef44e54d3645839f06e49ed7c9d31900a38b
MD5 2f464535e0e71ca3f7518fcac30adea9
BLAKE2b-256 630a5383c9a94f0f064da052492c8fb1cbed575e1b3a47f086e79fb4a09ecf64

See more details on using hashes here.

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