ScGen - Predicting single cell perturbations
Project description
scGen
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.
- If you plan to use GPU, please consider installing tensorflow-GPU after installing scgen.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scgen-1.1.5.tar.gz
.
File metadata
- Download URL: scgen-1.1.5.tar.gz
- Upload date:
- Size: 946.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e570050fb07ae322151586357ff36e3b1f109e1f738ee9882bade025ab5edb3 |
|
MD5 | 2975fb0f812d532d404a78170e3474df |
|
BLAKE2b-256 | f1e180815a5c232ff882485632573e582c9109fa8411d59a2e8b008f67fcb58a |
File details
Details for the file scgen-1.1.5-py2.py3-none-any.whl
.
File metadata
- Download URL: scgen-1.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4847487f9470ae3667172699dc326c5e3230f5ae9753a5a7beb49132c888cf33 |
|
MD5 | 627da29282ed1c9e617740272da7e67e |
|
BLAKE2b-256 | 493f435aa3c8951388adf57ac150183affa5525afa49801cf316a7d3d815e4fc |