Skip to main content

GEARS: Predicting transcriptional outcomes of novel multi-gene perturbations

This repository hosts the official implementation of GEARS, a method that can predict transcriptional response to both single and multi-gene perturbations using single-cell RNA-sequencing data from perturbational screens.

gears

Installation

Install PyG, and then do pip install cell-gears.

Core API Interface

Using the API, you can (1) reproduce the results in our paper and (2) train GEARS on your perturbation dataset using a few lines of code.

from gears import PertData, GEARS

# get data
pert_data = PertData('./data')
# load dataset in paper: norman, adamson, dixit.
pert_data.load(data_name = 'norman')
# specify data split
pert_data.prepare_split(split = 'simulation', seed = 1)
# get dataloader with batch size
pert_data.get_dataloader(batch_size = 32, test_batch_size = 128)

# set up and train a model
gears_model = GEARS(pert_data, device = 'cuda:8')
gears_model.model_initialize(hidden_size = 64)
gears_model.train(epochs = 20)

# save/load model
gears_model.save_model('gears')
gears_model.load_pretrained('gears')

# predict
gears_model.predict([['CBL', 'CNN1'], ['FEV']])
gears_model.GI_predict([['CBL', 'CNN1'], ['FEV', 'AHR']])

To use your own dataset, create a scanpy adata object with a gene_name column in adata.var, and two columns condition, cell_type in adata.obs. Then run:

pert_data.new_data_process(dataset_name = 'XXX', adata = adata)
# to load the processed data
pert_data.load(data_path = './data/XXX')

Demos

Name Description
Dataset Tutorial Tutorial on how to use the dataset loader and read customized data
Model Tutorial Tutorial on how to train GEARS
Plot top 20 DE genes Tutorial on how to plot the top 20 DE genes
Uncertainty Tutorial on how to train an uncertainty-aware GEARS model

Colab

Name Description
Using Trained Model Use a model trained on Norman et al. 2019 to make predictions (Needs Colab Pro)

Cite Us

@article {Roohani2022.07.12.499735,
	author = {Roohani, Yusuf and Huang, Kexin and Leskovec, Jure},
	title = {GEARS: Predicting transcriptional outcomes of novel multi-gene perturbations},
	year = {2022},
	doi = {10.1101/2022.07.12.499735},
	publisher = {Cold Spring Harbor Laboratory},
	journal = {bioRxiv}
}

Preprint: Link

Code for reproducing figures: Link

Download files

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

Source Distribution

cell-gears-0.0.3.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

cell_gears-0.0.3-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file cell-gears-0.0.3.tar.gz.

File metadata

  • Download URL: cell-gears-0.0.3.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for cell-gears-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8f8ad88ffb5ca590c6ad2bbb4e6ca8ed64a2fcf0d9d5d1042ffea5f95cd8db0a
MD5 f63dc3f30f1945f19595994814dab6c0
BLAKE2b-256 bc7693a2848c9283e87f470b277fb20ab0258d6741749550e3d4f1f563e5b560

See more details on using hashes here.

File details

Details for the file cell_gears-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cell_gears-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for cell_gears-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 764f575926c34ca34c16b7dd4c53914e209ccfc925a44c420debb0b693746357
MD5 dec4634ac8826a1b0d917fa9772cd2c6
BLAKE2b-256 80bf087ac36384fe390aefeb8a6a125deefd7aa872e8adaa0ef382406802df26

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 Sentry Error logging StatusPage Status page