Skip to content

About

This is my first app using the streamlit library

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

CYP450 Metabolism Predictor

A web application for predicting Cytochrome P450 (CYP450) enzyme interactions with chemical compounds using Graph Convolutional Neural Networks.

Overview

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.

Features

  • 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

Technology Stack

Core Frameworks

  • 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

Chemistry & Molecular Processing

  • RDKit 2022.9.5 - Cheminformatics toolkit for SMILES parsing and molecular visualization

Data Science & ML

  • NumPy 1.23.5 - Numerical computing
  • Pandas 1.5.3 - Data manipulation
  • Scikit-learn 1.2.1 - Machine learning utilities

Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Setup

  1. Clone the repository:
git clone <repository-url>
cd deepchem_streamlit
  1. Install dependencies:
pip install -r requirements.txt

Usage

Starting the Application

Run the Streamlit app:

streamlit run app.py

The application will open in your default web browser at http://localhost:8501

Using the Application

  1. 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)
  2. 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)
  3. 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)
  4. 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
  5. Explore Molecular Properties: Expand the properties section to view calculated descriptors

Model Architecture

Graph Convolutional Neural Networks

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)

Model Details

  • Type: DeepChem GraphConvModel
  • Task: Binary classification (Active/Inactive)
  • Training Data: Structure and activity data of known substrates and inhibitors
  • Framework: TensorFlow/Keras

Model Storage

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.

Application Architecture

Key Components

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)

  • ConvMolFeaturizer converts 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

Use Cases

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

Limitations and Disclaimer

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.

Performance Optimizations

  • 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

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

CYP450 Enzymes

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

Technologies

Support

For questions, issues, or feature requests, please open an issue in the repository.


Built with DeepChem, RDKit, and Streamlit

About

This is my first app using the streamlit library

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages