HAL

Authors: Alexander B. Rosenberg

License: MIT

Contributed by: Jun Cheng , Ziga Avsec

Cite as: https://doi.org/10.1016/j.cell.2015.09.054

Type: None

Postprocessing: None

Trained on: MPRA data of 2M synthetic alternatively spliced mini-genes. Data was split into training and test sets (90%/10% split).

Source files

Model from Rosenberg et al: Learning the Sequence Determinants of Alternative Splicing from Millions of Random Sequences

http://splicing.cs.washington.edu/

https://github.com/Alex-Rosenberg/cell-2015

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

Schema

Inputs

Single numpy array

Name: seq

    Shape: () 

    Doc: K-mer counts


Targets

Single numpy array

Name: psi

    Shape: (1,) 

    Doc: Predicted 3' psi


Dataloader

Defined as: .

Doc: Model from Rosenberg

Authors: Jun Cheng , Ziga Avsec

Type: Dataset

License: MIT


Arguments

MISO_AS (optional): Whether the given annotation file is MISO alternative splicing annotation. Default False.

fasta_file : Reference Genome sequence in fasta format

gtf_file : file path; Genome annotation GTF file

overhang (optional): Length of sequence overhang to take around splice junction


Model dependencies
conda:
  • numpy=1.19.2
  • python=3.8
  • pip=22.0.4
  • cython

pip:
  • h5py==2.10.0

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

pip: