HAL

Authors: Alexander Rosenberg

Version: 0.1

License: MIT

Contributed by: Jun Cheng , Ziga Avsec

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

Trained on: MPRA data of 2M synthetic alternatively spliced mini-genes

Type: custom

Postprocessing: variant_effects

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

Create a new conda environment with all dependencies installed
kipoi env create HAL
source activate kipoi-HAL
Install model dependencies into current environment
kipoi env install HAL
Test the model
kipoi test HAL --source=kipoi
Make a prediction
cd ~/.kipoi/models/HAL
kipoi predict HAL \
  --dataloader_args='{'gtf_file': 'example_files/hg19.chr22.gtf', 'fasta_file': 'example_files/hg19.chr22.fa'}' \
  -o '/tmp/HAL.example_pred.tsv'
# check the results
head '/tmp/HAL.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('HAL')
Make a prediction for example files
pred = model.pipeline.predict_example()
Use dataloader and model separately
# setup the example dataloader kwargs
dl_kwargs = {'gtf_file': 'example_files/hg19.chr22.gtf', 'fasta_file': 'example_files/hg19.chr22.fa'}
import os; os.chdir(os.path.expanduser('~/.kipoi/models/HAL'))
# Get the dataloader and instantiate it
dl = model.default_dataloader(**dl_kwargs)
# get a batch iterator
it = dl.batch_iter(batch_size=4)
# predict for a batch
batch = 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 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
# Get the dataloader
setwd('~/.kipoi/models/HAL')
dl <- model$default_dataloader(gtf_file='example_files/hg19.chr22.gtf', fasta_file='example_files/hg19.chr22.fa')
# 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)

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

Relative path: .

Version: 0.1

Doc: Model from Rosenberg

Authors: Jun Cheng , Ziga Avsec

Type: Dataset

License: MIT


Arguments

gtf_file : file path; Genome annotation GTF file

fasta_file : Reference Genome sequence in fasta format

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

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


Model dependencies
conda:
  • numpy

pip:

Dataloader dependencies
conda:
  • python=3.5
  • bioconda::pysam

pip: