This repository contains code and data for Build AI Drug Discovery Pipelines (Manning Publications). The companion material within this repository covers introductory topics at the intersection of machine learning, deep learning, and drug discovery applied to real world scenarios in each chapter. The code and notebooks are released under the Apache 2.0 license.
For readability, the chapter notebooks only contain runnable code blocks and section titles. They omit the rest of the material in the book, i.e., text paragraphs, figures (unless generated as part of one of the code blocks), equations, and pseudocode. If you want to be able to follow what's going on, I recommend reading the notebooks side-by-side with your copy of the book!
Encounter any issues? Please let me know -- I can't fix a problem if I am not aware of its existence!
- Chapter 1: The Drug Discovery Process
- Chapter 2: Ligand-based Screening: Filtering & Similarity Searching
- Chapter 3: Ligand-based Screening: Machine Learning
- Chapter 4: Solubility Deep Dive with Linear Models
- Chapter 5: Classification: Cytochrome P450 Inhibition
- Chapter 6: Case Study: Small Molecule Binding to an RNA Target
- Chapter 7: Unsupervised Learning: Repurposing Drugs, Curating Compounds, & Screening Fragments
- Chapter 8: Introduction to Deep Learning
- Chapter 9: Structure-based Drug Design with Active Learning
- Chapter 10: Generative Models for De Novo Design
- Chapter 11: Graph Neural Networks for Drug Target Affinity Prediction
- Chapter 12: Transformer Architectures for Protein Structure Prediction
- Chapter 13: Multimodal AI Systems for End-to-End Drug Discovery Pipelines
- Appendix A: Glossary
- Appendix B: Chemical Data Repositories
- Appendix C: Knowledge Distillation: Shrinking Models for Efficient, Hierarchical Molecular Generation
- Appendix D: Technical Deep Dive into Protein Structure Prediction
- Appendix E: Extended Technical Material
- Appendix F: Chapter References
- Appendix G: Chapter Exercises
- Appendix H: Computational Drug Target Discovery
- Appendix I: Diffusion & Flow Matching with FlowMol3, DiffSBDD, RFdiffusion, & Boltz-2
Open any notebook in Colab and run the installation cells at the top!
Each notebook includes a Colab install cell that pip-installs only the packages that chapter needs (3-10 minutes). Chapter 9 is the exception: its docking stack needs conda-only tools, so it uses a conda install cell on Colab.
Prerequisites: git and Python 3.12 — uv installs and manages the interpreter for you.
# Install uv if needed: curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/nrflynn2/ml-drug-discovery.git
cd ml-drug-discovery
uv venv --python 3.12 && source .venv/bin/activate # Windows: .venv\Scripts\activateWe provide tiered installs so you install only what a chapter needs:
| Tier | Chapters | Command |
|---|---|---|
| Core — basic ML & QSAR | 1–4 | uv sync |
| Advanced — boosting, deep learning, GNNs | 5–8, 10, 11, Appendix C | uv sync --extra advanced |
| Full — + pip-installable docking/MD helpers | adds Chapter 9 helpers | uv sync --extra full |
Chapter 9 additionally needs conda-only tools (openmm, vina, pdbfixer):
conda env create -f ml4dd2025.yml && conda activate ml4dd2025Chapter 12 is a self-contained package — see CH12_FLYNN_ML4DD/.
Prefer classic pip? pip install -e ".[advanced]" works too. For detailed instructions and troubleshooting, see INSTALL.md.
Feel free to contribute, raise issues, or propose enhancements to make this repository a comprehensive resource for everyone venturing into machine learning, drug discovery, and related applications.
If you wish to cite the book, you may use the following:
@book{flynn2025mldd,
title={Build AI Drug Discovery Pipelines},
author={Flynn, N.},
isbn={9781633437661},
url={https://www.manning.com/books/build-ai-drug-discovery-pipelines},
year={2025},
publisher={Manning Publications}
}