Optimus_5Prime

Authors: Paul J. Sample

License: MIT

Contributed by: Ban Wang

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

Type: None

Postprocessing: None

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
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'
Create a new conda environment with all dependencies installed
kipoi env create Optimus_5Prime
source activate kipoi-Optimus_5Prime
Get the model
import kipoi
model = kipoi.get_model('Optimus_5Prime')
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('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 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 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/ kipoi/kipoi-docker:sharedpy3keras2tf2-slim \
kipoi get-example Optimus_5Prime -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:sharedpy3keras2tf2-slim \
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
    
Install apptainer
https://apptainer.org/docs/user/main/quick_start.html#quick-installation-steps
Make prediction for custom files directly
kipoi get-example Optimus_5Prime -o example
kipoi predict Optimus_5Prime \
--dataloader_args='{"gtf_file": "example/gtf_file", "fasta_file": "example/fasta_file"}' \
-o 'Optimus_5Prime.example_pred.tsv' \
--singularity 
# check the results
head 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=21.0.0

pip:
  • kipoi

Dataloader dependencies
conda:
  • python=3.6
  • pip=21.0.0
  • bioconda::pybedtools

pip:
  • kipoi
  • kipoiseq
  • gffutils==0.10.1