A web application for predicting Cytochrome P450 (CYP450) enzyme interactions with chemical compounds using Graph Convolutional Neural Networks.
This Streamlit-based application predicts whether chemical compounds are substrates or inhibitors of five major Cytochrome P450 enzymes. These enzymes are responsible for metabolizing approximately 70-80% of all drugs, making this tool valuable for pharmaceutical research, drug development, and drug-drug interaction (DDI) analysis.
-
Multi-Enzyme Prediction: Analyzes compounds against 5 key CYP450 enzymes:
- CYP1A2
- CYP2C9
- CYP2C19
- CYP2D6
- CYP3A4
-
Dual Prediction Types:
- Substrate activity prediction
- Inhibitor activity prediction
-
Drug-Drug Interaction Analysis: Compare two molecules side-by-side to identify potential metabolic interactions
-
Molecular Visualization: Automatically generates 2D structure images from SMILES input
-
Molecular Property Calculation: Displays key molecular descriptors including:
- Molecular Formula
- Molecular Weight
- LogP (lipophilicity)
- TPSA (Topological Polar Surface Area)
-
Pre-loaded Examples: Includes example molecule pairs demonstrating known DDI scenarios
- Streamlit 1.19.0 - Web application interface
- DeepChem - Machine learning library for drug discovery
- TensorFlow 2.12.0 - Deep learning framework
- Keras 2.12.0 - Neural network API
- RDKit 2022.9.5 - Cheminformatics toolkit for SMILES parsing and molecular visualization
- NumPy 1.23.5 - Numerical computing
- Pandas 1.5.3 - Data manipulation
- Scikit-learn 1.2.1 - Machine learning utilities
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone <repository-url>
cd deepchem_streamlit- Install dependencies:
pip install -r requirements.txtRun the Streamlit app:
streamlit run app.pyThe application will open in your default web browser at http://localhost:8501
-
Enter Molecular Structures: Input one or two molecules in SMILES format
- SMILES (Simplified Molecular Input Line Entry System) is a text notation for chemical structures
- Example:
CC(=O)Oc1ccccc1C(=O)O(Aspirin)
-
Use Example Molecules: Click example buttons to load pre-configured molecule pairs:
- Example 1: Fluconazole & Warfarin (demonstrates CYP2C9 interaction)
- Example 2: Fluoxetine & Metoprolol (demonstrates CYP2D6 interaction)
-
View Predictions: After entering SMILES, predictions are generated for:
- Substrate activity (whether the compound is metabolized by each enzyme)
- Inhibitor activity (whether the compound blocks enzyme activity)
-
Analyze Interactions: When comparing two molecules, the app automatically detects potential DDI scenarios:
- Inhibitor + Substrate: One molecule may reduce metabolism of the other
- Both Inhibitors: Potential additive inhibition effects
- Both Substrates: Potential competitive metabolism
-
Explore Molecular Properties: Expand the properties section to view calculated descriptors
The application uses 10 trained Graph Convolutional Neural Network (GCN) models:
- 5 Inhibitor prediction models (one per enzyme)
- 5 Substrate prediction models (one per enzyme)
- Type: DeepChem GraphConvModel
- Task: Binary classification (Active/Inactive)
- Training Data: Structure and activity data of known substrates and inhibitors
- Framework: TensorFlow/Keras
Models are stored in the models/ directory with the following structure:
models/
├── model_1A2_inh/ # CYP1A2 Inhibitor
├── model_1A2_sub/ # CYP1A2 Substrate
├── model_2C19_inh/ # CYP2C19 Inhibitor
├── model_2C19_sub/ # CYP2C19 Substrate
├── model_2C9_inh/ # CYP2C9 Inhibitor
├── model_2C9_sub/ # CYP2C9 Substrate
├── model_2D6_inh/ # CYP2D6 Inhibitor
├── model_2D6_sub/ # CYP2D6 Substrate
├── model_3A4_inh/ # CYP3A4 Inhibitor
└── model_3A4_sub/ # CYP3A4 Substrate
Each model directory contains TensorFlow checkpoint files with trained weights.
Model Loading (app.py:62-75)
- Models are loaded once at startup using
@st.cache_resource - Efficient caching prevents redundant loading across sessions
Featurization (app.py:77-82)
ConvMolFeaturizerconverts SMILES strings to graph representations- Cached for performance optimization
Prediction Pipeline (app.py:84-126)
- Validates SMILES input
- Featurizes molecular structures
- Runs predictions across all 10 models
- Results cached based on SMILES input using
@st.cache_data
Interaction Analysis (app.py:275-312)
- Automated detection of DDI scenarios
- Color-coded warnings for potential interactions
This application is designed for:
- Pharmaceutical Research: Early-stage drug candidate screening
- Drug Development: ADMET (Absorption, Distribution, Metabolism, Excretion, Toxicity) profiling
- Drug-Drug Interaction Studies: Identifying potential metabolic interactions between medications
- Medicinal Chemistry: Structure-activity relationship analysis
- Toxicology: Predicting metabolic pathways and potential drug interactions
Important: These predictions are based on computational models and should be used for informational purposes only. They are not a substitute for:
- Experimental validation
- Professional medical advice
- Regulatory approval processes
- Clinical decision-making
Always validate computational predictions with appropriate experimental methods.
- Model Caching: Models loaded once and reused across sessions
- Prediction Caching: Results cached by SMILES input to avoid redundant calculations
- Batch Processing: Predictions run in batches for efficiency
- Lazy Loading: UI components rendered on-demand
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Cytochrome P450 enzymes are a family of enzymes involved in drug metabolism. The five enzymes covered in this application are responsible for metabolizing the majority of pharmaceutical compounds:
- CYP3A4: ~50% of drugs
- CYP2D6: ~25% of drugs
- CYP2C9: ~10% of drugs
- CYP2C19: ~10% of drugs
- CYP1A2: ~5% of drugs
- DeepChem - Deep learning for drug discovery
- RDKit - Open-source cheminformatics
- Streamlit - Python web app framework
- TensorFlow - Machine learning platform
For questions, issues, or feature requests, please open an issue in the repository.
Built with DeepChem, RDKit, and Streamlit