Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Published in PLOS ONE. Phage-host interaction prediction tool that uses protein language models to represent the receptor-binding proteins of phages. It presents improvements over using handcrafted sequence properties and eliminates the need to manually extract and select features from phage sequences

License

NotificationsYou must be signed in to change notification settings

bioinfodlsu/phage-host-prediction

Repository files navigation

badgebadgebadgebadgebadgescikit-learn
Actions StatusActions Statusbadge

PHIEmbed is a phage-host interaction prediction tool that uses protein language models to represent the receptor-binding proteins of phages. It presents improvements over using handcrafted (manually feature-engineered) sequence properties and eliminates the need to manually extract and select features from phage sequences.

Paper:https://doi.org/10.1371/journal.pone.0289030

If you find our work useful, please consider citing:

@article{10.1371/journal.pone.0289030,    doi = {10.1371/journal.pone.0289030},    author = {Gonzales, Mark Edward M. AND Ureta, Jennifer C. AND Shrestha, Anish M. S.},    journal = {PLOS ONE},    publisher = {Public Library of Science},    title = {Protein embeddings improve phage-host interaction prediction},    year = {2023},    month = {07},    volume = {18},    url = {https://doi.org/10.1371/journal.pone.0289030},    pages = {1-22},    number = {7}}

You can also find PHIEmbed onbio.tools.

Table of Contents

📰 News

  • 13 Jan 2025 - We released a new phage-host interaction prediction tool,PHIStruct (published inBioinformatics), which incorporates protein structure information and works especially well for phages with receptor-binding proteins that have low sequence similarity to those of known phages. Learn more about ithere.

  • 24 Apr 2024 - We added scripts to simplify running and training our tool. Instructionshere.

  • 23 Feb 2024 - We presented our work at theeAsia AMR Workshop 2024 held virtually and in person in Tokyo, Japan, and attended by antimicrobial resistance (AMR) researchers from Thailand, USA, Australia, Japan, and the Philippines. Slideshere.

  • 01 Dec 2023 - Presenting this work, the lead author (Mark Edward M. Gonzales) won2nd Prize at the 2023 Magsaysay Future Engineers/Technologists Award. This award is conferred by the National Academy of Science and Technology, the highest recognition and scientific advisory body of the Philippines, to recognize outstanding research outputs on engineering and technology at the collegiate level. Presentationhere (29:35–39:51) and slideshere.

  • 24 Jul 2023 - Ourpaper is now published inPLOS ONE.

Return toTable of Contents.

🚀 Installation & Usage

Operating System: Windows, Linux, or macOS

Clone the repository:

git clone https://github.com/bioinfodlsu/phage-host-predictioncd phage-host-prediction

Create a virtual environment with all the necessary dependencies installed via Conda (we recommend usingMiniconda):

conda env create -f environment.yaml

Activate this environment by running:

conda activate PHIEmbed

Running PHIEmbed

python3 phiembed.py --input <input_fasta> --model <model_joblib> --output <results_dir>
  • Replace<input_fasta> with the path to the FASTA file containing the receptor-binding protein sequences. A sample FASTA file is providedhere.
  • Replace<model_joblib> with the path to the trained model (recognized format: joblib or compressed joblib, framework: scikit-learn). Download our trained model from thislink. No need to uncompress, but doing so will speed up loading the model albeit at the cost of additional storage requirements. Refer to thisguide for the list of accepted compressed formats.
  • Replace<results_dir> with the path to the directory to which the results of running PHIEmbed will be written. The results of running PHIEmbed on the sample FASTA file are providedhere.

The results for each protein are written to a CSV file (without a header row). Each row contains two comma-separated values: a host genus and the corresponding prediction score (class probability). The rows are sorted in order of decreasing prediction score. Hence, the first row pertains to the top-ranked prediction.

Under the hood, this script first converts each sequence into a protein embedding using ProtT5 (the top-performing protein language model based on our experiments) and then passes the embedding to a random forest classifier trained on our entiredataset. If your machine has a GPU, it will automatically be used to accelerate the protein embedding generation step.

Note: Running this script for the first time may take a few extra minutes since it involves downloading a model (ProtT5, around 2 GB) from Hugging Face.

Training PHIEmbed

python3 train.py --input <training_dataset>
  • Replace<training_dataset> with the path to the training dataset. A sample can be downloadedhere.
  • The number of threads to be used for training can be specified using--threads. By default, it is set to -1 (that is, all threads are to be used).

The training dataset should be formatted as a CSV file (without a header row) where each row corresponds to a training sample. The first column is for the protein IDs, the second column is for the host genera, and the next 1,024 columns are for the components of the ProtT5 embeddings.

This script will output a gzip-compressed, serialized version of the trained model with filenamephiembed_trained.joblib.gz.

Return toTable of Contents.

📚 Description

Motivation: With the growing interest in using phages to combat antimicrobial resistance, computational methods for predicting phage-host interactions have been explored to help shortlist candidate phages. Most existing models consider entire proteomes and rely on manual feature engineering, which poses difficulty in selecting the most informative sequence properties to serve as input to the model.

Method: In this paper, we framed phage-host interaction prediction as a multiclass classification problem that takes as input the embeddings of a phage's receptor-binding proteins, which are known to be the key machinery for host recognition, and predicts the host genus. We explored different protein language models to automatically encode these protein sequences into dense embeddings without the need for additional alignment or structural information.

Results: We show that the use of embeddings of receptor-binding proteins presents improvements over handcrafted genomic and protein sequence features. The highest performance was obtained using the transformer-based protein language model ProtT5, resulting in a 3% to 4% increase in weighted F1 and recall scores across different prediction confidence thresholds, compared to using selected handcrafted sequence features.

Teaser Figure

Return toTable of Contents.

🧪 Reproducing Our Results

Project Structure

Theexperiments folder contains the files and scripts for reproducing our results. Note that additional (large) files have to be downloaded (or generated) following the instructions in the Jupyter notebooks.

Click here to show/hide the list of directories, Jupyter notebooks, and Python scripts, as well as the folder structure.

Directories

DirectoryDescription
inpharedContains the list of phage-host pairs in TSV format. The GenBank and FASTA files with the genomic and protein sequences of the phages, the embeddings of the receptor-binding proteins, and the phage-host-features CSV files should also be saved in this folder
preprocessingContains text files related to the preprocessing of host information and the selection of annotated RBPs
rbp_predictionContains the JSON file of the trained XGBoost model proposed byBoeckaertset al. (2022) for the computational prediction of receptor-binding proteins. Downloaded from thisrepository (under the MIT License)
tempContains intermediate output files during preprocessing and performance evaluation

Return toTable of Contents.

Jupyter Notebooks

Each notebook provides detailed instructions related to the required and output files, including the download links and where to save them.

NotebookDescriptionRequired FilesOutput Files
1. Sequence Preprocessing.ipynbPreprocessing of host information and selection of annotated receptor-binding proteinsGenomesDB (Partial. Complete populating following the instructions in the notebook),
GenBank file of phage genomes and/or proteomes
FASTA files of genomic and protein sequences
2. Exploratory Data Analysis.ipynbExploratory data analysisProtein embeddings (Part 1 andPart 2),
Phage-host-features CSV files
3. RBP Computational Prediction.ipynbComputational prediction of receptor-binding proteinsProtein embeddings (Part 1 andPart 2)Protein embeddings (Part 1 andPart 2)
3.1. RBP FASTA Generation.ipynbGeneration of the FASTA files containing the RBP protein sequencesProtein embeddings (Part 1 andPart 2)FASTA files of genomic and protein sequences
4. Protein Embedding Generation.ipynbGeneration of protein embeddingsFASTA files of genomic and protein sequencesProtein embeddings (Part 1 andPart 2)
5. Data Consolidation.ipynbGeneration of phage-host-features CSV filesFASTA files of genomic and protein sequences,
Protein embeddings (Part 1 andPart 2)
Phage-host-features CSV files
6. Classifier Building & Evaluation.ipynbConstruction of phage-host interaction model and performance evaluationPhage-host-features CSV filesTrained models
6.1. Additional Model Evaluation (Specificity + PR Curve).ipynbAddition of metrics for model evaluationPhage-host-features CSV files
7. Visualization.ipynbPlotting oft-SNE and UMAP projectionsPhage-host-features CSV files

Return toTable of Contents.

Python Scripts

ScriptDescription
ClassificationUtil.pyContains the utility functions for the generation of the phage-host-features CSV files, construction of the phage-host interaction model, and performance evaluation
ConstantsUtil.pyContains the constants used in the notebooks and scripts
EDAUtil.pyContains the utility functions for exploratory data analysis
RBPPredictionUtil.pyContains the utility functions for the computational prediction of receptor-binding proteins
SequenceParsingUtil.pyContains the utility functions for preprocessing host information and selecting annotated receptor-binding proteins
boeckaerts.pyContains the utility functions written byBoeckaertset al. (2021) for running their phage-host interaction prediction tool (with which we benchmarked our model). Downloaded from thisrepository (under the MIT License)

Return toTable of Contents.

Folder Structure

Once you have cloned this repository and finished downloading (or generating) all the additional required files following the instructions in the Jupyter notebooks, your folder structure should be similar to the one below:

  • phage-host-prediction (root)
    • datasets
      • inphared
        • inphared
          • GenomesDB (Downoadpartial. Complete populating following the instructionshere)
            • AB002632
            • ...
    • experiments
      • inphared
        • data (Download)
          • rbp.csv
          • rbp_embeddings_esm.csv
          • ...
        • embeddings (DownloadPart 1 andPart 2)
          • esm
          • esm1b
          • ...
        • fasta (Download)
          • complete
          • hypothetical
          • nucleotide
          • rbp
        • 16Sep2022_data_excluding_refseq.tsv
        • 16Sep2022_phages_downloaded_from_genbank.gb (Download)
      • models (Download)
        • boeckaerts.joblib
        • esm.joblib
        • ...
      • preprocessing
      • rbp_prediction
      • temp
      • 1. Sequence Preprocessing.ipynb
      • ...
      • ClassificationUtil.py
      • ...

Return toTable of Contents.

Dependencies

Operating System: Windows, Linux, or macOS

Create a virtual environment with all the necessary dependencies installed via Conda (we recommend usingMiniconda):

conda env create -f environment_experiments.yaml

Activate this environment by running:

conda activate PHIEmbed-experiments

Thanks to Dr. Paul K. Yu for sharing his environment configuration.

Click here to show/hide note on running the notebook for protein embedding generation.

The notebook4. Protein Embedding Generation.ipynb has a dependency (bio_embeddings) that requires it to be run on Unix or a Unix-like operating system. If you are using Windows, consider usingWindows Subsystem for Linux (WSL) or a virtual machine. We did not includebio_embeddings inenvironment_experiments.yaml to maintain cross-platform compatibility; you have to install it following the instructionshere.

Moreover, generating protein embeddings should ideally be done on a machine with a GPU. The largest (and best-performing) protein language model that we used, ProtT5, consumes 5.9 GB of GPU memory. If your local machine does not have a GPU or if its GPU has insufficient memory, we recommend using a cloud GPU platform.

UPDATE (12 Jun 2023): In May 2023, Google Colab upgraded its Python runtime, resulting in compatibility issues withbio_embeddings. An alternative cloud GPU platform is Paperspace, which provides aPyTorch 1.12 runtime that is compatible withbio_embeddings.

Click here to show/hide the complete list of Python libraries and modules used in this project (excluding those that are part of the Python Standard Library).
Library/ModuleDescriptionLicense
pyyamlSupports standard YAML tags and provides Python-specific tags that allow to represent an arbitrary Python objectMIT License
jsonnetDomain-specific language for JSONApache License 2.0
protobufGoogle's language-neutral, platform-neutral, extensible mechanism for serializing structured dataBSD 3-Clause "New" or "Revised" License
regexProvides additional functionality over the standardre module while maintaining backwards-compatibilityApache License 2.0
nltkProvides interfaces to corpora and lexical resources, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoningApache License 2.0
biopythonProvides tools for computational molecular biologyBiopython License Agreement, BSD 3-Clause License
ete3Provides functions for automated manipulation, analysis, and visualization of phylogenetic treesGNU General Public License v3.0
pandasProvides functions for data analysis and manipulationBSD 3-Clause "New" or "Revised" License
numpyProvides a multidimensional array object, various derived objects, and an assortment of routines for fast operations on arraysBSD 3-Clause "New" or "Revised" License
scipyProvides efficient numerical routines, such as those for numerical integration, interpolation, optimization, linear algebra, and statisticsBSD 3-Clause "New" or "Revised" License
scikit-learnProvides efficient tools for predictive data analysisBSD 3-Clause "New" or "Revised" License
xgboostImplements machine learning algorithms under the gradient boosting frameworkApache License 2.0
imbalanced-learnProvides tools when dealing with classification with imbalanced classesMIT License
joblibProvides tools for lightweight pipelining in PythonBSD 3-Clause "New" or "Revised" License
cudatoolkitParallel computing platform and programming model for general computing on GPUsNVIDIA Software License
bio_embeddingsProvides an interface for the use of language model-based biological sequence representations for transfer-learningMIT License
torchOptimized tensor library for deep learning using GPUs and CPUsBSD 3-Clause "New" or "Revised" License
transformersProvides pretrained models to perform tasks on different modalities such as text, vision, and audioApache License 2.0
sentencepieceUnsupervised text tokenizer and detokenizer mainly for neural network-based text generation systemsApache License 2.0
matplotlibProvides functions for creating static, animated, and interactive visualizationsMatplotlib License (BSD-Compatible)
umap-learnImplements uniform manifold approximation and projection, a dimensionality reduction techniqueBSD 3-Clause "New" or "Revised" License

The descriptions are taken from their respective websites.

Return toTable of Contents.

💻 Authors

This is a research project under theBioinformatics Laboratory,Advanced Research Institute for Informatics, Computing and Networking, De La Salle University, Philippines.

This research was partly funded by theDepartment of Science and Technology – Philippine Council for Health Research and Development (DOST-PCHRD) under thee-Asia JRP 2021 Alternative therapeutics to tackle AMR pathogens (ATTACK-AMR) program. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

About

Published in PLOS ONE. Phage-host interaction prediction tool that uses protein language models to represent the receptor-binding proteins of phages. It presents improvements over using handcrafted sequence properties and eliminates the need to manually extract and select features from phage sequences

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp