What is SMILES?
SMILES (Simplified Molecular Input Line Entry System) is a notation that represents molecular structures as linear strings of characters. ChemLactica models use SMILES as the primary representation format for small organic molecules.SMILES allows complex molecular structures to be represented as simple text strings, making them perfect for processing with language models.
SMILES in ChemLactica
Special Tags
ChemLactica uses special tags to mark SMILES strings in the input:chemlactica/utils/text_format_utils.py
Example Usage
Canonical SMILES
ChemLactica internally converts all SMILES to their canonical form for consistency:chemlactica/mol_opt/utils.py
Why Canonicalization Matters
The same molecule can be written in multiple ways:SMILES Syntax Basics
Atoms
string
Atoms like C, N, O, P, S, F, Cl, Br, I can be written directly
string
Other atoms or atoms with charges/isotopes use brackets
Bonds
Branches
Rings
SMILES Examples from ChemLactica
Here are real examples from the codebase:Simple Molecules
chemlactica/utils/utils.py
With Properties and Similarity
Molecular Optimization Context
chemlactica/mol_opt/utils.py
Working with SMILES in ChemLactica
Converting SMILES to Molecular Objects
chemlactica/mol_opt/utils.py
Validation
Advanced SMILES Features
Stereochemistry
Aromatic Systems
Common Molecules in SMILES
Drug Molecules
Drug Molecules
Simple Organic Molecules
Simple Organic Molecules
SMILES Resources
RDKit Documentation
Official RDKit SMILES guide
Daylight SMILES Theory
Original SMILES specification
Next Steps
Molecular Properties
Learn about calculated properties
Model Architectures
Explore the model family
Training Data
Understand the corpus
Generation Guide
Generate molecules