CleTimer/default

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

Schema

Inputs

Single numpy array

Name: soi

    Shape: () 

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


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.

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


Model dependencies
conda:
  • pip=20.3.3
  • tensorflow=1.14.0
  • keras=2.2.4

pip:
  • numpy==1.16.2
  • scikit-learn==0.22.2.post1
  • h5py==2.10.0
  • protobuf==3.20

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

pip:
  • h5py==2.10.0