Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PKPD Platform

A Python-first platform for pharmacokinetics, pharmacodynamics, and toxicity prediction using SciPy alternatives.

🎯 Three Main Goals

  1. Predict human PK (CL, F, tΒ½) and TI (QTc, bone marrow tox, DILI)
  2. Build cross-species PK/PD virtual models (rodent/dog/NHP) to estimate NOAEL at 14d/1m/9m
  3. Guide compound design toward human PK/PD/toxicity targets

πŸš€ Key Features

  • βœ… Human PK/TI Prediction - Using RDKit + ADMET-AI + custom models
  • βœ… Cross-species PK/PD Models - Using SciPy ODE solvers + allometric scaling
  • βœ… Compound Design & Optimization - Using SciPy optimization + genetic algorithms
  • βœ… Production Ready - No complex compilation, GKE deployment ready

πŸ“¦ Installation

Local Development

# Clone repository
git clone <repository-url>
cd PKPD

# Install dependencies
pip install -e .

Docker Deployment

# Build image
docker build -t pkpd:latest .

# Run container
docker run -p 8000:8000 pkpd:latest

GKE Deployment

# Build and push to GCR
docker build -t gcr.io/PROJECT_ID/pkpd:latest .
docker push gcr.io/PROJECT_ID/pkpd:latest

# Deploy to GKE
kubectl apply -f k8s/

πŸ§ͺ Quick Start

Run the Demonstration Notebook

jupyter notebook notebooks/01_getting_started.ipynb

This notebook demonstrates all three goals:

  • Goal 1: Human PK/TI Prediction
  • Goal 2: Cross-species PK/PD Models & NOAEL Estimation
  • Goal 3: Compound Design & Optimization

CLI Usage

# Predict ADMET properties
pkpd-predict -i compounds.csv -o predictions.csv

# Fit PK model
pkpd-fit -d pk_data.csv -s human -m 2compartment

# Simulate NOAEL
pkpd-simulate -m fitted_model.pkl -d dosing.yaml

# Calculate therapeutic index
pkpd-ti -p predictions.csv

# Score compounds
pkpd-score -c compounds.csv -t targets.yaml

πŸ—οΈ Architecture

src/pkpd/
β”œβ”€β”€ admet/           # ADMET prediction (CL, F, tΒ½, DILI, hERG)
β”œβ”€β”€ models/          # PK/PD model library (PySB)
β”œβ”€β”€ fit/             # Fitting pipeline (SciPy alternatives)
β”œβ”€β”€ simulate/        # Virtual population simulation
β”œβ”€β”€ ti/              # Therapeutic index calculators
β”œβ”€β”€ design/          # Compound scoring and design
β”œβ”€β”€ io/             # Data I/O and validation
β”œβ”€β”€ reporting/       # Plots, tables, reports
└── cli/             # Command-line interface

configs/
β”œβ”€β”€ species/         # Human, rodent, dog, NHP configs
β”œβ”€β”€ dosing/          # 14d, 1m, 9m regimens
β”œβ”€β”€ tox_thresholds/  # QTc, marrow, DILI thresholds
└── fitting/         # Fitting options and priors

πŸ”§ Libraries Used

Core Scientific Stack

  • SciPy - ODE solving, optimization, scientific computing
  • NumPy - Numerical computing
  • Pandas - Data manipulation
  • Matplotlib/Seaborn - Visualization

Specialized Libraries

  • RDKit - Cheminformatics and molecular descriptors
  • PySB - Systems biology modeling
  • ADMET-AI - ADMET property prediction

No Complex Dependencies

  • ❌ No AMICI (replaced with SciPy ODE solvers)
  • ❌ No pyPESTO (replaced with SciPy optimization)
  • ❌ No PyTDC (replaced with direct data loading)

πŸ“Š Usage Examples

1. ADMET Prediction

from pkpd.admet import ADMETPredictor
predictor = ADMETPredictor()
predictions = predictor.predict_batch(smiles_list, compound_ids)

2. PK/PD Modeling

from pkpd.models import TwoCompartmentPK
pk_model = TwoCompartmentPK(species='human')
pk_model.scale_to_species(70.0)

3. Cross-species Simulation

from pkpd.simulate import SimulationEngine
engine = SimulationEngine()
noael = engine.simulate_noael(model, dosing_regimen)

4. Compound Design

from pkpd.design import CompoundDesigner
designer = CompoundDesigner()
scores = designer.score_compounds(compounds, target_profiles)

🎯 Goals Achieved

βœ… Goal 1: Human PK/TI Prediction

  • Predicted clearance, volume, half-life, bioavailability
  • Assessed QTc, bone marrow, and DILI risks
  • Generated risk-based compound ranking

βœ… Goal 2: Cross-species PK/PD Models & NOAEL

  • Built 2-compartment PK models for 4 species
  • Applied allometric scaling for cross-species translation
  • Estimated NOAEL for 14d/1m/9m regimens
  • Generated safety margin analysis

βœ… Goal 3: Compound Design & Optimization

  • Scored compounds against target profiles
  • Performed multi-objective optimization
  • Applied global optimization (differential evolution)
  • Generated design recommendations

πŸš€ Production Deployment

Docker

FROM python:3.11-slim
# Simple deployment - no complex compilation needed

GKE

  • Kubernetes manifests in k8s/
  • Resource management and health checks
  • Persistent storage for data

Benefits

  • βœ… Simpler deployment (no complex compilation)
  • βœ… Faster builds (no AMICI/pyPESTO compilation)
  • βœ… Easier maintenance (standard Python libraries)
  • βœ… Production ready (works in any environment)

πŸ“ Repository Structure

PKPD/
β”œβ”€β”€ src/pkpd/           # Core platform code
β”œβ”€β”€ configs/            # Configuration files
β”œβ”€β”€ scripts/            # CLI scripts
β”œβ”€β”€ notebooks/          # Jupyter notebooks
β”œβ”€β”€ tests/              # Unit tests
β”œβ”€β”€ k8s/                # Kubernetes manifests
β”œβ”€β”€ data/               # Data directory (git-ignored)
β”œβ”€β”€ models_artifacts/   # Model artifacts (git-ignored)
β”œβ”€β”€ Dockerfile          # Production Docker image
β”œβ”€β”€ environment.yml     # Conda environment
└── pyproject.toml      # Python dependencies

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details.

πŸŽ‰ Status

βœ… PRODUCTION READY

All three goals achieved using working libraries and SciPy alternatives. No complex dependencies needed - the platform is fully functional and ready for production deployment!

About

PKPD Platform: Pharmacokinetics, Pharmacodynamics, and Toxicity Prediction using SciPy alternatives

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages