ChemTSv2 is a refined and extended version of ChemTS[1]. The original implementation is available at https://github.com/tsudalab/ChemTS.
It provides:
- easy-to-run interface by using only a configuration file
- easy-to-define framework for users' any reward function, molecular filter, and tree policy
- various usage examples in the GitHub repository
[1] X. Yang, J. Zhang, K. Yoshizoe, K. Terayama, and K. Tsuda, "ChemTS: An Efficient Python Library for de novo Molecular Generation", Science and Technology of Advanced Materials, Vol.18, No.1, pp.972-976, 2017.
- python: 3.7
- rdkit: 2021.03.5
- tensorflow: 2.5.0
- pyyaml
- pandas
- joblib
- mpi4py: 3.0.3 (for massive parallel mode)
cd YOUR_WORKSPACE
python3.7 -m venv .venv
source .venv/bin/activate
pip install --upgrade chemtsv2
NOTE: You need to run ChemTSv2-MP on a server where OpenMPI or MPICH is installed.
If you can't find mpiexec
command, please consult your server administrator to install such an MPI library.
If you can use/prepare a server with MPI environment, please follow the (a) instruction; otherwise, please follow the (b) instruction.
cd YOUR_WORKSPACE
python3.7 -m venv .venv
source .venv/bin/activate
pip install --upgrade chemtsv2
pip install mpi4py==3.0.3
conda create -n mpchem python=3.7
# swith to the `mpchem` environment
conda install -c conda-forge openmpi cxx-compiler mpi mpi4py=3.0.3
pip install --upgrade chemtsv2
git clone git@github.com:molecule-generator-collection/ChemTSv2.git
cd ChemTSv2
cd train_RNN
python train_RNN.py -c model_setting.yaml
If you want to use your trained model, please update chemtsv2/misc/load_model:loaded_model
based on your model architecture.
Please refer to the sample file (config/setting.yaml).
If you want to pass any value to calc_reward_from_objective_values
(e.g., weights for each value), add it in the config file.
chemtsv2 -c config/setting.yaml
If you want to use GPU, run ChemTS with --gpu GPU_ID
argument as follows.
chemtsv2 -c config/setting.yaml --gpu 0
mpiexec -n 4 chemtsv2-mp --config config/setting_mp.yaml
You can extend the SMILES string you input.
In this case, you need to put the atom you want to extend at the end of the string and run ChemTS with --input_smiles
argument as follows.
chemtsv2 -c config/setting.yaml --input_smiles 'C1=C(C)N=CC(N)=C1C'
This package is distributed under the MIT License.
- Shoichi Ishida (ishida.sho.nm@yokohama-cu.ac.jp)
- Kei Terayama (terayama@yokohama-cu.ac.jp).