Authors: Žiga Avsec , Mohammadamin Barekatain , Jun Cheng , Julien Gagneur

License: MIT

Contributed by: Ziga Avsec

Cite as: https://doi.org/10.1093/bioinformatics/btx727

Type: keras

Postprocessing: variant_effects

Trained on: RBP occupancy peaks measured by eCLIP-seq (Van Nostrand et al., 2016 - https://doi.org/10.1038/nmeth.3810), https://github.com/gagneurlab/Manuscript_Avsec_Bioinformatics_2017 4000 training samples, 1000 validation sites, 1000 testing samples.

Source files

'RBP binding model from Avsec et al: "Modeling positional effects of regulatory sequences with spline transformations increases prediction accuracy of deep neural networks". '

112 eCLIP models from: https://doi.org/10.1093/bioinformatics/btx727

Associated code is located at: github.com/gagneurlab/Manuscript_Avsec_Bioinformatics_2017

Create a new conda environment with all dependencies installed
kipoi env create rbp_eclip
source activate kipoi-rbp_eclip
Install model dependencies into current environment
kipoi env install rbp_eclip
Test the model
kipoi test rbp_eclip/GNL3 --source=kipoi
Make a prediction
kipoi get-example rbp_eclip/GNL3 -o example
kipoi predict rbp_eclip/GNL3 \
  --dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file", "gtf_file": "example/gtf_file", "target_file": "example/target_file", "filter_protein_coding": true}' \
  -o '/tmp/rbp_eclip|GNL3.example_pred.tsv'
# check the results
head '/tmp/rbp_eclip|GNL3.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('rbp_eclip/GNL3')
Make a prediction for example files
pred = model.pipeline.predict_example()
Use dataloader and model separately
# Download example dataloader kwargs
dl_kwargs = model.default_dataloader.download_example('example')
# Get the dataloader and instantiate it
dl = model.default_dataloader(**dl_kwargs)
# get a batch iterator
it = dl.batch_iter(batch_size=4)
# predict for a batch
batch = next(it)
Make predictions for custom files directly
pred = model.pipeline.predict(dl_kwargs, batch_size=4)
Get the model
kipoi <- import('kipoi')
model <- kipoi$get_model('rbp_eclip/GNL3')
Make a prediction for example files
predictions <- model$pipeline$predict_example()
Use dataloader and model separately
# Download example dataloader kwargs
dl_kwargs <- model$default_dataloader$download_example('example')
# Get the dataloader
dl <- model$default_dataloader(dl_kwargs)
# get a batch iterator
it <- dl$batch_iter(batch_size=4)
# predict for a batch
batch <- iter_next(it)
Make predictions for custom files directly
pred <- model$pipeline$predict(dl_kwargs, batch_size=4)
Get the docker image
docker pull haimasree/kipoi-docker:sharedpy3keras2
Get the activated conda environment inside the container
docker run -it haimasree/kipoi-docker:sharedpy3keras2
Test the model
docker run haimasree/kipoi-docker:sharedpy3keras2 kipoi test rbp_eclip/GNL3 --source=kipoi
Make prediction for custom files directly
# Create an example directory containing the data
mkdir -p $PWD/kipoi-example 
# You can replace $PWD/kipoi-example with a different absolute path containing the data 
docker run -v $PWD/kipoi-example:/app/ haimasree/kipoi-docker:sharedpy3keras2 \
kipoi get-example rbp_eclip/GNL3 -o /app/example 
docker run -v $PWD/kipoi-example:/app/ haimasree/kipoi-docker:sharedpy3keras2 \
kipoi predict rbp_eclip/GNL3 \
--dataloader_args='{'intervals_file': '/app/example/intervals_file', 'fasta_file': '/app/example/fasta_file', 'gtf_file': '/app/example/gtf_file', 'target_file': '/app/example/target_file', 'filter_protein_coding': True}' \
-o '/app/rbp_eclip_GNL3.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/rbp_eclip_GNL3.example_pred.tsv



Dictionary of numpy arrays

Name: seq

    Shape: (101, 4) 

    Doc: One-hot encoded RNA sequence

Name: dist_tss

    Shape: (1, 10) 

    Doc: Distance the nearest TSS site transformed with B-splines

Name: dist_polya

    Shape: (1, 10) 

    Doc: Distance the nearest Poly-A site transformed with B-splines

Name: dist_exon_intron

    Shape: (1, 10) 

    Doc: Distance the nearest exon_intron (splice donor) site transformed with B-splines

Name: dist_intron_exon

    Shape: (1, 10) 

    Doc: Distance the nearest intron_exon (splice acceptor) site transformed with B-splines

Name: dist_start_codon

    Shape: (1, 10) 

    Doc: Distance the nearest start codon transformed with B-splines

Name: dist_stop_codon

    Shape: (1, 10) 

    Doc: Distance the nearest stop codon transformed with B-splines

Name: dist_gene_start

    Shape: (1, 10) 

    Doc: Distance the nearest gene start transformed with B-splines

Name: dist_gene_end

    Shape: (1, 10) 

    Doc: Distance the nearest gene end transformed with B-splines


Single numpy array

Name: None

    Shape: (1,) 

    Doc: Predicted binding strength


Defined as: .

Doc: RBP binding model taking as input 101nt long sequence as well as 8 distances to nearest genomic landmarks - tss, poly-A, exon-intron boundary, intron-exon boundary, start codon, stop codon, gene start, gene end

Authors: Ziga Avsec

Type: None

License: MIT


intervals_file : bed6 file with `chrom start end id score strand` columns

fasta_file : Reference genome sequence

gtf_file : file path; Genome annotation GTF file

target_file (optional): path to the targets (txt) file

filter_protein_coding (optional): Considering genomic landmarks only for protein coding genes when computing the distances to the nearest genomic landmark.

position_transformer_file : Provided file for each dataloader obtained from https://sandbox.zenodo.org/record/248594/files/GNL3.dataloader.pkl?download=1

use_linecache (optional): if True, use linecache https://docs.python.org/3/library/linecache.html to access bed file rows

Model dependencies
  • pip=20.3.3

  • concise==0.6.9
  • tensorflow==1.4.1
  • keras==2.1.6
  • numpy==1.17.4
  • h5py==2.10.0

Dataloader dependencies
  • bioconda::pybedtools
  • bioconda::pysam=0.15.3
  • bioconda::genomelake=0.1.4
  • bioconda::pybigwig
  • bioconda::pyfaidx
  • bioconda::gtfparse>=1.0.7
  • python=3.6
  • cython
  • scikit-learn=0.18.1
  • pandas=0.23.4
  • pip=20.3.3

  • concise>=0.6.6
  • numpy>=1.13.3