Skip to content

Releases: creative-connections/Pharmacolibrary

v26.03-beta2

12 Mar 23:00

Choose a tag to compare

Changed icons, fixed minor bugs, added some other examples

Full Changelog: v25.08...v26.03-beta2

v26.03-beta1

12 Mar 22:43

Choose a tag to compare

v26.03-beta1 Pre-release
Pre-release

Full Changelog: v25.08...v26.03-beta1

v25.08

29 Jul 18:28

Choose a tag to compare

Pharmacolibrary is a reusable Modelica library unifying pharmacokinetic, pharmacodynamic, toxicokinetic, toxicodynamic, and pharmacogenomic constructs with standardized pharmacological terminology, units, and acausal connectors.

Instruction

  • download release ZIP file or clone repository using git clone https://github.com/creative-connections/Pharmacolibrary
  • open Modelica tool, e.g. OpenModelica or Dymola
    • inside the tool, File -> Open Model/Library File
    • select Pharmacolibrary/package.mo

except standard Modelica library, no other dependencies are needed

  • Open Examples
    • each model in Examples package shows some feature on concrete model of drug pharmacokinetic, pharmacodynamic and pharmacogenomic. Sample model with complex physiologically based model is also shown.

Release notes

  • documentation and overview of packages
  • fix examples to work in Dymola, tested in OpenModelica
  • refactored Drugs/Common/DrugData to include extracted information from pubchem and drugbank
  • added PGx examples, PKPD with Physiolibrary example model
  • shortened Drug ATC level names to prevent 'long name' error on Windows platform
  • added models of some unclassified drugs

v25.07

07 Jul 16:15

Choose a tag to compare

Pharmacolibrary is a reusable Modelica library unifying pharmacokinetic, pharmacodynamic, toxicokinetic, toxicodynamic, and pharmacogenomic constructs with standardized pharmacological terminology, units, and acausal connectors.

Instruction

  • download release ZIP file or clone repository using git clone https://github.com/creative-connections/Pharmacolibrary
  • open Modelica tool, e.g. OpenModelica or Dymola
    • inside the tool, File -> Open Model/Library File
    • select Pharmacolibrary/package.mo

except standard Modelica library, no other dependencies are needed

  • Open Examples
    • each model in Examples package shows some feature on concrete model of drug pharmacokinetic, pharmacodynamic and pharmacogenomic. Sample model with complex physiologically based model is also shown.

Release notes

  • shortened Drug ATC level names to prevent 'long name' error on Windows platform
  • added models of some unclassified drugs

PK, PD, PGx library with pregenerated basic PK of all registered drugs.

16 Jun 16:48

Choose a tag to compare

Pharmacolibrary is a reusable Modelica library unifying pharmacokinetic, pharmacodynamic, toxicokinetic, toxicodynamic, and pharmacogenomic constructs with standardized pharmacological terminology, units, and acausal connectors.

Instruction

  • download release ZIP file or clone repository using git clone https://github.com/creative-connections/Pharmacolibrary
  • open Modelica tool, e.g. OpenModelica or Dymola
    • inside the tool, File -> Open Model/Library File
    • select Pharmacolibrary/package.mo

except standard Modelica library, no other dependencies are needed

  • Open Examples
    • each model in Examples package shows some feature on concrete model of drug pharmacokinetic, pharmacodynamic and pharmacogenomic. Sample model with complex physiologically based model is also shown.

Pregenerated drugs model and info

07 Jun 04:05

Choose a tag to compare

This release adds pregenerated Drugs model and information.

The Drugs package contains pharmacology models of all drugs classified by anatomical therapeutical chemical (ATC) codes. In 06/2025 there were 5496 unique records at ATC level 5 corresponding to 4363 distinct chemical substances.

The drugs in this package are organized as follows:

Common
contains records of molecular information about each drug as Common.DrugData.{ATC_code}

ATC
contains generated basic models based on ATC code as ATC.{ATC_first_level}.{ATC_code}

E.g.:
paracetamol has ATC code N02BE01, the corresponding model is ATC.N.N02BE01

remdesivir has ATC code J05AB16, the corresponding model is ATC.J.J05AB16

All drugs are also organized using ATC level 1 and ATC level 3 by including name and code for manual filtering. All pregenerated models extends from ATC.{ATC_first_level}.{ATC_code} model. All subsequent manually curated models may extend or may use different parameters or model structure as documented individually. The models are organized as
{ATC_first_level_code}.{ATC_third_level_code}.{ATC_code}_{drug_name}.{drug_name}

So e.g. paracetamol is at N_NervousSystem. N02B_OtherAnalgesicsAndAntipyretics. N02BE01_Paracetamol. Paracetamol

ATC code for first level are as follows:
A ALIMENTARY TRACT AND METABOLISM
B BLOOD AND BLOOD FORMING ORGANS
C CARDIOVASCULAR SYSTEM
D DERMATOLOGICALS
G GENITO URINARY SYSTEM AND SEX HORMONES
H SYSTEMIC HORMONAL PREPARATIONS, EXCL. SEX HORMONES AND INSULINS
J ANTIINFECTIVES FOR SYSTEMIC USE
L ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS
M MUSCULO-SKELETAL SYSTEM
N NERVOUS SYSTEM
P ANTIPARASITIC PRODUCTS, INSECTICIDES AND REPELLENTS
R RESPIRATORY SYSTEM
S SENSORY ORGANS
V VARIOUS

