This is the repository for the synthetic data generation pipeline of Markush Structures. (adapted for MarkushGrapher-2)
- Branch: main: contains the updated cxsmiles_tokenizer for MarkushGrapher-2 (MarkushGrapher-2: End-to-end Multimodal Recognition of Chemical Structures)
- Branch: markushgenerator-1: contains the original cxsmiles_tokenizer and synthetic data generation pipeline for MarkushGrapher-1 (MarkushGrapher: Joint Visual and Textual Recognition of Markush Structures.)
- Create a virtual environment.
python3.10 -m venv markushgenerator-env
source markushgenerator-env/bin/activate
- Install MarkushGenerator.
PIP_USE_PEP517=0 pip install -e .
- Install Java 17.
sudo apt-get install openjdk-17-jdk
sudo update-alternatives --config 'java'
- Download the CDK library (version
cdk-2.9.jar) from and move it toMarkushGenerator/lib/.
wget https://github.com/cdk/cdk/releases/download/cdk-2.9/cdk-2.9.jar -P ./lib/
The notebook MarkushGenerator/markushgenerator/draw.ipynb shows how to:
- Draw an image from a CXSMILES.
- Draw a textual definition associated with the CXSMILES.
Each generated sample contains:
- CXSMILES — the chemical structure representation.
- Optimized CXSMILES — a normalized form of the CXSMILES.
- Markush structure image — the rendered chemical diagram.
- OCR cells — position and content of text in the images. Some characters are currently omitted (explicit carbons, implicit hydrogens). Atoms with charges are formatted as "atom, charge, number of charges". Superscripts and subscripts are ignored.

