Smarter is a Streamlit web application for rendering and applying SMARTS patterns to molecules using RDKit. It allows users to input or draw SMARTS patterns, validate them, and apply them to sets of molecules (SMILES or CAS numbers). The app highlights substructure matches and enables exporting results (including images) to Excel.
- SMARTS Pattern Input: Enter or draw SMARTS patterns interactively.
- Validation: Validate SMARTS or SMILES patterns using RDKit.
- Batch Processing: Apply patterns to lists of SMILES or CAS numbers.
- Substructure Highlighting: Visualize substructure matches in molecules.
- Export: Download results as an Excel file with embedded molecule images.
- CAS to SMILES Conversion: Automatically resolves CAS numbers to SMILES using Cirpy.
- Python 3.12+
- RDKit
- Streamlit
- Cirpy
- Pandas
- XlsxWriter
- streamlit-ketcher
All dependencies are listed in requirements.txt and pyproject.toml.
-
Clone the repository:
git clone <your-repo-url> cd smarter
-
Install system dependencies (if using devcontainer):
sudo apt update && sudo apt install -y libxrender1
-
Install Python dependencies:
pip install -r requirements.txt
Or, if using Poetry:
poetry install
streamlit run smarter/app.py
The app will be available at http://localhost:8501.
- Enter or draw a SMARTS pattern in the input box or using the Ketcher widget.
- Validate and visualize the pattern.
- Choose input type (SMILES or CAS) and paste your list (one per line).
- Apply the pattern to see which molecules match and visualize the results.
- Download the results as an Excel file with images.
- app.py: Main Streamlit application.
- utils.py: Utility functions for validation, processing, and exporting.
- requirements.txt: Python dependencies.
- pyproject.toml: Project metadata and dependencies.
- devcontainer.json: Devcontainer configuration for VS Code.
- config.toml: Streamlit theme configuration.
- The app is designed for use in VS Code with Dev Containers.
- On Codespaces or in a devcontainer, dependencies and the app will start automatically.
MIT License
Author: Albert Anguera Sempere
For questions, contact albert.anguera.sempere@gmail.com