References:

  • [1] Kim, Sunghwan, et al. "PubChem substance and compound databases." Nucleic acids research 44.D1 (2016): D1202-D1213.
  • [2] Knox, Craig, et al. "DrugBank 6.0: the DrugBank knowledgebase for 2024." Nucleic acids research 52.D1 (2024): D1265-D1275.

v25.05

26 May 07:23
bb02150

Choose a tag to compare

Pharmacolibrary

working version of library to support modeling pharmacology in Modelica.

Instruction

  • open Modelica tool, e.g. OpenModelica[1] or Dymola[2]
    • inside the tool, File -> Open Model/Library File
    • select Pharmacolibrary/package.mo

except standard Modelica library, no other dependencies are needed

  • Open Examples
    • each model in Examples package shows some feature on concrete model of drug pharmacokinetic, pharmacodynamic and pharmacogenomic. Sample model with complex physiologically based model is also shown.

Modeling

Pharmacolibrary is a reusable Modelica library unifying Pharmacokinetic, pharmacodynamic, toxicokinetic, toxicodynamic, and pharmacogenomic constructs with standardized pharmacological terminology, units, and acausal connectors.
The following acausal connectors are available and reused in library:
domain potential
variables
flow
variables
stream
variables
connector definition icons
chemical
concentration
mass concentrationmass flow rate Pharmacolibrary.Interfaces 
ConcentrationPort, ConcentrationPort_a, ConcentrationPort_b
volumetric
flow
pressurevolume flow rate mass concentration Pharmacolibrary.Interfaces 
FlowPort, FlowPort_a, FlowPort_b

Pharmacolibrary focuses it's components into these main pharmacological phenomena:

Library Domain

Description

Pharmacokinetic

Pharmacokinetic (PK) can model kinetic and toxicokinetic in terms of absorption, distribution, metabolism, elimination of a drug.

2 main approaches exists:

  1. compartmental models (1-compartment, 2-compartment, multi compartment models) - neglects cardiac output and simplifies tissue distribution. Most commonly published with these parameters:
    • m [mg] drug dose administered (Dose component)
    • F [0-1] bioavailability (Dose component)
    • Vd [l] volume of distribution (Compartment component)
    • Cl [l/min] elimination/intercompartmental clearance (Elimination component)
  2. PBPK models combines compartments with physiological based models, e.g. circulation.

Pharmacodynamic

Pharmacodynamic (PD) can model dynamic effect of a drug on target tissue or cells. Main components are Effect (LinearEffect, EmaxEffect,SigmoidEmaxEffect) that translates from drug concentration into a generic effect quantity.

Pharmacogenomic

Pharmacogenomic (PGx) can model dynamic influence of Genotype/Phenotype by altering parameters of PK/PD absorption, clearance, metabolism and effect.

Drugs

Drugs

Drugs library contains selected PK, PD, PG models organized by ATC index using 1'st level fourteen main anatomical/pharmacological groups and 2nd level pharmacological or therapeutic groups. Subsequent groups are not used and direct ATC code with drug name as package contains various basic or advanced models.

Simulation outside Modelica - integration to computational workflow in Python

  • got so sim directory
cd sim/
  • and prepare virtual env in Python
    python -m venv venv
    source venv/bin/activate
  * install requirements as specified in `requirements.txt` file
```bash
pip install -r requirements.txt
  • start jupyter
jupyter lab
  • jupyter opens in a browser interactive interface, open notebook PK_2C_IVMidazolam.ipynb
  • the demo contains exported 2-compartment model of Midazolam administered intravenously in FMI, its usage with fmpy library and integration with pharmacokinetic database containing growing number of human and machine readable data of drugs from https://pk-db.com

Simulator

Live sample web simulator at: https://egolem.online/pharma

v25.05-beta.3

02 May 07:36

Choose a tag to compare

Pharmacolibrary

working version of library to support modeling pharmacology in Modelica.

Instruction

  • open Modelica tool, e.g. OpenModelica[1] or Dymola[2]
    • inside the tool, File -> Open Model/Library File
    • select Pharmacolibrary/package.mo

except standard Modelica library, no other dependencies are needed

  • Open Examples
    • each model in Examples package shows some feature on concrete model of drug pharmacokinetic, pharmacodynamic and pharmacogenomic. Sample model with complex physiologically based model is also shown.

Integration to computational workflow

  • open notebook sim/PK_2C_IVMidazolam.ipynb in Jupyter or Jupyterlab environment
  • the demo contains exported 2-compartment model of Midazolam administered intravenously in FMU, its usage with fmpy library and integration with pharmacokinetic database containing growing number of human and machine readable data of drugs https://pk-db.com

Simulator

Live sample web simulator at: https://egolem.online/pharma

[1] https://openmodelica.org/
[2] https://www.3ds.com/products/catia/dymola

v25.05-beta.2

01 May 13:58

Choose a tag to compare

Added Pharmacogenomics part into library and fine tune examples

v25.04-beta.1

08 Apr 14:15

Choose a tag to compare

First beta version of PK PD library. PK compartment models and examples are functioning, PBPK models needs review. PD example models missing.