Giter VIP home page Giter VIP logo

deepcrispr's Introduction

DeepCRISPR

DOI

Introduction

DeepCRISPR is a deep learning based prediction model for sgRNA on-target knockout efficacy and genome-wide off-target cleavage profile prediction.

This model is based on a carefully designed hybrid deep neural network for model training and prediction.

Current version focuses on conventional NGG-based sgRNA design for SpCas9 in human species, for it is widely used in related experiments.

Requirement

  • python == 3.6
  • tensorflow == 1.3.0
  • sonnet == 1.9

Docker image

docker pull michaelchuai/deepcrispr:latest

Note:

  1. Using the command above to attain DeepCRISPR image;
  2. The path of DeepCRISPR program and trained models in the image is /root/DeepCRISPR.

Usage

  1. Digitalize sgRNA using the following sgRNA Coding Schema. Epigenetics features can be found in ENCODE.
  2. Load models from model directories (untar them first!) in trained_models.
  3. Perform prediction.

sgRNA Coding Schema

On-target prediction

Digitalization

Choose 4 channels for sequence-only prediction or 8 channels for full-featured prediction, according to the sgRNA Coding Schema above.

import tensorflow as tf
from deepcrispr import DCModelOntar

seq_feature_only = False
channels = 4 if seq_feature_only else 8
x_on_target = ...     # [batch_size, channels, 1, 23]

Loading Model

sess = tf.InteractiveSession()
on_target_model_dir = '<model path>'
# using regression model, otherwise classification model
is_reg = True
# using sequences feature only, otherwise sequences feature + selected epigenetic features
seq_feature_only = False
dcmodel = DCModelOntar(sess, on_target_model_dir, is_reg, seq_feature_only)
Model file name Description
ontar_ptaug_cnn.tar.gz CNN-based on-target classification model with pre-training and data augmentation
ontar_pt_cnn_reg.tar.gz CNN-based on-target regression model with pre-training and data augmentation
ontar_cnn_reg_seq.tar.gz Sequence feature-only CNN-based on-target regression model with data augmentation

Prediction

predicted_on_target = dcmodel.ontar_predict(x_on_target)

Off-target prediction

Digitalization

Off-target prediction supports full-featured prediction only.

import tensorflow as tf
from deepcrispr import DCModelOfftar

channels = 8
x_on_target = ...       # [batch_size, channels, 1, 23]
x_sg_off_target = ...   # [batch_size, channels, 1, 23]
x_ot_off_target = ...   # [batch_size, channels, 1, 23]

Loading Model

sess = tf.InteractiveSession()
off_target_model_dir = '<model path>'
# using regression model, otherwise classification model
is_reg = True
dcmodel = DCModelOfftar(sess, off_target_model_dir, is_reg)
Model file name Description
offtar_pt_cnn.tar.gz CNN-based off-target classification model with pre-training
ontar_pt_cnn_reg.tar.gz CNN-based off-target regression model with pre-training

Prediction

predicted_off_target = dcmodel.offtar_predict(x_sg_off_target, x_ot_off_target)

Citation

Guohui Chuai, Qi Liu et al. DeepCRISPR: optimized CRISPR guide RNA design by deep learning. 2018 (Manuscript submitted)

Contacts

[email protected] or [email protected]

deepcrispr's People

Contributors

michaelchuai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepcrispr's Issues

Encoding for off-target prediction

I'm wondering how we're supposed to encode epigenetic information for passing into the "off-target" version of the pipeline. The model wants both the sgRNA and the target as 8-channel vectors that include epigenetetic information ... what should we put in those channels on the sgRNA? Should they be zeros? Should they match what is in the target?

I'm trying to run the off-target scoring algorithm and I'm not getting any values that make sense. Even perfect matches between the sgRNA and the target are giving extremely low values.

off_target_model_dir = '../DeepCRISPR/trained_models/offtar_pt_cnn/'
is_reg = False
dcmodel_off = DCModelOfftar(sess, off_target_model_dir, is_reg)
seq = 'GTTAGACCAGATCTGAGCCTTGG'
encoded = encoder([seq]) #Does one-hot encoding to correct shape, all epigenetic factors are zero
res = dcmodel_off.offtar_predict(encoded, encoded)
# res = 1.4075727e-35

I've tried all combinations of epi factors and the scores are still very low. Since the sgRNA and target are exact matches I would expect a 100% score, or at least something reasonably high for at least one combination of epi factors.

Am I encoding things wrong? Am I misunderstanding your paper and it is actually low values that are indicative of off-target activity?

I've run this across a large collection of sgRNAs across various targets to compare this with the CFD score.
ds_cfd
Here I've plotted the maximum DeepCRISPR score across all of the different epi-conditions for each sgRNA/target pair vs the CFD score for the same pair. No DeepCRISPR score is above 1E-7 Something is clearly going wrong.

Can you help me understand what I'm doing wrong here. I am able to get sensible results out of these sgRNAs out of the on-target pipeline.

data missing

Hi, the data for evaluation g) (Testing scenario 8—regression schema on an independent dataset) of the paper is not in the data zip, can you provide this data both for classification and regression.
thank you

dm-sonnet version not exist?

dm-sonnet version == 1.9 does not exist - which version is compatible with the current code?
//
says 1.9 but 1.19 works

Error when running examples

I'm getting this error while running run_examples.py :

image

I've tried Python versions 3.6.9, 3.6.0, Tensorflow 1.3.0 and dm-sonnet 1.19.
I am not sure how to fix this issue. Any help would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.