Skip to main content

A lightweight generative model that extends SMILES fragments into syntactically valid molecules

Project description

Chempleter

Demo Gif

Molecular autocomplete

PyPI - Status PyPI - Version Python Version from PEP 621 TOML PyPI - License GitHub last commit

Chempleter is lightweight generative model which utlises a simple Gated Recurrent Unit (GRU) to predict syntactically valid extensions of a provided molecular fragment. It accepts SMILES notation as input and enforces chemical syntax validity using SELFIES for the generated molecules.

  • What can Chempleter do?

    • Currently, Chempleter accepts an intial molecule/molecular fragment in SMILES format and generates a larger molecule with that intial structure included, while respecting chemical syntax. It also shows some interesting descriptors.

    • It can be used to generate a wide range of structural analogs which the share same core structure (by changing the sampling temperature) or decorate a core scaffold iteratively (by increasing generated token lengths)

    • In the future, it might be adapated to predict structures with a specific chemical property using a regressor to rank predictions and transition towards more "goal-directed" predictions.

Demo Gif

Prerequisites

  • Python ">=3.12"
  • uv (optional but recommended)

Getting started

Visit Chempleter's docs.

Quick start

You can find more information about installing Chempleter (also via pip) in installation instructions.

  • Run the GUI directly without installing (via uv):

    • On windows:

      uvx --from chempleter chempleter-gui.exe

    • On linux/MacOS:

      uvx --from chempleter chempleter-gui

  • Install using uv

    uv pip install chempleter

  • Use the GUI

    • To start the Chempleter GUI after installing, execute in a terminal:

      uv run chempleter-gui

    • Type in the SMILES notation for the starting structure or leave it empty to generate random molecules. Click on GENERATE button to generate a molecule.

    • To know more about using the GUI and various options, see here.

    Or

  • Use as a python library

    • To use Chempleter as a python library:

      from chempleter.inference import extend
      generated_mol, generated_smiles, generated_selfies = extend(smiles="c1ccccc1")
      print(generated_smiles)
      >> C1=CC=CC=C1C2=CC=C(CN3C=NC4=CC=CC=C4C3=O)O2
      

      To draw the generated molecule :

      from rdkit import Chem
      Chem.Draw.MolToImage(generated_mol)
      
    • For details on available paramenters and inference functions, see generating molecules.

Project structure

  • src/chempleter: Contains python modules relating to different functions.
  • src/chempleter/processor.py: Contains fucntions for processing csv files containing SMILES data and generating training-related files.
  • src/chempleter/dataset.py: ChempleterDataset class
  • src/chempleter/model.py: ChempleterModel class
  • src/chempleter/inference.py: Contains functions for inference
  • src/chempleter/train.py: Contains functions for training
  • src/chempleter/gui.py: Chempleter GUI built using NiceGUI
  • src/chempleter/data : Contains trained model, vocabulary files

License

MIT License

Copyright (c) 2025-2026 Davis Thomas Daniel

Contributing

Any contribution, improvements, feature ideas or bug fixes are always welcome.

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

chempleter-0.1.0b5.tar.gz (21.8 MB view details)

Uploaded Source

Built Distribution

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

chempleter-0.1.0b5-py3-none-any.whl (21.8 MB view details)

Uploaded Python 3

File details

Details for the file chempleter-0.1.0b5.tar.gz.

File metadata

  • Download URL: chempleter-0.1.0b5.tar.gz
  • Upload date:
  • Size: 21.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for chempleter-0.1.0b5.tar.gz
Algorithm Hash digest
SHA256 694e28418893d1c5b34cd8fbbae15e2267c86c2e077b41f5642c0e0ce91a3ab4
MD5 1c9e15f1264e74ebecb61acf1340964c
BLAKE2b-256 4056921ccdeb94f4355163e0335a26aaf67c7b077af20465406654c6a3d63972

See more details on using hashes here.

File details

Details for the file chempleter-0.1.0b5-py3-none-any.whl.

File metadata

File hashes

Hashes for chempleter-0.1.0b5-py3-none-any.whl
Algorithm Hash digest
SHA256 3de0b8bfb3287c930773fe6298d3dd3991beadcd2e7ed37307d3582dacc41f01
MD5 35946e1f50ecb8d0fa5a72f987925735
BLAKE2b-256 4e938cb5fa246596696d0d37d2fc5008061f7e0663ac1bf1b52fef0b4334f18b

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