MaxEntScan/5prime

Authors: Gene Yeo , Christopher B. Burge

License: MIT

Contributed by: Jun Cheng , Matthias De Smet

Cite as: https://doi.org/10.1089/1066527041410418

Type: None

Postprocessing: None

Trained on: Train / test split of 2/3 to 1/3. Trained on \'Available human cDNA\'. Described in http://online.liebertpub.com/doi/pdf/10.1089/1066527041410418

Source files

5prime MaxEnt Splicing Model (http://genes.mit.edu/burgelab/maxent/Xmaxentscan_scoreseq_acc.html) implemented in the maxentpy conda package https://github.com/kepbod/maxentpy.

http://genes.mit.edu/burgelab/maxent/Xmaxentscan_scoreseq_acc.html http://genes.mit.edu/burgelab/maxent/Xmaxentscan_scoreseq.html https://github.com/kepbod/maxentpy

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

Schema

Inputs

Single numpy array

Name: seq

    Shape: () 

    Doc: Actual junction sequence


Targets

Single numpy array

Name: psi

    Shape: (1,) 

    Doc: Predicted psi


Dataloader

Defined as: dataloader.SplicingMaxEntDataset

Doc: MaxEnt Splicing Model

Authors: Jun Cheng

Type: Dataset

License: MIT


Arguments

MISO_AS : Whether the given annotation file is MISO alternative splicing annotation. default False.

fasta_file : Reference Genome sequence in fasta format

gtf_file (optional): file path; Genome annotation GTF file

label_col (optional): response label column name

target_file (optional): path to the targets (txt) file


Model dependencies
conda:
  • pip=22.0.4
  • bioconda::maxentpy=0.0.1

pip:
  • kipoi

Dataloader dependencies
conda:
  • bioconda::pysam=0.17
  • python=3.8

pip: