SiSp

Authors: Lara Urban

License: MIT

Contributed by: Lara Urban

Cite as: https://doi.org/10.1101/328138

Type: keras

Postprocessing: None

Trained on: Line joxm_1 from single donor in HipSci (Kilpinen 2016) using scM&T-seq. The cassette exons were split into training, validation and test set (60%, 20%, 20%).

Source files

The SiSp model predicts splicing patterns based on a genomic sequence (800bp) at the center of the alternative exon of a cassette exon. It takes methylation into account by handling methylated cytosine as 5th base, and operates on a single-cell level.

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

Schema

Inputs

Single numpy array

Name: seq

    Shape: (800, 5) 

    Doc: DNA sequence


Targets

Single numpy array

Name: targets

    Shape: (1,) 

    Doc: Probability of exluded exon in a cassette exon setting


Dataloader

Defined as: .

Doc: The SiSp model predicts splicing patterns based on a genomic sequence of 800bp centered on the alternative exon. It takes methylation into account and operates on a single-cell level.

Authors: Lara Urban

Type: PreloadedDataset

License: MIT


Arguments

anno_file : gtf file with chr, start, end and orientation of an exon/a gene

fasta_file : reference genome sequence

meth_file : bedGraph file with single-base methylation information

target_file (optional): path to the targets (.csv) file


Model dependencies
conda:
  • python=3.8
  • numpy
  • pandas
  • pip=22.0.4
  • keras=2.8
  • tensorflow=2.8

pip:
  • h5py
  • protobuf==3.20

Dataloader dependencies
conda:
  • bioconda::pysam=0.17
  • bioconda::tabix=1.11
  • python=3.8
  • numpy
  • pandas

pip: