Charlesyip2016 / scPerturb

scPerturb: A resource and a python/R tool for single-cell perturbation data

Home Page:http://scperturb.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Website GitHub issues GitHub last commit

scPerturb: A resource and a python tool for single-cell perturbation data

doi:10.1101/2022.08.20.504663

Where to find the data

The datasets are available to download on scperturb.org (where you can also find a table of all included datasets) and alternatively on Zenodo:

scperturb for python (integrates with scanpy)

PyPI - Downloads

A python package to compute E-distances in single-cell perturbation data and perform E-tests.

Install

Just install via pip:

pip install scperturb

Usage example

Check out this notebook for a tutorial. Basic usage is:

# E-distances
estats = edist(adata, obs_key='perturbation')
# E-distances to a specific group (e.g. 'control')
estats_control = estats.loc['control']
# E-test for difference to control
df = etest(adata, obs_key='perturbation', obsm_key='X_pca', dist='sqeuclidean', control='control', alpha=0.05, runs=100)

scperturbR for R (integrates with Seurat)

R-CMD-check

We wrote an R version of scperturb that works with Seurat objects. You can find it as scperturbR on CRAN. A basic usage vignette is WIP. Install using:

install.packages('scperturbR')

Instructions to run the code to recreate the manuscript figures

  • install conda if necessary (also check out mamba, it's way faster)
  • run "conda env create -f sc_env.yaml" to create a new conda environment with all the necessary packages to run the code (you will need this)
  • activate the environment with "conda activate sc_env"
  • download all the datasets from scperturb.org
  • in "config.yaml", change paths, especially the one to the directory where the data was downloaded to
  • run the notebooks in "notebooks" to produce the figures and tables found in the paper / supplement and the website (each saved to a different folder)

About

scPerturb: A resource and a python/R tool for single-cell perturbation data

http://scperturb.org/


Languages

Language:Jupyter Notebook 99.3%Language:HTML 0.4%Language:Python 0.3%Language:R 0.0%Language:JavaScript 0.0%Language:CSS 0.0%