DeepMEL/DeepMEL2

Authors: Ibrahim Ihsan Taskiran , Zeynep Kalender Atak , Stein Aerts

License: MIT

Contributed by: Ibrahim Ihsan Taskiran , Zeynep Kalender Atak , Stein Aerts

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

Type: None

Postprocessing: None

Trained on: Accessible genomic sites.

Source files

Specialized deep learning model on melanoma chromatin accessibility data

Create a new conda environment with all dependencies installed
kipoi env create DeepMEL/DeepMEL2
source activate kipoi-DeepMEL__DeepMEL2
Test the model
kipoi test DeepMEL/DeepMEL2 --source=kipoi
Make a prediction
kipoi get-example DeepMEL/DeepMEL2 -o example
kipoi predict DeepMEL/DeepMEL2 \
  --dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file"}' \
  -o '/tmp/DeepMEL|DeepMEL2.example_pred.tsv'
# check the results
head '/tmp/DeepMEL|DeepMEL2.example_pred.tsv'
Create a new conda environment with all dependencies installed
kipoi env create DeepMEL/DeepMEL2
source activate kipoi-DeepMEL__DeepMEL2
Get the model
import kipoi
model = kipoi.get_model('DeepMEL/DeepMEL2')
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('DeepMEL/DeepMEL2')
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:deepmel-slim
Get the full sized docker image
docker pull kipoi/kipoi-docker:deepmel
Get the activated conda environment inside the container
docker run -it kipoi/kipoi-docker:deepmel-slim
Test the model
docker run kipoi/kipoi-docker:deepmel-slim kipoi test DeepMEL/DeepMEL2 --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:deepmel-slim \
kipoi get-example DeepMEL/DeepMEL2 -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:deepmel-slim \
kipoi predict DeepMEL/DeepMEL2 \
--dataloader_args='{'intervals_file': '/app/example/intervals_file', 'fasta_file': '/app/example/fasta_file'}' \
-o '/app/DeepMEL_DeepMEL2.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/DeepMEL_DeepMEL2.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 DeepMEL/DeepMEL2 -o example
kipoi predict DeepMEL/DeepMEL2 \
--dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file"}' \
-o 'DeepMEL_DeepMEL2.example_pred.tsv' \
--singularity 
# check the results
head DeepMEL_DeepMEL2.example_pred.tsv

Schema

Inputs

List of numpy arrays

Name: None

    Shape: (500, 4) 

    Doc: DNA sequence

Name: None

    Shape: (500, 4) 

    Doc: Reverse-complemented DNA sequence


Targets

Single numpy array

Name: topic

    Shape: (47,) 

    Doc: Topic Prediction


Dataloader

Defined as: .

Doc: Data-loader returning one-hot encoded sequences given genome intervals

Authors: Ibrahim Ihsan Taskiran

Type: None

License: MIT


Arguments

intervals_file : intervals file bed3

fasta_file : Reference genome FASTA file path.

ignore_targets (optional): if True, don't return any target variables


Model dependencies
conda:
  • python=3.8
  • h5py=3.6.0
  • pip=22.1.2
  • keras=2.8.0
  • tensorflow=2.8.0

pip:

Dataloader dependencies
conda:
  • python=3.8
  • bioconda::pybedtools=0.8.2
  • bioconda::pysam=0.18.0
  • bioconda::pyfaidx=0.6.4
  • numpy=1.21.5
  • pandas=1.1.5
  • cython=0.29.28

pip:
  • kipoiseq
  • protobuf==3.20