Optimus_5Prime

Authors: Paul J. Sample , Ban Wang , David W. Reid , Vlad Presnyak , Iain McFadyen , David R. Morris , Georg Seelig

License: MIT

Contributed by: Ban Wang

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

Type: None

Postprocessing: variant_effects

Trained on: Data from MPRA experiment using eGFP library on HEK293T cells. Trained on 280,000 of the 300,000-member eGFP library. The remaining 20,000 sequences were withheld for testing.

Source files

Model from Sample et al: Human 5 prime UTR design and variant effect prediction from a massively parallel translation assay.

Create a new conda environment with all dependencies installed
kipoi env create Optimus_5Prime
source activate kipoi-Optimus_5Prime
Install model dependencies into current environment
kipoi env install Optimus_5Prime
Test the model
kipoi test Optimus_5Prime --source=kipoi
Make a prediction
kipoi get-example Optimus_5Prime -o example
kipoi predict Optimus_5Prime \
  --dataloader_args='{"gtf_file": "example/gtf_file", "fasta_file": "example/fasta_file"}' \
  -o '/tmp/Optimus_5Prime.example_pred.tsv'
# check the results
head '/tmp/Optimus_5Prime.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('Optimus_5Prime')
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)
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('Optimus_5Prime')
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 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 Optimus_5Prime --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 Optimus_5Prime -o /app/example 
docker run -v $PWD/kipoi-example:/app/ haimasree/kipoi-docker:sharedpy3keras2 \
kipoi predict Optimus_5Prime \
--dataloader_args='{'gtf_file': '/app/example/gtf_file', 'fasta_file': '/app/example/fasta_file'}' \
-o '/app/Optimus_5Prime.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/Optimus_5Prime.example_pred.tsv

Schema

Inputs

Single numpy array

Name: seq

    Shape: (50, 4) 

    Doc: 50nt 5 prime UTR sequence


Targets

Single numpy array

Name: None

    Shape: (1,) 

    Doc: Predicted mean ribosome load


Dataloader

Defined as: .

Doc: Dataloader for 5-prime UTR

Authors: Ziga Avsec

Type: Dataset

License: MIT


Arguments

gtf_file : file path; Genome annotation GTF file

fasta_file : Reference genome sequence

disable_infer_transcripts : option to disable infering transcripts. Can be True if the gtf file has transcripts annotated.

disable_infer_genes : option to disable infering genes. Can be True if the gtf file has genes annotated.


Model dependencies
conda:
  • tensorflow=1.4.1
  • keras=2.1.6
  • python=3.6
  • pip=20.2.4

pip:

Dataloader dependencies
conda:
  • python=3.6
  • pip=20.2.4
  • bioconda::pybedtools=0.8.1

pip:
  • kipoi
  • kipoiseq
  • gffutils==0.10.1