AutoML system for building trustworthy peptide bioactivity predictors
Project description
- Documentation: https://ibm.github.io/AutoPeptideML
- Source Code: https://github.com/IBM/AutoPeptideML
- Webserver: http://peptide.ucd.ie/AutoPeptideML
- Google Collaboratory Notebook: AutoPeptideML_Collab.ipynb
- Paper Pre-print: https://www.biorxiv.org/content/10.1101/2023.11.13.566825v3
AutoPeptideML allows researchers without prior knowledge of machine learning to build models that are:
- Trustworthy: Robust evaluation following community guidelines for ML evaluation reporting in life sciences DOME.
- Interpretable: Output contains a PDF summary of the model evaluation explaining how to interpret the results to understand how reliable the model is.
- Reproducible: Output contains all necessary information for other researchers to reproduce the training and verify the results.
- State-of-the-art: Models generated with this system are competitive with state-of-the-art handcrafted approaches.
We recommend the use of the Google Collaboratory Notebook for users that want greater control of the model training process and the webserver for users that prefer ease of use.
Contents
Table of Contents
Installation
Installing in a conda environment is recommended. For creating the environment, please run:
conda create -n autopeptideml python
conda activate autopeptideml
1. Python Package
1.1.From PyPI
pip install autopeptideml
1.2. Directly from source
pip install git+https://github.com/IBM/AutoPeptideML
2. Preparing AutoPeptideML-Peptipedia Database
Download and prepare the Peptipedia Database by running:
autopeptideml-setup
If any error happens during the download, it may be caused by not having the latest version of the gdown library. Please run the following code to get the latest version:
pip install --upgrade --no-cache-dir gdown
3. Third-party dependencies
For using MMSeqs as alignment algorithm is necessary install it in the environment:
conda install -c bioconda mmseqs2
For using Needleman-Wunch:
conda install -c bioconda emboss
If installation not in conda environment, please check installation instructions for your particular device:
-
Linux:
wget https://mmseqs.com/latest/mmseqs-linux-avx2.tar.gz tar xvfz mmseqs-linux-avx2.tar.gz export PATH=$(pwd)/mmseqs/bin/:$PATH
sudo apt install emboss
sudo apt install emboss
-
Windows: Download binaries from EMBOSS and MMSeqs2-latest
-
Mac:
sudo port install emboss brew install mmseqs2
Benchmark data
Data used to benchmark our approach has been selected from the benchmarks collected by Du et al, 2023. A new set of benchmarks was constructed from the original set following the new data acquisition and dataset partitioning methods within AutoPeptideML. To download the datasets:
- Original UniDL4BioPep Benchmarks: Please check the project Github Repository.
- New AutoPeptideML Benchmarks: Can be downloaded from this link.
Documentation
1. Model builder options
Dataset construction
dataset
: File with positive peptides inFASTA
orCSV
file. It can also contain negative peptides in which case the files should contain the labels (0: negative or 1: positive) either in the header (FASTA
) or in columnY
(CSV
).--balance
: IfTrue
, it balances the datasets by oversampling the underrepresented label.--autosearch
: IfTrue
, it searches for negative peptides.--autosearch_tags
: Comma separated list of tags that may overlap with positive activity that are going to be excluded from the negative peptides.--autosearch_proportion
: Negative:positive ration when automatically drawing negative controls from the bioactive peptides database (Default: 1.0).
Output
--outputdirdir
: Output directory (Default:./apml_result/apml_result
).
Protein Language Model
--plm
: Protein Language Model for computing peptide representations. Available options:esm2-8m
,esm2-35m
,esm2-150m
,esm2-650m
,esm2-3b
,esm2-15b
,esm1b
,prot-t5-xxl
,prot-t5-xl
,protbert
,prost-t5
. (Default:esm2-8m
). Please note: Larger Models might not fit into GPU RAM, if it is necessary for your purposes, please create a new issue.--plm_batch_size
: Number of peptides for which to batch the PLM computation.(Default: 12).
Dataset Partitioning
--test_partition
: Whether to divide the dataset in train/test splits. (Default:True
).--test_threshold
: Maximum sequence identity allowed between train and test. (Default: 0.3).--test_size
: Proportion of data to be assigned to evaluation set. (Default: 0.2).--test_alignment
: Alignment algorithm used for computing sequence identities. Available options:mmseqs
,mmseqs+prefilter
,needle
. (Default:mmseqs+prefilter
).--splits
: Path to directory with train and test splits. Expected contents:train.csv
andtest.csv
.--val_partition
: Whether to divide dataset in train/validation folds.--val_method
: Method to use for creating train/validation folds. Options available:random
,graph-part
. (Default:random
)--val_threshold
: Maximum sequence identity allowed between train and validation. (Default: 0.5).--val_alignment
: Alignment algorithm used for computing sequence identities. Available options:mmseqs
,mmseqs+prefilter
,needle
. (Default:mmseqs+prefilter
).--val_n_folds
: Number of folds (Default: 10).--folds
: Path to directory with train/validation folds. Expected contents:train_{fold}.csv
andvalid_{fold}.csv
.
Model Selection and Hyperparameter Optimisation
--config
: Name of one of the pre-defined configuration files (seeautopeptideml/data/configs
) or path to a custom configuration file (see next section).
Other
--verbose
: Whether to display information about runtime (Default: True).--threads
: Number of threads to use for parallelization. (Default: Number of cores in the machine).--seed
: Seed for pseudorandom number generators. Controls stochastic processes. (Default: 42)
2. Predict
dataset
: File with problem peptides inFASTA
orCSV
file.--ensemble
: Path to the a file containing a previous AutoPeptideML result.--outputdir
: Output directory (Default:./apml_predictions
).--verbose
: Whether to display information about runtime (Default: True).--threads
: Number of threads to use for parallelization. (Default: Number of cores in the machine).--plm
: Protein Language Model for computing peptide representations. Must be the same as used to train the model. Available options:esm2-8m
,esm2-35m
,esm2-150m
,esm2-650m
,esm2-3b
,esm2-15b
,esm1b
,prot-t5-xxl
,prot-t5-xl
,protbert
,prost-t5
. (Default:esm2-8m
). Please note: Larger Models might not fit into GPU RAM, if it is necessary for your purposes, please create a new issue.--plm_batch_size
: Number of peptides for which to batch the PLM computation.(Default: 12).
3. Hyperparameter Optimisation and model selection
The experiment configuration is a file in JSON
format describing the hyperparameter optimisation search space and the composition of the final ensemble. The first level of the file is a dictionary with a single key (ensemble
or model_selection
or model_selection
) and a list of search spaces for the hyperparameter optimisation. For each model within the ensemble
list, n
different models will be trained one per cross-validation fold; in the case of model_selection
, only one of the algorithms will comprise the final ensemble; in the case of model_selection
, only one of the algorithms will comprise the final ensemble.
Each experiment requires the following fields:
model
: Defines the ML algorithm. Options:KNearestNeighbours
,SVM
,RFC
,XGBoost
,LGBM
,MLP
, andUniDL4BioPep
. More options will be added in subsequent releases and they can be implemented upon request.trials
: Defines the number of iterations for the hyperparameter optimisation search.optimization_metric
: Defines the metric that should be used for directing the optimisation search. Always, the metric will be calculated as the average across then
cross-validation folds. For the metrics available all of the binary classification within the list in the scikit-learn documentation are supported (Default: Matthew's correlation coefficient, MCC).hyperparameter-space
: List of dictionaries that defines the hyperparameter search space proper. Each of the dictionaries within correspond to a different hyperparameter and may have the following fields:name
: It has to correspond with the corresponding hyperparameter in the model implementation. Most of the simpler ML models use thescikit-learn
implementation,LGBM
uses the Microsoft implementation (More information on LGBM Repository) andUniDL4BioPep
uses the PyTorch implementation (More information on UniDL4BioPep PyTorch Repository), though for this model hyperparameter optimisation is not recommended.type
: Defines the type of hyperparameter. Options:int
,float
, orcategorical
.min
andmax
: Defines the lower and upper bounds of the search space for typesint
andfloat
.log
: Boolean value that defines whether the search should be done in logarithmic space or not. Accelerates searches through vast spaces for example for learning rates (1e-7 to 1). It is not optional.value
: Defines the list of options available for a hyperparameter of typecategorical
for example types of kernel (linear
,rbf
,sigmoid
) for a Support Vector Machine.
There is an example available in the default configuration file.
Examples
autopeptideml dataset.csv
autopeptideml dataset.csv --val_method graph-part --val_threshold 0.3 --val_alignment needle
autopeptideml dataset.csv
autopeptideml dataset.csv --val_method graph-part --val_threshold 0.3 --val_alignment needle
License
AutoPeptideML is an open-source software licensed under the MIT Clause License. Check the details in the LICENSE file.
Credits
Special thanks to Silvia González López for designing the AutoPeptideML logo and to Marcos Martínez Galindo for his aid in setting up the AutoPeptideML webserver.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file autopeptideml-1.0.0.tar.gz
.
File metadata
- Download URL: autopeptideml-1.0.0.tar.gz
- Upload date:
- Size: 2.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56ab1bfb7b450bc39746ea8f042e27f81eac512a3d265160e07bd529ab1174d9 |
|
MD5 | c731f5243c4566e6c3237210fd8e9319 |
|
BLAKE2b-256 | 28526990f1ee6cfc503296fccdf404d8ede2e3b8780e87fe71a1bb6fb6d8e681 |
File details
Details for the file autopeptideml-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: autopeptideml-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8151b07e9c93a9b4c3f3e42e3289045d2359e984ca8c546d1203982f06a10d |
|
MD5 | eae337b737bff7e5ed1ddfb9d389da13 |
|
BLAKE2b-256 | 513f41c2e01e7695a118eee6a16009cd06c3312fb6bbee54c94878edd113f098 |