SeqVec/structure
3-state, 8-state secondary structure and disorder prediction based on SeqVec
Create a new conda environment with all dependencies installed
kipoi env create SeqVec/structure
source activate kipoi-SeqVec__structure
Install model dependencies into current environment
kipoi env install SeqVec/structure
Test the model
kipoi test SeqVec/structure --source=kipoi
Make a prediction
kipoi get-example SeqVec/structure -o example
kipoi predict SeqVec/structure \
--dataloader_args='{"fasta_file": "example/fasta_file"}' \
-o '/tmp/SeqVec|structure.example_pred.tsv'
# check the results
head '/tmp/SeqVec|structure.example_pred.tsv'
Get the model
import kipoi
model = kipoi.get_model('SeqVec/structure')
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('SeqVec/structure')
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 haimasree/kipoi-docker:seqvec
Get the activated conda environment inside the container
docker run -it haimasree/kipoi-docker:seqvec
Test the model
docker run haimasree/kipoi-docker:seqvec kipoi test SeqVec/structure --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/ haimasree/kipoi-docker:seqvec \
kipoi get-example SeqVec/structure -o /app/example
docker run -v $PWD/kipoi-example:/app/ haimasree/kipoi-docker:seqvec \
kipoi predict SeqVec/structure \
--dataloader_args='{'fasta_file': '/app/example/fasta_file'}' \
-o '/app/SeqVec_structure.example_pred.tsv'
# check the results
head $PWD/kipoi-example/SeqVec_structure.example_pred.tsv
Dataloader
Defined as: ../embedding
Doc: Data-loader returning protein sequence as required by ELMo
Type: Dataset
License: MIT
Arguments
fasta_file : fasta file containing multiple protein sequence(s)
split_char (optional): charcter used for separating header of fasta files (together with id_field used to extract protein identifier)
id_field (optional): index for extracting protein identifier from fasta header after splitting after split_char
Model dependencies
conda:
- python=3.6
- conda-forge::allennlp=0.7.2
- pip=9.0.3
pip:
- scikit-learn==0.22.2.post1
Dataloader dependencies
conda:
- python=3.6
- conda-forge::allennlp
pip: