Skip to main content

ScGen - Predicting single cell perturbations

Project description

scGen PyPI version Build Status Documentation Status

Introduction

A tensorflow implementation of scGen. scGen is a generative model to predict single-cell perturbation response across cell types, studies and species (Nature Methods, 2019) .

Getting Started

*What you can do with scGen:

  • Train on a dataset wih multiple cell types and conditions and predict the the perturbation effect on the cell type which you only have in one condition. This scenario can be extended to multiple species where you want to predict the effect of a specific species using another or all the species.

  • Train on a dataset where you have two conditions (e.g. control and perturbed) and predict on second dataset with similar genes.

  • Remove batch effect on labeled data. In this scenario you need to provide cell_type and batch labels to the method. Note that batch_removal does not require all cell types to be present in all datasets (batches). If you have dataset specific cell type it will preserved as before.

  • We assume there exist two conditions in you dataset (e.g. control and perturbed). You can train the model and with your data and predict the perturbation for the cell type/species of interest.

  • We recommend to use normalized data for the training. A simple example for normalization pipeline using scanpy:

import scanpy as sc
adata = sc.read(data)
sc.pp.normalize_per_cell(adata)
sc.pp.log1p(adata)
  • We further recommend to use highly variable genes (HVG). For the most examples in the paper we used top ~7000 HVG. However, this is optional and highly depend on your application and computational power.

Installation

Installation with pip

To install the latest version from PyPI, simply use the following bash script:

pip install scgen

or install the development version via pip:

pip install git+https://github.com/theislab/scgen.git

or you can first install flit and clone this repository:

pip install flit
git clone https://github.com/theislab/scGen
cd scgen
flit install

On Windows machines you may need to download a C++ compiler if you wish to build from source yourself.

Examples

  • For perturbation prediction check this example for interferon (IFN)-β stimulation from Kang et al..

  • For batch removal check our example on integrating four pancreas datasets.

Reproducing paper results:

In order to reproduce paper results visit here.

References

Lotfollahi, Mohammad and Wolf, F. Alexander and Theis, Fabian J. "scGen predicts single-cell perturbation responses." Nature Methods, 2019. pdf

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

scgen-1.1.1.tar.gz (951.4 kB view details)

Uploaded Source

Built Distribution

scgen-1.1.1-py2.py3-none-any.whl (132.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file scgen-1.1.1.tar.gz.

File metadata

  • Download URL: scgen-1.1.1.tar.gz
  • Upload date:
  • Size: 951.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for scgen-1.1.1.tar.gz
Algorithm Hash digest
SHA256 87a834fe3a2a7c853b2be06705b9b2b6472cdded3f7ab32013eb8b73f61b5c5d
MD5 0c4970ae2208bd6feb401b2fcaeaab74
BLAKE2b-256 0a096cdfb02bbd3d2c40404384ebe545e0020fe0b3399657ff2c446d3d0626d2

See more details on using hashes here.

File details

Details for the file scgen-1.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: scgen-1.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 132.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for scgen-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 64582ea79985168347fa8e8cde0e445e3974747f4e9566429e7534f8fb58e5b9
MD5 d76fc9cafe47ccc9237b4a71d468d048
BLAKE2b-256 623ed23fdbeb21a9c3124892eae5961b8d452fc233502c73ac4413211fa3bfd5

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