MMSplice/modularPredictions

Authors: Jun Cheng

License: MIT

Contributed by: Jun Cheng

Cite as:

Type: custom

Postprocessing: None

Trained on: MPRA (Rosenberg 2015), GENCODE annotation 24. Chromosome 1 to chromosome 8 were provided as training data. The remaining chromosomes 9 to 22 and chromosome X were held out.

Source files

Predict splicing variant effect from VCF

The raw predictions from the five modules for reference sequence and alternative sequence. Returns a vector of length 10 for each variant-exon pair.

Create a new conda environment with all dependencies installed
kipoi env create MMSplice/modularPredictions
source activate kipoi-MMSplice__modularPredictions
Install model dependencies into current environment
kipoi env install MMSplice/modularPredictions
Test the model
kipoi test MMSplice/modularPredictions --source=kipoi
Make a prediction
kipoi get-example MMSplice/modularPredictions -o example
kipoi predict MMSplice/modularPredictions \
  --dataloader_args='{"gtf": "example/gtf", "fasta_file": "example/fasta_file", "vcf_file": "example/vcf_file", "exon_cut_l": 0, "exon_cut_r": 0, "acceptor_intron_cut": 6, "donor_intron_cut": 6, "acceptor_intron_len": 50, "acceptor_exon_len": 3, "donor_exon_len": 5, "donor_intron_len": 13}' \
  -o '/tmp/MMSplice|modularPredictions.example_pred.tsv'
# check the results
head '/tmp/MMSplice|modularPredictions.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('MMSplice/modularPredictions')
Make a prediction for example files
pred = model.pipeline.predict_example()
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
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('MMSplice/modularPredictions')
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)

Schema

Inputs

Single numpy array

Name: None

    Shape: (10,) 

    Doc: modular predictions


Targets

Single numpy array

Name: None

    Shape: (10,) 

    Doc: Modular predictions of variant effects


Dataloader

Defined as: .

Doc: This model first predicts the effect of variants using 5 sub-modules (acceptor intron module, acceptor module, exon module, donor module, donor intron module), and then integrates those predictions using linear regression. The model has been trained to predict delta PSI subject to variants.

Authors: Jun Cheng

Type: SampleIterator

License: MIT


Arguments

gtf : path to the GTF file required by the models (Ensemble)

fasta_file : reference genome fasta file

vcf_file : Path to the input vcf file

split_seq (optional): Whether split the sequence in dataloader

variant_filter (optional): If set True (default), variants with `FILTER` field other than `PASS` will be filtered out.

encode (optional): If split the sequence, whether one hot encoding

exon_cut_l (optional): when extract exon feature, how many base pair to cut out at the begining of an exon

exon_cut_r (optional): when extract exon feature, how many base pair to cut out at the end of an exon

acceptor_intron_cut (optional): how many bp to cut out at the end of acceptor intron that consider as acceptor site

donor_intron_cut (optional): how many bp to cut out at the end of donor intron that consider as donor site

acceptor_intron_len (optional): what length in acceptor intron to consider for acceptor site model

acceptor_exon_len (optional): what length in acceptor exon to consider for acceptor site model

donor_exon_len (optional): what length in donor exon to consider for donor site model

donor_intron_len (optional): what length in donor intron to consider for donor site model

kwargs (optional): other arguments for GenerateExonIntervalTree


Model dependencies
conda:
  • numpy

pip:
  • scikit-learn
  • mmsplice==0.2.7

Dataloader dependencies
conda:
  • bioconda::cyvcf2
  • numpy
  • python=3.5

pip:
  • kipoi
  • mmsplice==0.2.7