Supervised and single-sample copy-number correction tool for CRISPR-Cas9 screens
Branch: master
Clone or download
Latest commit 992a670 Feb 5, 2019

Crispy logo

License PyPI version DOI

Method to correct gene independent copy-number effects on CRISPR-Cas9 screens.


Crispy uses Sklearn implementation of Gaussian Process Regression, fitting each sample independently.


Install pybedtools and then install Crispy

conda install -c bioconda pybedtools

pip install cy


import crispy as cy
import matplotlib.pyplot as plt

# Import data
rawcounts, copynumber = cy.Utils.get_example_data()

# Import CRISPR-Cas9 library
lib = cy.Utils.get_crispr_lib()

# Instantiate Crispy
crispy = cy.Crispy(
    raw_counts=rawcounts, copy_number=copynumber, library=lib

# Fold-changes and correction integrated funciton.
# Output is a modified/expanded BED formated data-frame with sgRNA and segments information
bed_df = crispy.correct(x_features='ratio', y_feature='fold_change')

# Gaussian Process Regression is stored
crispy.gpr.plot(x_feature='ratio', y_feature='fold_change')


Credits and License

Developed at the Wellcome Sanger Institue (2017-2019).

For citation please refer to:

Gonçalves E, Behan FM, Louzada S, Arnol D, Stronach EA, Yang F, Yusa K, Stegle O, Iorio F, Garnett MJ (2019) Structural rearrangements generate cell-specific, gene-independent CRISPR-Cas9 loss of fitness effects. Genome Biol 20: 27