Skip to main content

Retrosynthesis, visualization and machine learning tools

Project description

logo

- RetroChem -

📜 Package information

RetroChem, is a one-step retrosynthesis engine pip installable python package, which is based on SMILES inputs. It includes tools for model training, template preprocessing, and visualization of reaction predictions. Developped as part of a project for the practical Programming in Chemistry at EPFL (2025).

EPFL Course

🪄 Features

  • Simple to use retrosynthesis engine.
  • Draw molecules or use molecule name (eg. paracetamol).
  • Gives clean and chemically correct molecules.
  • Works well for known molecules (eg. GHB, EDTA and etc).
  • Predicts possible reactants and reaction steps.
  • Gives the predictions in order of confidence

👥 Contributors

  • Giulio Matteo Garotti, second year chemical engineer at EPFL GitHub
  • Florian Follet, second year chemist at EPFL GitHub
  • Noah Paganzzi, second year chemical engineer at EPFL GitHub
  • Jacques Maurice Grandjean, second year chemical engineer at EPFL GitHub

Maintained Contributors python3.10 LICENSE

View contributors : Contributors on GitHub

View commit activity: Commit activity on GitHub

View code frequency : Code frequency on GitHub

GitHub Python Jupyter Streamlit Anaconda

Made_with_python

🔍 Retrosynthesis, what is it?

Organic retrosynthesis is a problem-solving technique used in organic chemistry to design a synthetic route for a target molecule by breaking it down into simpler precursor structures. This process, known as retrosynthetic analysis, helps chemists plan the step-by-step synthesis of complex organic compounds by working backward from the desired product.

The approach involves two main stages:

Disconnection: The target molecule is “disconnected” at strategic bonds to identify simpler molecules that could be used as starting materials. These disconnections are guided by known chemical reactions and functional group transformations. Each disconnection leads to one or more synthons, which are idealised fragments representing the functional components of the molecule. For example, a carbon–carbon bond may be disconnected to yield a nucleophile and an electrophile.

Reagent Identification: Once the synthons are defined, they are translated into real, purchasable or synthesizable compounds known as synthetic equivalents. These are then used to build the molecule in the forward direction. This step requires the selection of appropriate reagents, protecting groups, and reaction conditions to ensure a feasible and efficient synthesis.

A retrosynthetic tree is often constructed to visualise all possible synthetic pathways, with the target molecule at the top and potential starting materials branching below. Chemists use both strategic bonds and known reaction patterns (like aldol condensations, Grignard additions, or Diels-Alder reactions) to inform these choices.

  • Retrosynthesis is widely applied in:
  • Pharmaceutical chemistry, for the development of active pharmaceutical ingredients (APIs).
  • Natural product synthesis, for recreating complex bioactive compounds from simpler building blocks.
  • Material science, for designing functional molecules with specific properties.
  • Green chemistry, to plan more sustainable and efficient synthetic routes.

The logic of retrosynthesis also lends itself well to computational chemistry. Algorithms and machine learning tools are increasingly used to automate retrosynthetic analysis, generating synthetic routes based on reaction databases and predictive models.

The theoretical underpinning of retrosynthesis often involves mapping the retrosynthetic steps to known reaction mechanisms and using heuristics based on reactivity and selectivity. The goal is to find the shortest, most cost-effective, and most reliable pathway to the target compound.

Let us now walk through how to apply retrosynthetic analysis to a real molecule using this framework!

🕹️ How to install it

PYPI page of the RetroChem package:

RetroChem.PYPI

Firstly it is advised to create a CONDA environment:

#Open bash or terminal
#Name the environment as you wish
conda create -n env.name

#Activate your environment
conda activate env.name

#Alternative way of activating it
source activate env.name

Clone this repository and install the python package locally:

#Clone the repository
git clone https://github.com/Flo-fllt/RetroChem.git

#Naviguate to the RetroChem folder
cd RetroChem

#Install the package locally in editable mode, make sure to activate your environment before doing so
pip install retrochem

#This will install the retrosynth package on your machine. You can then run the program by running:
retrochem

This will automatically install all the requirements and functions needed to run the code.

💡 Requirements

python>=3.10
streamlit
pandas
numpy
joblib
rdkit
scikit-learn
matplotlib
pillow
streamlit-ketcher

💻 Guide

Once the RetroChem web page is open the retrosynthesis engine is ready to run!

interface guide 1

If the program has a difficult time finding reactnts, try another molecule and especially known molecules.

interface guide 2 interface guide 3 interface guide 4

📚 Want more information?

Here is the link to the report of the project, logging detailed information regarding the functions and data used to efficiently run this program. Jupyter Notebook

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retrochem-0.1.6.tar.gz (29.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retrochem-0.1.6-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file retrochem-0.1.6.tar.gz.

File metadata

  • Download URL: retrochem-0.1.6.tar.gz
  • Upload date:
  • Size: 29.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for retrochem-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8d33043f99a18495f050f09f068276c04dff6152157c89bacfa635909d861617
MD5 bcd8dd2e0d34c20fee05ed380ccc7af4
BLAKE2b-256 d0f1d5ba983dfcbbbcab70a2bf5e99e51ff2ed1fbed9718d4d27ead13be7f106

See more details on using hashes here.

File details

Details for the file retrochem-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: retrochem-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for retrochem-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5d511699808a93775ad1aa185abaacddf7f7d1f1efd044306398c0c26a27a2c2
MD5 c43035cef3c847dbc563d3d6c81dcb4a
BLAKE2b-256 a82313efc5c9dd1415a0f2f17954209cda1195f30233a3123c0d3c718dd3a228

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page