Title: | Deep Learning Prediction of Effectors |
---|---|
Description: | A tool that contains trained deep learning models for predicting effector proteins. 'deepredeff' has been trained to identify effector proteins using a set of known experimentally validated effectors from either bacteria, fungi, or oomycetes. Documentation is available via several vignettes, and the paper by Kristianingsih and MacLean (2020) <doi:10.1101/2020.07.08.193250>. |
Authors: | Ruth Kristianingsih [aut, cre, cph]
|
Maintainer: | Ruth Kristianingsih <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2025-02-28 03:32:22 UTC |
Source: | https://github.com/ruthkr/deepredeff |
Convert AAString class to dataframe
aas_to_df(aas)
aas_to_df(aas)
aas |
AAString class object. |
Returns data in data frame.
input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") input_aas <- Biostrings::readAAStringSet(input_fasta) input_df <- aasset_to_df(input_aas)
input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") input_aas <- Biostrings::readAAStringSet(input_fasta) input_df <- aasset_to_df(input_aas)
Convert AAStringset class to dataframe
aasset_to_df(aas)
aasset_to_df(aas)
aas |
AAStringset class object. |
Returns data in data frame.
input <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" input_aas <- Biostrings::AAString(input) input_df <- aas_to_df(input_aas)
input <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" input_aas <- Biostrings::AAString(input) input_df <- aas_to_df(input_aas)
deepredeff
packageEffector protein predictor using Deep Learning models.
See the README on GitHub
encode_integer
integer-encodes sequence in a string format.
encode_integer(sequence, max_length = 4034)
encode_integer(sequence, max_length = 4034)
sequence |
Sequence in a string format. |
max_length |
Maximum length of sequence to encode. |
Integer encoded sequence.
sample_seq <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" encoded_seq <- encode_integer(sample_seq)
sample_seq <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" encoded_seq <- encode_integer(sample_seq)
encode_one_hot
one-hot-encodes sequence in a string format.
encode_one_hot(sequence, max_length = 4034)
encode_one_hot(sequence, max_length = 4034)
sequence |
Sequence in a string format. |
max_length |
Maximum length of sequence to encode. |
One-hot encoded sequence.
sample_seq <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" encoded_seq <- encode_one_hot(sample_seq)
sample_seq <- "MSHMTFNTWKAGLWRLAAAAVLSLLPVVARAAVPGITGPTFDLTAQPGRANQPDGASVYSWGYGCNPRTVPGFLPSVNPLAGQ" encoded_seq <- encode_one_hot(sample_seq)
Weighted ensemble
ensemble_weighted(pred_list, weights)
ensemble_weighted(pred_list, weights)
pred_list |
List of deep learning models. |
weights |
Accuracy values from evaluation on the validation dataset. |
Returns the prediction results from weighted ensemble.
Convert fasta format to dataframe
fasta_to_df(fasta_path)
fasta_to_df(fasta_path)
fasta_path |
Path of FASTA file. |
Returns data in data frame.
input <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") input_df <- fasta_to_df(input)
input <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") input_df <- fasta_to_df(input)
This function is used to get the ensemble methods used for each taxon group. If weights are needed for a particular ensemble, then the weights will automatically follow.
get_ensemble_method(taxon)
get_ensemble_method(taxon)
taxon |
taxon group |
Returns ensemble method and weights.
TensorFlow will be installed into an "r-tensorflow" virtual or conda environment. Note that "virtualenv" is not available on Windows (as this isn't supported by TensorFlow).
install_tensorflow( method = c("conda", "virtualenv"), conda = "auto", version = "default", extra_packages = NULL, ... )
install_tensorflow( method = c("conda", "virtualenv"), conda = "auto", version = "default", extra_packages = NULL, ... )
method |
Installation method ("conda" or "virtualenv"). |
conda |
The path to a |
version |
TensorFlow version to install. |
extra_packages |
Additional PyPI packages to install along with TensorFlow. |
... |
Other arguments passed to |
Custom installations of TensorFlow are not supported yet by deepredeff.
If you wish to add additional PyPI packages to your TensorFlow environment you
can either specify the packages in the extra_packages
argument of install_tensorflow()
,
or alternatively install them into an existing environment using the
reticulate::py_install()
function.
Notice that this may have undesired side-effects on Windows installations.
## Not run: # Default installation library(deepredeff) install_tensorflow() ## End(Not run)
## Not run: # Default installation library(deepredeff) install_tensorflow() ## End(Not run)
load_model()
loads model saved in hdf5 format
load_model(taxon = c("bacteria", "fungi", "oomycete"))
load_model(taxon = c("bacteria", "fungi", "oomycete"))
taxon |
Name of taxon. |
Returns all of the hyperparamaters and parameters of particular model from specific taxon chosen.
Wildcard Expansion on File Paths
package_glob(..., pattern)
package_glob(..., pattern)
... |
Path |
pattern |
Pattern |
Glob
Plot the results of prediction
## S3 method for class 'tbl_deepredeff' plot(x, ...)
## S3 method for class 'tbl_deepredeff' plot(x, ...)
x |
tbl_deepredeff object |
... |
additional arguments ignored. |
class distribution plot
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" ) plot(pred_result)
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" ) plot(pred_result)
predict_effector
is used to predict effector protein given amino acid protein sequences.
predict_effector(input, taxon) ## S3 method for class 'character' predict_effector(input, taxon) ## S3 method for class 'data.frame' predict_effector(input, taxon) ## S3 method for class 'AAStringSet' predict_effector(input, taxon) ## S3 method for class 'AAString' predict_effector(input, taxon) ## Default S3 method: predict_effector(input, taxon)
predict_effector(input, taxon) ## S3 method for class 'character' predict_effector(input, taxon) ## S3 method for class 'data.frame' predict_effector(input, taxon) ## S3 method for class 'AAStringSet' predict_effector(input, taxon) ## S3 method for class 'AAString' predict_effector(input, taxon) ## Default S3 method: predict_effector(input, taxon)
input |
Input data that contains amino acid sequence(s). It can be in fasta format, strings, AAString, AAStringset, and dataframe. |
taxon |
Taxon group of input data. Available taxons are bacteria, fungi, and oomycete. |
predict_effector
returns an object of class "tbl_deepredeff" or for multiple responses of class c("tbl_deepredeff", "data.frame").
An object of class "tbl_deepredeff" is a data frame containing at least the following components:
sequence |
the sequence(s) from the input data. |
s_score |
score obtained from sigmoid function showing how likely the sequences to be an effector. |
prediction |
class prediction for each sequence, obtained from s_score. If the value of |
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" )
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" )
Prediction mapper helper
prediction_mapper(sequence_list, model_list)
prediction_mapper(sequence_list, model_list)
sequence_list |
List of sequences input. |
model_list |
List of models. |
Returns list of prediction result of each sequence.
Get the summary of the prediction results
## S3 method for class 'tbl_deepredeff' summary(object, ...)
## S3 method for class 'tbl_deepredeff' summary(object, ...)
object |
Results of prediction from deepredeff::predict_effector(). |
... |
Additional arguments ignored. |
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" ) summary(pred_result)
# FASTA input input_fasta <- system.file("extdata/example/fungi_sample.fasta", package = "deepredeff") pred_result <- deepredeff::predict_effector( input = input_fasta, taxon = "fungi" ) summary(pred_result)