This repository contains code for emulating Quantitative Systems Pharmacology (QSP) model using machine learning methods.
This code was written and teste on python 3.10. To reproduce environment please install python 3.10 and install requirements using pip:
$ pip install -r requirements.txt
The list of direct project dependencies is stored in requirements.in
file.
Generation of fata point require R interpreter and deSolve
package.
We have prepared environment.yml
file with both python and R dependencies.
Base on your preference for conda
or mamba
you can install all dependencies using one of the following commands.
To install all dependencies using conda
please run:
$ conda env create --file=environment.yml -n qsp_emulation
To install all dependencies using mamba
please run:
$ mamba env create --file=environment.yml -n qsp_emulation
Because of performance we suggest to use mamba
instead of conda
.
The environment_freeze.yml
file contains mamba env export
output to recreate environment in
a exactly the same version, but it also contains Linux specific packages.
The code is split to six parts. All notebooks are stored in notebooks
folder.
01. Generating training dataset (1M patients) using QSP.ipynb
- generates a training dataset of 1000000 patients using QSP model implemented in R language.02. Training ML models.ipynb
- trains and evaluates Machine Learning (ML) model emulators on generated dataset.03. Hand-adjusting params and selecting best PCA value.ipynb
- trains and evaluates multiple more variants ofMLPRegressor
emulator, which was selected as best performing in notebook 2.04. ML Models learning-curves.ipynb
- presents comparison of learning curves of best performing models trained in notebook 2.05. Best model evaluation.ipynb
- visualizes the absolute and relative error of the best performing emulator06. Fitting population params.ipynb
- shows the use case of the emulator, by fitting population params to match waterfall plots of virtual and clinical trials.