epidermal_basset/encode-roadmap.basset.clf.testfold-1

Authors: Daniel Kim

License: MIT

Contributed by: Daniel Kim

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

Type: None

Postprocessing: None

Trained on: see README

Source files

Model predicting accessibility/chromatin marks from sequence

Create a new conda environment with all dependencies installed
kipoi env create epidermal_basset
source activate kipoi-epidermal_basset
Install model dependencies into current environment
kipoi env install epidermal_basset
Test the model
kipoi test epidermal_basset/encode-roadmap.basset.clf.testfold-1 --source=kipoi
Make a prediction
kipoi get-example epidermal_basset/encode-roadmap.basset.clf.testfold-1 -o example
kipoi predict epidermal_basset/encode-roadmap.basset.clf.testfold-1 \
  --dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file"}' \
  -o '/tmp/epidermal_basset|encode-roadmap.basset.clf.testfold-1.example_pred.tsv'
# check the results
head '/tmp/epidermal_basset|encode-roadmap.basset.clf.testfold-1.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('epidermal_basset/encode-roadmap.basset.clf.testfold-1')
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
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('epidermal_basset/encode-roadmap.basset.clf.testfold-1')
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:sharedpy3keras1.2
Get the activated conda environment inside the container
docker run -it kipoi/kipoi-docker:sharedpy3keras1.2
Test the model
docker run kipoi/kipoi-docker:sharedpy3keras1.2 kipoi test epidermal_basset/encode-roadmap.basset.clf.testfold-1 --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:sharedpy3keras1.2 \
kipoi get-example epidermal_basset/encode-roadmap.basset.clf.testfold-1 -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:sharedpy3keras1.2 \
kipoi predict epidermal_basset/encode-roadmap.basset.clf.testfold-1 \
--dataloader_args='{'intervals_file': '/app/example/intervals_file', 'fasta_file': '/app/example/fasta_file'}' \
-o '/app/epidermal_basset_encode-roadmap.basset.clf.testfold-1.example_pred.tsv' 
# check the results
head $PWD/kipoi-example/epidermal_basset_encode-roadmap.basset.clf.testfold-1.example_pred.tsv
Install singularity
conda install --yes -c conda-forge singularity
Make prediction for custom files directly
kipoi get-example epidermal_basset/encode-roadmap.basset.clf.testfold-1 -o example
kipoi predict epidermal_basset/encode-roadmap.basset.clf.testfold-1 \
--dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file"}' \
-o 'epidermal_basset_encode-roadmap.basset.clf.testfold-1.example_pred.tsv' \
--singularity 
# check the results
head epidermal_basset_encode-roadmap.basset.clf.testfold-1.example_pred.tsv

Schema

Inputs

Single numpy array

Name: None

    Shape: (1, 1000, 4) 

    Doc: input feature description


Targets

Single numpy array

Name: None

    Shape: (1996,) 

    Doc: model prediction description


Dataloader

Defined as: kipoiseq.dataloaders.SeqIntervalDl

Doc: Dataloader for a combination of fasta and tab-delimited input files such as bed files. The dataloader extracts regions from the fasta file as defined in the tab-delimited `intervals_file` and converts them into one-hot encoded format. Returned sequences are of the type np.array with the shape inferred from the arguments: `alphabet_axis` and `dummy_axis`.

Authors: Ziga Avsec , Roman Kreuzhuber

Type: Dataset

License: MIT


Arguments

intervals_file : bed3+<columns> file path containing intervals + (optionally) labels

fasta_file : Reference genome FASTA file path.

num_chr_fasta (optional): True, the the dataloader will make sure that the chromosomes don't start with chr.

label_dtype (optional): None, datatype of the task labels taken from the intervals_file. Example: str, int, float, np.float32

use_strand (optional): reverse-complement fasta sequence if bed file defines negative strand. Requires a bed6 file


Model dependencies
conda:
  • python=3.6
  • h5py=2.10.0
  • pip=20.2.4

pip:
  • kipoiseq
  • tensorflow==1.8

Dataloader dependencies
conda:
  • bioconda::pybedtools
  • bioconda::pyfaidx
  • bioconda::pyranges
  • numpy
  • pandas

pip:
  • kipoiseq