eToxPred is a tool to reliably estimate the toxicity and calculate the synthetic accessibility of small organic compounds. This is a newer implementation. The libraries used have been updated and the Deep Belief Network (DBN) for the SA score prediction has been replaced by the exact SA score calculation. For older implementation please refer to the folder /stale.
This README file is written by Limeng PU.
If you find this tool is useful to you, please cite our paper: Pu, L., Naderi, M., Liu, T. et al. eToxPred: a machine learning-based approach to estimate the toxicity of drug candidates. BMC Pharmacol Toxicol 20, 2 (2019). https://doi.org/10.1186/s40360-018-0282-6
- sudo add-apt-repository ppa:deadsnakes/ppa
- sudo apt update
- sudo apt install python3.7
- sudo apt install python3.7-venv
- python3.7 -m venv .venv
- source .venv/bin/activate
- python -V
- Confirm the version of python.
- pip install -r requirements.txt
- Python 3.7.*
- Pandas 1.0 or higher
- scikit-learn==0.23.2
- rdkit-pypi==2021.3.5
Extract etoxpred_best_model.tar.gz
- tar -xzf toxpred_best_model.tar.gz
The software package contains 2 parts:
- SAscore calculation
- Toxicity prediction
To use the trained models for predictinos:
- Download and extract the package.
- Run the eToxPred by
python etoxpred_predict.py --datafile tcm600_nr.smi --modelfile etoxpred_best_model.joblib --outputfile results.csv
--datafilespecifies the input .smi file which stores the SMILES data.--modelfilespecifies the location of the trained model.--outputfilespecifies the output file to store the predicted SAscores and Tox-scores. If this term is not provided, the code will save the output to./results.csv.
- The trianed toxicity model is provided as
etoxpred_best_model.tar.gz. Please untar before use. For those who wonders, the best parameter setup isn_estimators550,min_samples_split16,min_samples_leaf3, andmax_features10.
To use the package to train your own models:
- Prepare the training dataset. The dataset contains three parts: the smiles, the name of the compound, and the label. The label is 0 or 1, where 0 means safe and 1 means toxic. The dataset has to be stored in a .smi file, where each field is separated by a tab, in the format: [SmilesString\tID\tLabel].
- Train the ET for toxicity prediction. The code provided performs a randomized parameter search. It will return the best result (depending on chosen metric), parameters (.json format), and the model (.joblib format). Run
etoxpred_train.pyin bypython etoxpred_train.py --datafile your_training_set.smi --paramfile params.json --outputfile best_model --iter 3 --scorer balanced_accuracy.
--datafilespecifies the path to your training datset with the aforementioned format.--paramfilespecifies the parameter file contains the parameters and the range/distribution of them that you want to search for during the training. An example file is provided, namelyparam.json. More parameters can be added according to https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.ExtraTreesClassifier.html.--outputfilespecifies the output file to store the best model. If this term is not provided, the code will save the output tobest_model.joblib.--iteris the number of iterations to run the randomized search.--scoreris the metric to evaluate the performance of each run. It defaultly usesbalanced_accuracy. recommanded metrics includeaccuracy,balanced_accuracy,f1, androc_auc.
An example test dataset that can be used for prediction (in the .smi format) is provided in tcm600_nr.smi. The ready to use dataset for ET training is provided in trainig_set.smi. Much larger dataset for training can be found at https://osf.io/m4ah5/. The general format is SmilesString\tID\tToxicity. The results of the testing set TCM6000_NR are also provied in tcm_results.csv.