labranchor

Authors: Joseph M. Paggi , Gill Bejerano

License: CC BY-NC 4.0

Contributed by: Jun Cheng

Cite as: https://doi.org/10.1101/185868

Type: keras

Postprocessing: None

Trained on: High confidence set of branchpoints reported by Mercer et. al. 2015. Chromosome 1 was used for testing, chromosomes 2, 3, 4 for model selection and the remaining data were used for model training.

Source files

LaBranchoR (LSTM Branchpoint Retriever) uses a LSTM network built with keras to predict the position of RNA splicing branchpoints relative to a three prime splice site. Precisely evaluating LaBranchoR was challenging due to pervasive noise in the experimental data, but as we show in our paper, we estimate that LaBranchoR correcty predicts a branchpoint for over 90% of 3\''ss. Github link https://github.com/jpaggi/labranchor.

LaBranchoR predicts RNA splicing branchpoints using a Long Short-Term Memory network.

Description

A model to predict branchpoint from sequence by Paggi et al.. 2017(http://bejerano.stanford.edu/labranchor/).

Input of the model is one-hot-encoded 70bp sequence upstream a 3' acceptor site. Output are scores per basepair the probability to be a branchpoint.

Create a new conda environment with all dependencies installed
kipoi env create labranchor
source activate kipoi-labranchor
Test the model
kipoi test labranchor --source=kipoi
Make a prediction
kipoi get-example labranchor -o example
kipoi predict labranchor \
  --dataloader_args='{"fasta_file": "example/fasta_file", "gtf_file": "example/gtf_file", "length": 70}' \
  -o '/tmp/labranchor.example_pred.tsv'
# check the results
head '/tmp/labranchor.example_pred.tsv'
Create a new conda environment with all dependencies installed
kipoi env create labranchor
source activate kipoi-labranchor
Get the model
import kipoi
model = kipoi.get_model('labranchor')
Make a prediction for example files
pred = model.pipeline.predict_example(batch_size=4)
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
batch_iterator = dl.batch_iter(batch_size=4)
for batch in batch_iterator:
    # predict for a batch
    batch_pred = model.predict_on_batch(batch['inputs'])
Make predictions for custom files directly
pred = model.pipeline.predict(dl_kwargs, batch_size=4)
Get the model
library(reticulate)
kipoi <- import('kipoi')
model <- kipoi$get_model('labranchor')
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)
model$predict_on_batch(batch$inputs)
Make predictions for custom files directly
pred <- model$pipeline$predict(dl_kwargs, batch_size=4)
Get the docker image
docker pull kipoi/kipoi-docker:sharedpy3keras2tf2-slim
Get the full sized docker image
docker pull kipoi/kipoi-docker:sharedpy3keras2tf2
Get the activated conda environment inside the container
docker run -it kipoi/kipoi-docker:sharedpy3keras2tf2-slim
Test the model
docker run kipoi/kipoi-docker:sharedpy3keras2tf2-slim kipoi test labranchor --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/ kipoi/kipoi-docker:sharedpy3keras2tf2-slim \
kipoi get-example labranchor -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:sharedpy3keras2tf2-slim \
kipoi predict labranchor \
--dataloader_args='{'fasta_file': '/app/example/fasta_file', 'gtf_file': '/app/example/gtf_file', 'length': 70}' \
-o '/app/labranchor.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/labranchor.example_pred.tsv
    
Install apptainer
https://apptainer.org/docs/user/main/quick_start.html#quick-installation-steps
Make prediction for custom files directly
kipoi get-example labranchor -o example
kipoi predict labranchor \
--dataloader_args='{"fasta_file": "example/fasta_file", "gtf_file": "example/gtf_file", "length": 70}' \
-o 'labranchor.example_pred.tsv' \
--singularity 
# check the results
head labranchor.example_pred.tsv

Schema

Inputs

Dictionary of numpy arrays

Name: bidirectional_1_input

    Shape: (70, 4) 

    Doc: One-hot encoded RNA sequence


Targets

Single numpy array

Name: None

    Shape: (70,) 

    Doc: Predicted probability of being branchpoint along the sequence


Dataloader

Defined as: .

Doc: LaBranchoR predicts RNA splicing branchpoints using a Long Short-Term Memory network

Authors: Jun Cheng

Type: Dataset

License: MIT


Arguments

fasta_file : Reference genome sequence

gtf_file : file path; Genome annotation GTF file

length : length of considered candidate branchpoint region, upstream of 3'ss


Model dependencies
conda:
  • pip=20.2.4
  • python=3.7
  • bioconda::pysam=0.15.3

pip:
  • tensorflow==1.15
  • keras==2.1.6
  • h5py==2.9.0
  • kipoi
  • protobuf==3.20

Dataloader dependencies
conda:
  • python=3.7
  • bioconda::pysam=0.15.3
  • pip=20.2.4

pip:
  • numpy