Divergent421

Authors: Nancy Xu

License: MIT

Contributed by: Nancy Xu

Cite as:

Type: None

Postprocessing: None

Trained on: Chromosomes 1, 8, and 21 are test set, 9 is validation set, the remaining data is training data.

Source files

Large-scale multi-task convolutional model for predicting chromatin accessility model. Model was trained genome-wide accessibility measures across 421 biosamples (cell lines or tissues) from Roadmap and ENCODE.

Create a new conda environment with all dependencies installed
kipoi env create Divergent421
source activate kipoi-Divergent421
Install model dependencies into current environment
kipoi env install Divergent421
Test the model
kipoi test Divergent421 --source=kipoi
Make a prediction
kipoi get-example Divergent421 -o example
kipoi predict Divergent421 \
  --dataloader_args='{"intervals_file": "example/intervals_file", "fasta_file": "example/fasta_file"}' \
  -o '/tmp/Divergent421.example_pred.tsv'
# check the results
head '/tmp/Divergent421.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('Divergent421')
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('Divergent421')
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: (1000, 4) 

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


Targets

Single numpy array

Name: None

    Shape: (421,) 

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


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

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


Model dependencies
conda:
  • h5py

pip:
  • tensorflow<=1.4.1
  • keras==1.2.2
  • kipoiseq

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

pip:
  • kipoiseq