CleTimer/customBP

Authors: Leohnard Wachutka , Stefan Dvoretskii , Julien Gagneur , Patrick Cramer

License: Apache License v2

Contributed by: Leohnard Wachutka , Stefan Dvoretskii , Julien Gagneur , Patrick Cramer

Cite as:

Type: None

Postprocessing: None

Trained on:

Source files

Linear model predicting intron donor and acceptor cleavage time.

Create a new conda environment with all dependencies installed
kipoi env create CleTimer/customBP
source activate kipoi-CleTimer__customBP
Test the model
kipoi test CleTimer/customBP --source=kipoi
Make a prediction
kipoi get-example CleTimer/customBP -o example
kipoi predict CleTimer/customBP \
  --dataloader_args='{"gtf_file": "example/gtf_file", "fasta_file": "example/fasta_file", "bp_idx_file": "example/bp_idx_file", "create_introns": true}' \
  -o '/tmp/CleTimer|customBP.example_pred.tsv'
# check the results
head '/tmp/CleTimer|customBP.example_pred.tsv'
Create a new conda environment with all dependencies installed
kipoi env create CleTimer/customBP
source activate kipoi-CleTimer__customBP
Get the model
import kipoi
model = kipoi.get_model('CleTimer/customBP')
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('CleTimer/customBP')
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:sharedpy3keras2tf1-slim
Get the full sized docker image
docker pull kipoi/kipoi-docker:sharedpy3keras2tf1
Get the activated conda environment inside the container
docker run -it kipoi/kipoi-docker:sharedpy3keras2tf1-slim
Test the model
docker run kipoi/kipoi-docker:sharedpy3keras2tf1-slim kipoi test CleTimer/customBP --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:sharedpy3keras2tf1-slim \
kipoi get-example CleTimer/customBP -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:sharedpy3keras2tf1-slim \
kipoi predict CleTimer/customBP \
--dataloader_args='{'gtf_file': '/app/example/gtf_file', 'fasta_file': '/app/example/fasta_file', 'bp_idx_file': '/app/example/bp_idx_file', 'create_introns': True}' \
-o '/app/CleTimer_customBP.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/CleTimer_customBP.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 CleTimer/customBP -o example
kipoi predict CleTimer/customBP \
--dataloader_args='{"gtf_file": "example/gtf_file", "fasta_file": "example/fasta_file", "bp_idx_file": "example/bp_idx_file", "create_introns": true}' \
-o 'CleTimer_customBP.example_pred.tsv' \
--singularity 
# check the results
head CleTimer_customBP.example_pred.tsv

Schema

Inputs

Dictionary of numpy arrays

Name: soi

    Shape: () 

    Doc: Intronic sequence of interest - defined as 3 bases before and 21 base after the intron inclusive.

Name: bp_index

    Shape: () 

    Doc: Index of the branchpoint in the SOI


Targets

List of numpy arrays

Name: don_cleavage_time

    Shape: (1,) 

    Doc: Predicted donor cleavage time.

Name: acc_cleavage_time

    Shape: (1,) 

    Doc: Predicted acceptor cleavage time.


Dataloader

Defined as: .

Doc: Linear model predicting intron donor and acceptor cleavage time.

Authors: Stefan Dvoretskii

Type: Dataset

License: MIT


Arguments

gtf_file : Path to GTF file containing annotation. If there are no introns in file, they get constructed automatically.

fasta_file : Path to FASTA file containing sequences. Should include all motifs listed in the GTF file.

bp_idx_file : Relative path to file containing the branchpoint indexes for introns. One index per line and the order corresponds to genetic order.

create_introns (optional): Should dataloader infer introns from exons and transcripts? Default False.


Model dependencies
conda:
  • pip=20.3.3

pip:
  • scikit-learn==0.22.2.post1

Dataloader dependencies
conda:
  • python=3.7
  • bioconda::gffutils
  • scipy

pip: