OrgPad logo

Pharmacolibrary - DPH day 2025

Created by Tomas Kulhanek

pharmacolibrary

#modelica, #pharmacolibrary

Pharmacolibrary - DPH day 2025

Modeling Pharmacology Pharmacolibrary - Free Library to Model Pharmacology

Tomáš Kulhánek123, Filip Ježek24, Jiří Kofránek23

Marek Mateják25, Stef Romes1

1Flemish Institute of Technology and Research (VITO), Mol, BE

21st Faculty of Medicine, Charles University, Prague, CZ

3Creative Connections s.r.o, Prague, CZ

4University of Michigan, Ann Arbor, USA

5Institute of Clinical end Experimental Medicine, Prague, CZ

1st prize award for best library @ Modelica conference 2025

IMG 0131

Institute of Pathophysiology

image

Creative Connections

small spin off company

innovation grants from proof of concept to pilot and pre-commercial validation

contract research

VITO

Flemish Institute for Technological Research

Mol, Belgium

Environmental unit

Digital Precision Health group

RAIDO

image

PRIBE - personal reference intervals

brave ZR8tgl5Xml

DigiTwin4PH - PGx digital twin

image

ONCOSCREEN

image

Pharmacology

Pharmacokinetics (PK) body → drug

Pharmacodynamics (PD) drug → body

Pharmacogenomics (PGx) genetics→drug&body

pharmacokinetics(PK): body → drug

Administration(absorption), Distribution, Metabolism, Elimination(excretion)image

standard Modelica language

image

image

Commercial tools:

imageDymola,image

image

, …

Open-source:

image

standard Modelica library 4.0.0

image

custom libraries for specific domains

Physiolibrary 1.0.0 won 1st library award at Modelica conference 2014

Chemical 1.0.0 won 1st library award at Modelica conference 2015

Chemical 2.0

modeling physical chemistry

image

Physiolibrary 3.0.0

www.physiolibrary.orgimage

Dymola qmDZxxtrfj

Physiomodel

firefox SHzAoizS4q

Complex model of physiology in Modelica and Physiolibrary

https://physiomodel.org

hemodynamics of cardiovascular system

Dymola 9CIA5zGnUy

respiration

Dymola sdXGmJf24o

blood-gas exchange

Dymola qmDZxxtrfj

why Modelica?

model of complex system may lead to implementation errors

 

image

A C Guyton, T G Coleman, H J Granger, Circulation: overall regulation, Annu Rev Physiol.1972;34:13-46.doi: 10.1146/annurev.ph.34.030172.000305.

Correction of schema after reimplementation in 2010

image

J.Kofránek, et al., Restoration of Guyton‘s Diagram for Regulation of the Circulation ...Physiol Res. 2010;59(6):897-908.doi: 10.33549/physiolres.931838.

Guyton's original scheme part of circulatory dynamics

image

equivalent implementation in component and acausal modeling language

image

Frank-Starling law is  much more visible in component model - "force of the heart muscle depends on pressure of incoming blood". 

Readability & Plausability

small models - equation based

VirtualBoxVM 4UK0GmE2mR

medium/complex models- composition of smaller models as components (icons) in diagrams

Dymola 9CIA5zGnUy

connectors

image

Administration (absorption) - route

parenteral (e.g. intravenous, intraarterial (rare), main parameters: F bioavailability (almost 100%)adminMass, adminDuration):

image

enteral (e.g. oral, main parameters: F bioavailability, adminMass, Tlag, ka absorption rate)

image

Administration (absorption kinetics)

instanteous (e.g. intravenous, intraarterial, main parameters: bolus injection adminMass):

image

Zero-order (e.g. continuous infusion, main parameter: adminDuration):

image

First-order (rate proportional to the amount of drug remaining to be absorbed, main parameters:  adminMass, ka (absorption rate))

image

Distribution

simplified - ideal mixing, no volume flow rate, compartment (Vd volume of distribution)

image

q_m =\frac{dM}{dt}

c=\frac{M}{V_d}

and 1st order kinetics

image

q_m=Cl_a*c_a-Cl_b*c_b

Distribution - physiology based

compartment - with concentration mixing based on volumetric flow through organs and tissues:

image

\frac{dM}{dt} = q_{v_{a}}*actualStream(c_a)+q_{v_{b}}*actualStream(c_b)+q_m

fixed volumetric flow component:

image

Metabolism

generally, first pass

active drug → inactive drug (paracetamol)

inactive drug → active drug (aspirin)

active drug → more active drug

make drug more toxic (ethanol)

make drug more water soluble

1st order kinetics between compartments

image

paracetamol

acetaminophen → sulfate_conjugate

for more complex - use Chemical library (https://www.physiolibrary.org

Elimination

via kidney or liver using clearance rate Cl

image

q_m=Cl*c

computed half life

t_{1/2} = \frac{ln(2) \times V_d}{Cl}

1-compartment PK model

c = c_0 \times e^{-Cl.t}

or derivative form:

c=\frac{M}{V_d}

\frac{dM}{dt} = - Cl \times c

1-compartment PK model in Modelica (text variant)

image

1-compartment PK model in component diagram

equations are behind each component

image

connecting components → equations among variables

compartment

image

q_m =\frac{dM}{dt}

c=\frac{M}{V_d}

elimination

image

q_m=Cl*c

connectors

image

qm_1 +qm_2 = 0\

c_1 = c_2

1-compartment model

image

parameters for intravenous administration of gentamicin, type of antibiotic against bacterial infections

equivalent 1-compartment model (in equations)

VirtualBoxVM 4UK0GmE2mR

gentamicin - 1 day simulation

image

gentamicin - 1 day simulation logscale

pk 1c simlog

2-compartment model

image

parameters for intravenous administration of midazolam, a short-acting benzodiazepine used for sedation, anesthesia, ...

midazolam - 12 h simulation

image

logscale - 12h simulation

image

logscale - 12h with peripheral

pk2csimlog

3-compartment model

image

fentanyl - 10h simulation

image

fentanyl - 10h simulation logscale

pk3csim

physiology based

compartment takes physiological features into account

PBPK model

image

PBPK simulation

image

5496 models of drugs by Anatomical Therapeutical Chemical (ATC) classification - knowledge base extracted and combined from Pubmed, Drugbank using LLM

image

ATC level 1

image

ATC level 3

image

ATC level 5

image

Drug model variants

image

caffeine

image

1-compartment model - caffeine

image

1 cup = 100 mg of caffeine in 8 hours

caffeine in 24 hours

image

pharmacodynamics (PD): drug → body

What effect has a drug to body

linear effect

effectlin

image

Emax effect

effectemax

image

sigmoid Emax effect

effectsigmoid

image

irreversible effect

time dependent (R response, C concentration, k rate of irreversible effect)

\frac{dR}{dt}=-k\times C\times R

with recovery growth factor ks

\frac{dR}{dt}=k_s \times R - k\times C\times R

PK PD model Midazolam on EEG activity

image

midazolam

PK PD simulation

image

PK PD model digoxin on hemodynamics of cardiovascular system

PKPD HemodynamicsMeurs flatNorm

PK PD simulation

pkpd sim1

pkpd sim2

pkpd sim4

pkpd sim3

pressure volume (PV) diagram

image

PV shift from right to left → less maximal volume, slight increase in systolic pressure.

Digoxin is a cardiac glycoside derived from the foxglove plant Digitalis lanata. It is primarily used in the treatment of various heart conditions, notably atrial fibrillation, atrial flutter, and sometimes heart failure that cannot be controlled by other medications. Digoxin is approved and widely used in clinical practice today.

Pharmacogenomics (PGx)

What is individual variability of PK and PD based on genotype and phenotype?

genotype

image

phenotype

image

SLC22A2

image

OTC2_phenotype

image

alleles

*1, *1

808T, *1

clearance

normal

intermediate

CYP2C19

image

CYP2C19_phenotype

image

alleles

*1, *1

*2, *1

*17, *1

metabolizer

normal

poor

rapid

PK PGx model

image

gentamicin

PK PGx simulation (gentamicin)

image

population PGx model

pgmodelexperiment

population PGx simulation

pkpgx experiment sim

optimal dose of lithium carbonate

brave OZ24t5RrJ2

https://egolem.online/pharma 

iron metabolism visualisation

brave 5rh0hlzHNL

eGolem                           powered by                        bodylight.js

https://egolem.online/irm/                               https://bodylight.physiome.cz

howto find a drug

VirtualBoxVM quF8UzRISk

workflow - 1. export model to FMI unit 2. simulate in Python & fmpy & 3. get data from external data (PK-DB.com) 4. compare/fit/...

VirtualBoxVM TIsoOjFLH2

CA125 concentration based on tumor growth, interactive simulator - change growth factor (logistic function) and CA125 production rate

Conclusion

Pharmacolibrary: https://github.com/creative-connections/Pharmacolibrary

pharmacokinetic: 5496 drugs models - most generated

pharmacodynamics: various effects

pharmacogenomics: various genotype/phenotype influence

current and future research and development: contribute to democratize pharmacology knowledge, use PBPK for quantitative in vitro to in vivo extrapolation (QIVIVE), validate PK models of drugs, add PK of dietary supplements and toxicokinetics of chemicals, cover published PD and common pharmacogenes,

Pharmacolibrary / GITHUB

https://github.com/creative-connections/Pharmacolibrary

image

acknowledgment

image

ONCOSCREEN project, funded by the European Union’s Horizon Europe grant No. 101097036.

subaward to R01 HL173346. funded by NIH

co-simulation of multiple models via FMI in static web app with bodylight.js

iimage

https://egolem.online/demo/

comprehensibility

Pharmacolibrary 25.06 (beta)

connectors and components:

image

effects

PGx

40-50 pharmacogenes commercially  available in testing panels

majority cytochrome P450 enzymes ( CYP2D6,CYP2C19,...)