TMDD#
Running#
The structsearch tool is available both in Pharmpy/pharmr.
The code to initiate structsearch for a TMDD model in Python/R is stated below:
from pharmpy.modeling import read_model
from pharmpy.tools read_modelfit_results, run_structsearch
start_model = read_model('path/to/model')
start_model_results = read_modelfit_results('path/to/model')
res = run_structsearch(type='tmdd',
model=start_model,
results=start_model_results)
from pharmpy$tools read_modelfit_results, run_structsearch
start_model <- read_model('path/to/model')
start_model_results <- read_modelfit_results('path/to/model')
res <- run_structsearch(type='tmdd',
model=start_model,
results=start_model_results)
Arguments#
The arguments of the structsearch tool for TMDD models are listed below.
Mandatory#
Argument |
Description |
---|---|
|
Type of model. In this case “tmdd”. |
|
PK start model. |
|
ModelfitResults of the start model. |
Optional#
Argument |
Description |
---|---|
|
Strictness criteria for model selection. Default is “minimization_successful or (rounding_errors and sigdigs>= 0.1)”. Optional. |
|
Extra model for TMDD structsearch. Optional. If specified, 8 additional QSS models will be generated. |
|
ModelfitResults object for the extra model for TMDD structsearch.
Optional if |
|
Dictionary of DV types for multiple DVs (e.g. dv_types = {‘target’: 2}). Allowed keys are: ‘drug’, ‘target’, ‘complex’, ‘drug_tot’ and ‘target_tot’. Optional. Default is None which means that all observations are treated as drug observations. |
Models#
Implemented target mediated drug disposition (TMDD) models are:
Full model
Irreversible binding approximation (IB)
Constant total receptor approximation (CR)
Irreversible binding and constant total receptor approximation (CR+IB)
Quasi steady-state approximation (QSS)
Wagner
Michaelis-Menten approximation (MMAPP)
Full model:#
IB model:#
CR model:#
CR + IB model:#
QSS model:#
Wagner model:#
MMAPP model:#
DV types#
The dv_types
argument is a dictionary specifiying the DVs. If dv_types
is not specified then all
observations are treated as drug observations.
There are five types implemented: ‘drug’ (free drug), ‘target’, ‘complex’, ‘drug_tot’ (total drug) and ‘target_tot’
(total target).
Only ‘drug’ and ‘drug_tot’ can have dv=1.
Example 1:
dv_types = {'drug':1, 'target':2, 'complex':3}
In this case the drug has dv=1, the target has dv=2 and complex has dv=3:
Example 2:
dv_types = {'target':2, 'complex':3}
This is equivalent to the previous example. Per default drug has dv=1.
Example 3:
dv_types = {'target_tot':3, 'complex':2}
The dv types can be arranged in any possible order.
Structsearch workflow#
There are two workflows for the structsearch tool for TMDD models, depending on whether the tool is used separately or inside the AMD tool. If used as a standalone tool, the structsearch workflow is as follows:
Create 8 QSS models for the input model and optionally additional 8 QSS models for the extra model if specified.
Find best QSS model of the 8(16) QSS models
Create 4 full models, 2 CR+IB models, 1 Wagner model, 2 CR models, 2 IB models and 1 MMAPP model. Use parameter estimates from the best QSS model as initial estimates for the generated models.
Find the best model of these 12 models.
When used inside the AMD tool:
Perform modelsearch
Get the final model of the modelsearch and a model with the same features as the final model but with one less peripheral compartment if one such model exists.
Create 8 QSS models for the final model and 8 QSS models for the final model minus one compartment if it exists. Otherwise only 8 QSS models are created.
Find best QSS model of the 8(16) QSS models
Create 4 full models, 2 CR+IB models, 1 Wagner model, 2 CR models, 2 IB models and 1 MMAPP model. Use parameter estimates from the best QSS model as initial estimates for the generated models.
Find the best model of these 12 models.
Results#
The results object contains various summary tables which can be accessed in the results object, as well as files in .csv/.json format. The name of the selected best model (based on the input selection criteria) is also included.
Below is an example for a TMDD run.
res = run_structsearch(type='tmdd',
model=start_model,
results=start_model_results)
res <- run_structsearch(type='tmdd',
model=start_model,
results=start_model_results)
The summary_tool
table contains information such as which feature each model candidate has, the difference to the
start model (in this case comparing BIC), and final ranking:
description | n_params | d_params | dbic | bic | rank | parent_model | |
---|---|---|---|---|---|---|---|
model | |||||||
structsearch_run1 | FULL1 | 13 | 1 | 14.679076 | 4243.302405 | 1.0 | QSS2 |
structsearch_run2 | FULL2 | 13 | 1 | 14.679069 | 4243.302412 | 2.0 | QSS2 |
structsearch_run5 | CR1 | 12 | 0 | 10.987197 | 4246.994284 | 3.0 | QSS2 |
QSS2 | QSS2 | 12 | 0 | 0.000000 | 4257.981481 | 4.0 | QSS2 |
structsearch_run11 | WAGNER | 11 | -1 | -31.897162 | 4289.878642 | 5.0 | QSS2 |
structsearch_run9 | CR+IB1 | 11 | -1 | -97.201724 | 4355.183204 | 6.0 | QSS2 |
structsearch_run7 | IB1 | 12 | 0 | -97.201728 | 4355.183209 | 7.0 | QSS2 |
structsearch_run12 | MMAPP | 12 | 0 | -103.284581 | 4361.266061 | 8.0 | QSS2 |
structsearch_run3 | FULL3 | 13 | 1 | NaN | NaN | NaN | QSS2 |
structsearch_run4 | FULL4 | 13 | 1 | NaN | NaN | NaN | QSS2 |
structsearch_run6 | CR2 | 12 | 0 | NaN | NaN | NaN | QSS2 |
structsearch_run8 | IB2 | 12 | 0 | NaN | NaN | NaN | QSS2 |
structsearch_run10 | CR+IB2 | 11 | -1 | NaN | NaN | NaN | QSS2 |
Examples#
Run TMDD for multiple DVs:
from pharmpy.modeling import read_model
from pharmpy.tools read_modelfit_results, run_structsearch
start_model = read_model('path/to/model')
start_model_results = read_modelfit_results('path/to/model')
res = run_structsearch(type='tmdd',
model=start_model,
results=start_model_results,
dv_types={'drug': 1, 'target': 2, 'complex': 3})
from pharmpy$tools read_modelfit_results, run_structsearch
start_model <- read_model('path/to/model')
start_model_results <- read_modelfit_results('path/to/model')
res <- run_structsearch(type='tmdd',
model=start_model,
results=start_model_results,
dv_types=list('drug'=1, 'target'=2, 'complex'=3))
Note: “drug” can be omitted in dv_types
. In this case it will be set to 1.