SeqVec/structure

Authors: Michael Heinzinger

License: MIT

Contributed by: Michael Heinzinger

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

Type: None

Postprocessing: None

Trained on: NetSurfP-2.0 data set

Source files

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
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'
Create a new conda environment with all dependencies installed
kipoi env create SeqVec/structure
source activate kipoi-SeqVec__structure
Get the model
import kipoi
model = kipoi.get_model('SeqVec/structure')
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('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 kipoi/kipoi-docker:seqvec-slim
Get the full sized docker image
docker pull kipoi/kipoi-docker:seqvec
Get the activated conda environment inside the container
docker run -it kipoi/kipoi-docker:seqvec-slim
Test the model
docker run kipoi/kipoi-docker:seqvec-slim 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/ kipoi/kipoi-docker:seqvec-slim \
kipoi get-example SeqVec/structure -o /app/example 
docker run -v $PWD/kipoi-example:/app/ kipoi/kipoi-docker:seqvec-slim \
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
    
Install apptainer
https://apptainer.org/docs/user/main/quick_start.html#quick-installation-steps
Make prediction for custom files directly
kipoi get-example SeqVec/structure -o example
kipoi predict SeqVec/structure \
--dataloader_args='{"fasta_file": "example/fasta_file"}' \
-o 'SeqVec_structure.example_pred.tsv' \
--singularity 
# check the results
head SeqVec_structure.example_pred.tsv

Schema

Inputs

Single numpy array

Name: None

    Shape: (1,) 

    Doc: embeddings derived from SeqVec


Targets

List of numpy arrays

Name: d3_Yhat

    Shape: (None, 3) 

    Doc:

Name: d8_Yhat

    Shape: (None, 8) 

    Doc:

Name: diso

    Shape: (None, 2) 

    Doc:


Dataloader

Defined as: ../embedding

Doc: Data-loader returning protein sequence as required by ELMo

Authors: Michael Heinzinger

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
  • scikit-learn==0.22.2.post1
  • overrides=3.1.0

pip:

Dataloader dependencies
conda:
  • python=3.6
  • conda-forge::allennlp=0.7.2

pip: