The MultiAiZ tool expands AiZynthFinder for multi-target synthesis planning by leveraging common intermediates. MultiAiZ find most possible synthesis routes and reaction intermediates from synthesis routes for a given target by running AiZynthFinder for a user-defined number of iterations, accelerating tree reaction search by keeping a memory of already seen intermediates. Post search, the intermediate score is applied to create a ranking of the best intermediates in terms of synthesis cost and utility, to build convergent synthesis routes.
First clone the repository using Git.
The project dependencies can be installed by executing the following commands in the root of the repository:
conda env create -f env-dev.yml
conda activate multiaiz-env
poetry install --all-extras
the multiaiz package is now installed in editable mode.
├── multiaiz/ # Multi-target synthesis modules
│ ├── __init__.py # Package initialization file
│ ├── main.py # CLI script for running MultiAiZ
│ ├── multiaiz.py # Core MultiAiZ class for multi-target synthesis planning
│ ├── plotting.py # Plotting utilities for visualization and analysis
│ ├── post_processing.py # Post-processing functions for intermediates analysis
│ └── utils.py # Utility functions for statistics and file handling
└── tests/ # Unit tests
Below is a minimal example of how to use the MultiAiZ class in your own script or notebook:
from aizynthfinder.aizynthfinder import AiZynthFinder
from multiaiz import MultiAiZ
# Path to your AiZynthFinder config file
config_file = "path/to/config.yml"
# List of target molecules (SMILES strings)
targets = [
"CCO", # Example SMILES
"CCN"
]
# Output directory for results
output_dir = "output/my_run"
# Initialize AiZynthFinder
finder = AiZynthFinder(configfile=config_file)
finder.stock.select("emolecules")
finder.expansion_policy.select("standard")
finder.filter_policy.select("standard")
# Initialize and run MultiAiZ
multi_aiz = MultiAiZ(finder, targets, output_dir)
stats = multi_aiz.run(n_iters=5)
# The results are saved in output_dir (e.g., intermediates.csv, stats.csv)Tests uses the pytest package, and is installed by poetry
Run the tests using:
pytest -v
We welcome contributions, in the form of issues or pull requests.
If you have a question or want to report a bug, please submit an issue.
To contribute with code to the project, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>. - Make your changes and commit them:
git commit -m '<commit_message>' - Push to the remote branch:
git push - Create the pull request.
Please use pre-commit to ensure proper formatting and linting
This project is licensed under the MIT License. See LICENSE for details.
If you find this work useful, please cite the associated paper(s): Iáñez Picazo, P., Voronov A., Genheden A., Westerlund A.M., Joint Synthesis Planning by Leveraging Common Intermediates