Selecting the model

deepredeff provides a selection of models trained on sequences from different phytopathogen taxa. It is important to select the correct model. Each taxon is represented by just one model at the moment. You can select the model by setting the taxon in the main function, predict_effector(). Available values are bacteria, fungi and oomycete.

predict_effector(
  input = "my_fungal_seqs.fa",
  taxon = "fungi"
)

For each taxon, deepredeff uses a different model. These models are:

  • bacteria: ensemble_weighted, which is a weighted ensemble model of CNN-LSTM, CNN-GRU, GRU Embedding, and LSTM-Embedding.
  • fungi: CNN-LSTM.
  • oomycete: CNN-LSTM.

The model used for your prediction will also be shown when you run the function predict_effector() or when you run summary().

Importing from different data sources

Sequences in a dataframe

Here we will take example of fungal sequences in data frame format called input_fungi_df as shown below:

input_fungi_df 
name sequence
tr|A0A0A0S3X0|A0A0A0S3X0_LEPMC Avirulence protein OS=Leptosphaeria maculans OX=5022 GN=AvrLm2 PE=4 SV=1 MRLANFLFYLAPMIVSSLAFDFVPLSGELDFSQEMVFINLTQQQFSELHL QHQQWHQKNILKRYTLTELDEICQQYNANFRFNSGFCSGKDRRWDCYDLN FPTTQSERRVQRRRVCRGEHQTCETIDVINAFGAHARFPQCVHRFELPIN DPIPYKDSYQGQYTVEKALDDSWEDILANTGGSHVDFSYQSGTQHYQGYG LTFACIHCIGGSILRMIHANDPARATVTIKFH
tr|A0A0A2ILW0|A0A0A2ILW0_PENEN Peptidoglycan-binding Lysin subgroup OS=Penicillium expansum OX=27334 GN=PEX2_020570 PE=4 SV=1 MFFPSLILAAGSLSTLIQAIPHGAKHHHSLHRRAAATYAVMGGDGEASDG WPTISQWSEYETLWGLNQILIAASCDNSDDETSDINTSIKSIASETGVDA RFILAIIMQESKGCVRVQSTNNGVENTGLMQSHDGEGSCNKDGSKTTPCP SSMITQMIQDGTAGTTQGDGLKQCYEAQTGGTAAKYYKAARTYNSGSIAS SGNLGQGGATHCYASDIANRVRGWAGDVSECVEATIGTITSGVESALGGD DGSSSTSTSTTAAQSTETAEPVQTSSSAAEQPVTTEPIQTSSAPAQAAET SSAASSATSTETTSVAPAPTWTPSSNVQVAAQTTTPTPSWTTKSAPAATT APAASSSASGTAPLYPYASSSCQKYYTVKAGDFCDKVTEAVGISFLDLRS LNPGLDEKCSDLWLGYQYCIKA

deepredeff accepts these directly. To predict fungal effectors, you can specify the model to taxon= "fungi".

pred_fungi <- predict_effector(
  input = input_fungi_df,
  taxon = "fungi"
)
#> Loaded models successfully!
#> Model used for taxon fungi: cnn_lstm.

Sequences in AAStringSet

In the same way as with the dataframe and fasta files we can use a Bioconductor AAStringSet object:

input_oomycete_aastringset
#> AAStringSet object of length 10:
#>     width seq                                              names               
#> [1]   820 MVKLYCAVVGVAGSAFSVRVDES...SKKGKTAMILSRMHYDDDEADL sp|A0A0M5K865|CR1...
#> [2]   111 MRLAQVVVVIAASFLVATDALST...FQRYQKKANKIIEKQKAAAKNA tr|A5YTY8|A5YTY8_...

To predict oomycete effectors, you can specify the model to taxon= "oomycete".

pred_oomycete <- predict_effector(
  input = input_oomycete_aastringset,
  taxon = "oomycete"
)
#> Loaded models successfully!
#> Model used for taxon oomycete: cnn_lstm.

Predict from character vectors

The same applies if we provide a character vector. Let us take an example of data in string format.

input_bacteria_strings
#> [1] "MPINRPAFNLKLNTAIAQ..."
#> [2] "MQFMSRINRILFVAV..."

To predict bacteria effectors, you can specify the model to taxon = "bacteria".

pred_bacteria <- predict_effector(
  input = input_bacteria_strings,
  taxon = "bacteria"
)
#> Loaded models successfully!
#> Model used for taxon bacteria: ensemble_weighted.