BassetGM12878_Demo

Authors: Nancy Xu , Johnny Israeli

Version: 0.1

License: MIT

Contributed by: Nancy Xu

Cite as:

Trained on:

Type: keras

Postprocessing:

test

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

Dictionary of numpy arrays

Name: data/genome_data_dir

    Shape: (1000, 4) 

    Doc: 1000 base pair sequence of one-hot encoding ACGT


Targets

Single numpy array

Name: None

    Shape: (1,) 

    Doc: Binary 0/1 output for chromatin accessbility in the designated range. 0 = inaccessible, 1 = accessible.


Dataloader

Relative path: .

Version: 0.1

Doc: test

Authors: Nancy Xu

Type: Dataset

License: MIT


Arguments

intervals_file : tsv file containing dna interval indices and binary 0/1 label for accessibility of single cell type.

fasta_file (optional): fasta file for dna intervals


Model dependencies
conda:
  • h5py

pip:
  • tensorflow
  • keras==1.2.2

Dataloader dependencies
conda:
  • cython

pip:
  • pybedtools
  • genomelake