Skip to content

pbpk ids and data

The id scheme, the annotation, the values with provenance, the data files and the units of the PBPK library, see Annotation.

ids

The id scheme of the PBPK models.

Every id of a generated model is built here, so that the organs, the observers and the fits agree on them. A flat id is <ORGAN>__<local id> (LI__Cpl_api), the ids of substances are suffixed by _<substance>.

BW module-attribute

BW = 'BW'

The body weight (covariate).

HEIGHT module-attribute

HEIGHT = 'HEIGHT'

The height (covariate).

AGE module-attribute

AGE = 'AGE'

The age (covariate).

BMI module-attribute

BMI = 'BMI'

The body mass index.

BSA module-attribute

BSA = 'BSA'

The body surface area.

FFM module-attribute

FFM = 'FFM'

The fat-free mass.

HCT module-attribute

HCT = 'HCT'

The hematocrit.

CO module-attribute

CO = 'CO'

The cardiac output.

CO_BASE module-attribute

CO_BASE = 'CO_base'

The cardiac output without impairment, of which the organ flows are fractions.

GFR module-attribute

GFR = 'GFR'

The glomerular filtration rate.

GFR_BASE module-attribute

GFR_BASE = 'GFR_base'

The glomerular filtration rate at renal function 1, of which the renal function is the factor.

VBLOOD module-attribute

VBLOOD = 'Vblood'

The total blood volume.

MLEAN module-attribute

MLEAN = 'Mlean'

The mass of the lean organ tissues without their blood.

SV_TIS module-attribute

SV_TIS = 'SV_tis'

The scaling factor of the lean tissues, the blood and the cardiac output.

QHA module-attribute

QHA = 'Qha'

The hepatic arterial blood flow.

QPO module-attribute

QPO = 'Qpo'

The portal venous blood flow.

QH module-attribute

QH = 'Qh'

The total liver blood flow.

F_RENAL_FUNCTION module-attribute

F_RENAL_FUNCTION = 'f_renal_function'

The renal function relative to normal.

F_CARDIAC_FUNCTION module-attribute

F_CARDIAC_FUNCTION = 'f_cardiac_function'

The cardiac function (cardiac output) relative to normal.

F_SHUNT module-attribute

F_SHUNT = 'f_shunt'

The portosystemic shunt: the fraction of the liver inflow which bypasses the liver.

F_FUNCTIONAL module-attribute

F_FUNCTIONAL = 'f_functional'

The functional fraction of the liver tissue.

F_TUBULAR module-attribute

F_TUBULAR = 'f_tubular'

The share of the tubular capacity of the kidney which follows the renal function.

CP_SEVERITY module-attribute

CP_SEVERITY = 'CP_severity'

The severity of liver cirrhosis: 0 healthy, 1, 2, 3 the Child-Pugh classes A, B, C.

HF_SEVERITY module-attribute

HF_SEVERITY = 'HF_severity'

The severity of heart failure: 0 healthy, 1 to 4 the NYHA classes I to IV.

CKD_HEPATIC module-attribute

CKD_HEPATIC = 'CKD_hepatic'

The switch (0 off, 1 on) of the hepatic changes of chronic kidney disease.

EGFR module-attribute

EGFR = 'eGFR'

The GFR per 1.73 m2 body surface area of the renal function, which gives the CKD stage.

F_ZONE module-attribute

F_ZONE = 'f_zone'

The volume fraction of a zone of a zonated organ, 1/n of n zones.

VBILE module-attribute

VBILE = 'Vbile'

The volume of the bile, the compartment of Cbile_<s>.

VURINE module-attribute

VURINE = 'Vurine'

The compartment of the urine amounts Aurine_<s>.

VLUMEN module-attribute

VLUMEN = 'Vlumen'

The local volume of the single intestinal lumen, the compartment of Clumen_<s>.

VFECES module-attribute

VFECES = 'Vfeces'

The compartment of the feces amounts Afeces_<s>.

K_BILE module-attribute

K_BILE = 'k_bile'

The rate of the transit of the bile into the intestinal lumen.

T_LUMEN module-attribute

T_LUMEN = 't_lumen'

The local transit time of the single intestinal lumen into the feces.

FED module-attribute

FED = 'FED'

The prandial state, 0 fasted (default) and 1 fed: it slows the gastric emptying.

GUT module-attribute

GUT = 'GU'

The id of the submodel of the intestine (the small intestine, or the segmented and single lumen intestine, which replace small and large intestine), the prefix of the hand-written models GU__.

GUT_VOLUME module-attribute

GUT_VOLUME = 'Vgu'

The local volume of the intestine which replaces small and large intestine, Vsi + Vla.

GUT_VASCULAR_FRACTION module-attribute

GUT_VASCULAR_FRACTION = 'f_vas_gu'

The local vascular fraction of the intestine of small and large intestine.

GUT_INTERSTITIAL_FRACTION module-attribute

GUT_INTERSTITIAL_FRACTION = 'f_int_gu'

The local interstitial fraction of the intestine of small and large intestine.

GUT_FLOW module-attribute

GUT_FLOW = 'Qgu'

The local blood flow of the intestine of small and large intestine, Qsi + Qla.

GUT_WALL_FLOW module-attribute

GUT_WALL_FLOW = 'Qgu_wall'

The local blood flow of the intestinal wall past the mucosa, Qgu - Qmu_total.

MUCOSA_FLOW_TOTAL module-attribute

MUCOSA_FLOW_TOTAL = 'Qmu_total'

The local blood flow of the mucosa of all segments.

MUCOSA_VOLUME_TOTAL module-attribute

MUCOSA_VOLUME_TOTAL = 'Vmu_total'

The local volume of the mucosa of all segments.

WALL_FRACTION module-attribute

WALL_FRACTION = 'f_wall'

The local fraction of the intestinal tissue without the mucosa, 1 - Vmu_total/Vti.

F_MUCOSA_VOLUME module-attribute

F_MUCOSA_VOLUME = 'f_mucosa_volume'

The local fraction of the intestinal tissue which is mucosa.

F_MUCOSA_FLOW module-attribute

F_MUCOSA_FLOW = 'f_mucosa_flow'

The local fraction of the intestinal blood flow which perfuses the mucosa.

T_STOMACH_FED module-attribute

T_STOMACH_FED = 'T_st_fed'

The local transit time of the stomach in the fed state.

T_STOMACH module-attribute

T_STOMACH = 'T_st_eff'

The transit time of the stomach which the transit of the stomach reads: of the prandial state (FED, T_st fasted to T_st_fed fed) times the factor of the gastric emptying of chronic kidney disease, a constant of the segmented intestine and its output, an id of the top model (min).

GUT_SEGMENTS module-attribute

GUT_SEGMENTS = (
    "st",
    "du",
    "jej1",
    "jej2",
    "ile1",
    "ile2",
    "cae",
    "asc",
    "tra",
    "des",
    "sig",
    "rec",
)

The lumen segments of the segmented intestine, in the order of the transit: stomach, duodenum, upper and lower jejunum, upper and lower ileum, caecum, colon ascendens, transversum, descendens, sigmoid and rectum.

TUBULE_SEGMENTS module-attribute

TUBULE_SEGMENTS = ('pt', 'lh', 'dt', 'cd')

The tubule segments of the nephron kidney, in the order of the tubular flow: proximal tubule, loop of Henle, distal tubule and collecting duct.

PS_VAS module-attribute

PS_VAS = 'PS_vas'

The local id of the exchange between plasma and interstitium of an organ.

impairment_factor

impairment_factor(pid)

The id of the factor of all impairments on a quantity, fimp_GFR.

The product of the factors of the conditions (Child-Pugh, chronic kidney disease, heart failure) on the quantity pid of the body.

condition_factor

condition_factor(condition, key)

The id of the factor of one condition, fcp_albumin, fckd_hematocrit.

Parameters:

Name Type Description Default
condition str

the condition, cp (Child-Pugh), ckd (chronic kidney disease) or hf (heart failure).

required
key str

the key of the factor in data/impairment.toml, a protein in lower case.

required

impairment_activity

impairment_activity(protein, organ=None)

The id of the factor of the impairments on the activity of a protein in an organ.

In the organ the local input fimp_cyp3a4, in the body fimp_li_cyp3a4; the rates of the protein in the organ run with f_<protein> times it, so that a genotype or an interaction which sets LI__f_cyp3a4 acts on top of the impairment.

ref

ref(pid)

The id of the reference value of a parameter, FFM_ref, Vli_ref.

submodel

submodel(organ)

The id of the submodel of an organ, the organ id in capitals, LI.

The small intestine is the submodel GU (gut) for every intestine variant: the segmented and the single lumen intestine replace small and large intestine with it; with the standard organs as intestine the small intestine is GU and the large intestine LA.

flat

flat(organ, local)

The id of a local id in the flattened model, LI__<local>.

zone

zone(i)

The token of zone i of a zonated organ, z1 (periportal) to z<n>.

compartment

compartment(part, zone=None)

The local id of a compartment of an organ, Vpl; of a zone Vpl_z1.

species

species(part, s, zone=None)

The local id of a species of substance s in a part, Cpl_<s>; of a zone Cpl_z1_<s>.

pool_compartment

pool_compartment(pool, part)

The id of a compartment of a blood pool, Vve_pl.

pool_species

pool_species(pool, s, part=PLASMA)

The id of a species in a blood pool, Cve_<s> (plasma), Cve_bc_<s> (blood cells).

organ_volume

organ_volume(organ)

The id of the volume of an organ, Vli.

organ_flow

organ_flow(organ)

The id of the blood flow of an organ, Qli.

organ_mass

organ_mass(organ)

The id of the tissue mass of an organ without its blood, Mad.

flow_fraction

flow_fraction(organ)

The id of the blood flow of an organ as fraction of cardiac output, fQli.

pool_volume

pool_volume(pool)

The id of the volume of a blood pool, Vve.

pool_fraction

pool_fraction(pool)

The id of the volume of a blood pool as fraction of the blood volume, fVve.

pool_capacity

pool_capacity(pool, s)

The id of the compartment of a pool species of s with erythrocytes in equilibrium.

The pool volume times the blood to plasma ratio, Vve_pl_<s>: the plasma species then holds the amount of the blood.

plasma_capacity

plasma_capacity(s, zone=None)

The local id of the compartment of Cpl_<s> with erythrocytes in equilibrium.

The vascular volume of the organ times the blood to plasma ratio, Vpl_<s> (of a zone Vpl_z1_<s>): the plasma species then holds the amount of the blood.

vascular_fraction

vascular_fraction(organ)

The id of the vascular fraction of the organ volume, f_vas_li.

interstitial_fraction

interstitial_fraction(organ)

The id of the interstitial fraction of the organ volume, f_int_li.

tissue_volume_total_ref

tissue_volume_total_ref(s)

The id of the reference tissue volume of the organs s enters, Vti_total_ref_<s>.

The tissue volume of the reference individual summed over the organs whose exchange is a share of ftissue_<s>; the exchange of an organ is ftissue_<s> * Vti_o / Vti_total_ref_<s>, so it scales with the individual.

ps

ps(s)

The local id of the exchange of s between plasma and tissue, PS_<s>.

ps_ref

ps_ref(s)

The local id of the exchange of the whole healthy liver, PS_ref_<s>.

The exchange of the whole liver in l/min (ps with ps_per_volume=False): the liver has PS_<s> = PS_ref_<s> * f_functional.

kps

kps(s)

The local id of the exchange of s per litre of organ, kps_<s>.

The exchange of an organ given per litre of organ (ps of the distribution with ps_per_volume, 1/min): the organ has PS_<s> = kps_<s> * V<o>.

slow_species

slow_species(s)

The local id of the slow pool of s in the tissue of an organ, Cslow_<s>.

A concentration in the tissue compartment Vti (SlowPool), exposed to the observers as C<o>_slow_<s> (organ_species).

kslow

kslow(s)

The id of the exchange of the slow pool of s per litre of tissue, kslow_<s> (1/min).

kp_slow

kp_slow(s)

The id of the slow pool of s to the tissue at equilibrium, Kpslow_<s>.

slow_reaction

slow_reaction(s)

The local id of the exchange of s between the tissue and its slow pool, J_slow_<s>.

k_int_pls

k_int_pls(s)

The local id of the interstitial to plasma coefficient, K_int_pls_<s>.

k_cell_pls

k_cell_pls(s)

The local id of the intracellular to plasma coefficient, K_cell_pls_<s>.

k_organ

k_organ(s)

The local id of the organ to plasma coefficient (flow-limited), K_or_<s>.

organ_outflow

organ_outflow(organ, s)

The id of the plasma concentration leaving an organ, Cout_li_<s>.

organ_species

organ_species(organ, local)

The id of the top model of an element of an organ which a PD component or an observer reads.

The organ exposes the element as an output, which replaces this parameter of the top model: the organ token follows the prefix of the local id. A concentration C<part>_<s> is C<o>_<part>_<s>, Cli_ic_api for the cells of the liver (LI__Cic_api in the flat model); an unbound concentration Cu_<part>_<s> is Cu_<o>_<part>_<s> (Cu_li_ic_api), the one spelling of the unbound concentration of an organ (the pools keep theirs, C<pool>_free_<s>); an amount A<x> is A<o>_<x> (Asi_solid_du_api).

Raises:

Type Description
ValueError

if the local id is no concentration C... and no amount A....

organ_outflow_bc

organ_outflow_bc(organ, s)

The id of the blood cell concentration leaving an organ, Cout_li_bc_<s>.

Only for a substance with kinetic blood cells.

inflow_reaction

inflow_reaction(pool, part, s)

The local id of the inflow of s from a pool into an organ, J_in_ar_pl_<s>.

part is the part of the blood which carries it, plasma or blood cells.

outflow_reaction

outflow_reaction(part, s)

The local id of the outflow of s from an organ into its pool, J_out_pl_<s>.

shunt_reaction

shunt_reaction(pool, part, s)

The local id of the shunt of s from a pool past the liver, J_shunt_po_pl_<s>.

part is the part of the blood which carries it, plasma or blood cells.

filtration_reaction

filtration_reaction(s)

The local id of the glomerular filtration of s into the urine, J_gfr_<s>.

exchange_reaction

exchange_reaction(part, s, zone=None)

The local id of the passive exchange of s into a part of an organ, J_ti_<s>.

From plasma into the tissue, the interstitium or the blood cells, from the interstitium into the cells (J_ic_<s>); in a zone J_ti_z1_<s>.

sinusoid_reaction

sinusoid_reaction(part, s, zone)

The local id of the flow of s from a zone into the next one, J_sin_z1_pl_<s>.

part is the part of the blood which carries it, plasma or blood cells (the whole organ of a flow-limited substance carries it as plasma).

outflow_conc

outflow_conc(s)

The local id of the concentration leaving an organ, Cout_<s>.

outflow_conc_bc

outflow_conc_bc(s)

The local id of the blood cell concentration leaving an organ, Cout_bc_<s>.

mr

mr(s)

The id of the molecular weight, Mr_<s>.

fu

fu(s)

The id of the unbound fraction in plasma, fu_<s>.

fu_ref

fu_ref(s)

The id of the reference unbound fraction in plasma, fu_ref_<s>.

baseline

baseline(s)

The id of the plasma concentration of an endogenous substance at the start, baseline_<s>.

kp

kp(s)

The id of the tissue to plasma coefficient, Kp_<s>.

kp_organ

kp_organ(organ, s)

The id of the tissue to plasma coefficient of an organ, Kp_li_<s>.

fkp

fkp(s)

The id of the factor of a Kp method or of the interstitial shares, fKp_<s>.

ftissue

ftissue(s)

The id of the whole-body exchange factor, ftissue_<s>.

bp

bp(s)

The id of the blood to plasma ratio, BP_<s>.

kbc

kbc(s)

The id of the blood cell to plasma coefficient, Kbc_<s>.

kbc_exchange

kbc_exchange(s)

The id of the exchange rate between plasma and blood cells, kex_bc_<s>.

fraction_reabsorbed

fraction_reabsorbed(s)

The id of the fraction of the filtrate which is reabsorbed, f_reabsorbed_<s>.

reabsorption_threshold

reabsorption_threshold(s)

The id of the renal threshold of a saturable reabsorption (mM), reab_threshold_<s>.

reabsorption_n

reabsorption_n(s)

The id of the sharpness of the threshold of a saturable reabsorption, reab_n_<s>.

urine

urine(s)

The id of the amount in urine, Aurine_<s>.

urine_rate

urine_rate(s)

The id of the urinary excretion rate, Rurine_<s> (mmole/min).

The sum of the fluxes of the kidney into the urine Aurine_<s>, an output of the kidney which replaces the parameter of the top model.

feces

feces(s)

The id of the amount in feces, Afeces_<s>.

feces_rate

feces_rate(s)

The id of the fecal excretion rate, Rfeces_<s> (mmole/min).

A readout of the intestine (PBPKDefinition.readouts): the net flux of the reactions of the intestine into the feces Afeces_<s>, an output of the intestine which replaces the parameter of the top model.

lumen_amount

lumen_amount(s)

The id of the dissolved amount of s in the intestinal lumen, Alumen_<s> (mmole).

A readout of the intestine (PBPKDefinition.readouts): the sum over the lumen segments of Vlumen_<seg>*Clumen_<seg>_<s>, an output of the intestine; the undissolved drug of a tablet is not in it.

absorption_rate

absorption_rate(s)

The id of the absorption rate of s, Rabs_<s> (mmole/min).

A readout of the intestine (PBPKDefinition.readouts): the sum of the fluxes from the lumen into the intestinal wall (the mucosa, else the wall), the absorption of every segment and an apical influx; not the absorption rate constant ka_<s> (absorption).

absorbed_amount

absorbed_amount(s)

The id of the amount of s absorbed from the lumen, Aabs_<s> (mmole).

A readout of the intestine (PBPKDefinition.readouts): the integral of the absorption rate Rabs_<s> (the fluxes from the lumen into the wall, an apical influx included) since the start, a state of the intestine.

absorbed_fraction

absorbed_fraction(s)

The id of the gross absorbed fraction of the oral dose of s, Fa_<s>.

A readout of the intestine (PBPKDefinition.readouts): the absorbed amount Aabs_<s> over the oral dose given until then (tablet and solution, mmole), 0 before a dose; gross, before the first pass of the wall and the liver, so above the bioavailability.

oral_dose_applied

oral_dose_applied(s)

The local id of the oral dose of s which the intestine has applied, Aapp_<s> (mmole).

The integral of the outflows of the oral dose states (dissolution and emptying of a tablet, the application of a solution), a state of the intestine which Fa_<s> reads: with the dose states it is the oral dose given, also over several doses.

efflux_rate

efflux_rate(s)

The id of the efflux rate of s into the intestinal lumen, Reff_<s> (mmole/min).

A readout of the intestine (PBPKDefinition.readouts): the sum of the fluxes from the intestinal wall into the lumen, the apical efflux of every segment.

bile

bile(s)

The id of the concentration in bile, Cbile_<s>.

lumen

lumen(s, seg=None)

The local id of the concentration in an intestinal lumen segment, Clumen_du_<s>.

Without a segment the single lumen, Clumen_<s>.

lumen_volume

lumen_volume(seg=None)

The local id of the volume of a lumen segment, Vlumen_du (single: Vlumen).

solid

solid(s, seg)

The local id of the undissolved amount of s in a lumen segment, Asolid_du_<s>.

In the stomach (and the single lumen) the dose state PODOSE_<s> is the undissolved drug.

tubule

tubule(s, seg)

The local id of the concentration in the lumen of a tubule segment, Ctub_pt_<s>.

The segment is always part of the id (TUBULE_SEGMENTS), so the id names its substance without ambiguity.

tubule_volume

tubule_volume(seg)

The local id of the volume of the lumen of a tubule segment, Vtub_pt.

tubule_flow_fraction

tubule_flow_fraction(seg)

The local id of the tubular flow leaving a segment as fraction of the GFR, f_tub_pt.

tubule_reaction

tubule_reaction(s, seg)

The local id of the tubular flow of s out of a segment, J_tub_pt_<s>.

Out of the collecting duct the urinary excretion J_tub_cd_<s>.

tubule_reabsorption_reaction

tubule_reabsorption_reaction(s)

The local id of the reabsorbed fraction of s out of the collecting duct, J_reab_<s>.

mucosa

mucosa(s, seg=None)

The local id of the concentration in the mucosa of a segment, Cmu_du_<s>.

mucosa_unbound

mucosa_unbound(s, seg=None)

The local id of the unbound concentration in the mucosa of a segment, Cu_mu_du_<s>.

wall_compartment

wall_compartment(part)

The local id of a tissue compartment of the intestinal wall without the mucosa, Vti_wall.

The compartment of the tissue species of a substance with mucosa species: the mucosa is carved out of the wall, so the capacity of the intestine stays that of the wall without mucosa.

mucosa_volume

mucosa_volume(seg=None)

The local id of the volume of the mucosa of a segment, Vmu_du.

mucosa_flow

mucosa_flow(seg=None)

The local id of the blood flow of the mucosa of a segment, Qmu_du.

mucosa_coefficient

mucosa_coefficient(s)

The local id of the mucosa to plasma coefficient, K_mu_<s>.

transit_time

transit_time(seg=None)

The local id of the transit time of a lumen segment, T_du (single: t_lumen).

area_factor

area_factor(seg)

The local id of the absorption scaling of a lumen segment, f_area_du.

fraction_absorbed

fraction_absorbed(s)

The id of the fraction of the absorbed flux entering the body, fabs_<s>.

colon_absorption_factor

colon_absorption_factor(s)

The id of the factor of the absorption in the large intestine, f_ka_colon_<s>.

Of the segmented intestine: scales ka_<s>*f_area_<seg> of the segments of the large intestine.

regional_absorption_factor

regional_absorption_factor(s, seg)

The id of the factor of the absorption of s in a lumen segment, f_ka_<seg>_<s>.

Of the regional absorption profile of the segmented intestine (RegionalAbsorption): scales ka_<s>*f_area_<seg> of the segment.

lumen_conversion_rate

lumen_conversion_rate(substrate, product)

The id of the rate constant of a conversion in the lumen (1/hr), kconv_<s>_<m>.

Of a LumenConversion of the segmented intestine, a parameter of the top model: the substrate <s> converts into the product <m> with kconv/60*V*C in every segment of the conversion.

lumen_conversion_reaction

lumen_conversion_reaction(substrate, product, seg)

The local id of a conversion in a lumen segment, J_conv_<seg>_<s>_<m>.

transit_reaction

transit_reaction(s, seg=None, solid=False)

The local id of the transit of s out of a lumen segment, J_tr_du_<s>.

The undissolved drug J_trs_du_<s>.

dissolution_reaction

dissolution_reaction(s, seg)

The local id of the dissolution of s in a lumen segment, J_dis_du_<s>.

mucosa_reaction

mucosa_reaction(kind, s, seg=None)

The local id of a flow of the mucosa of a segment, J_mu_in_du_<s>.

kind is in (arterial inflow), out (outflow into the portal vein) or bc (the blood cells of the mucosal blood, which pass it).

placement_weight

placement_weight(key, seg)

The local id of the share of a process in a segment or a zone, w_cyp3a4_du.

key is the protein (or profile) in lower case or uniform (by mucosa volume); in the zone of a zonated organ w_cyp3a4_z1.

placement_profile

placement_profile(key, zone)

The local id of the relative abundance of a profile in a zone, p_cyp3a4_z1.

segment_process

segment_process(pid, seg)

The local id of a process of the chemistry in a segment or a zone, CYP3A4_DRG_du.

In the mucosa of a segment of the intestine or a zone of a zonated organ (CYP3A4_DRG_z1).

rate_ratio

rate_ratio(process, constant)

The local id of the ratio of a constant of a process to another, <p>_Vmax_ratio.

The factor of RateOf: the constant <p>_Vmax (or <p>_k) of the process is this ratio times the constant of the other process of the organ.

Parameters:

Name Type Description Default
process str

the id of the process.

required
constant str

the constant, Vmax or k.

required

product_fraction

product_fraction(process, product)

The local id of the fraction of a metabolism which forms a product, f_<p>_<s>.

A constant of the organ when the fractions of the metabolism are values or the remainder REST, which is 1 - sum of the others.

product_reaction

product_reaction(process, product)

The local id of the formation of a product of a metabolism, <p>_to_<s>.

The reaction of a metabolism with product fractions as constants forms the product with its fraction of the rate of the metabolism, f_<p>_<s> * <p> (in a zone or a segment <p>_to_<s>_<zone>).

dissolution_rate

dissolution_rate(s)

The local id of the dissolution rate of a tablet (1/min), kdis_<s>.

An assignment rule of the intestine for a Weibull or dose-dependent dissolution; a first order dissolution is the constant Ka_dis_<s>.

dissolution_age

dissolution_age(s)

The local id of the mean age of the undissolved dose (min), age_dis_<s>.

dissolution_clock

dissolution_clock(s)

The local id of the age-weighted undissolved amount (mmole*min), W_dis_<s>.

The state whose ratio to the undissolved amount is the mean time since the dose (age_dis_<s>) of a Weibull dissolution.

iv_dose

iv_dose(s)

The id of the intravenous dose state (mg), IVDOSE_<s>.

injection_time

injection_time(s)

The id of the half-life of an intravenous injection (s), ti_<s>.

injection_rate

injection_rate(s)

The id of the rate of an intravenous injection, Kiv_<s>.

infusion_rate

infusion_rate(s)

The id of the rate of an intravenous infusion (mg/min), Ri_<s>.

po_dose

po_dose(s)

The id of the oral dose state of a tablet (mg), PODOSE_<s>.

sol_dose

sol_dose(s)

The id of the oral dose state of a solution (mg), SOLDOSE_<s>.

dissolution

dissolution(s)

The id of the rate of the dissolution of a tablet, Ka_dis_<s>.

dissolution_fed_factor

dissolution_fed_factor(s)

The id of the factor of the dissolution rate in the fed state, f_dis_fed_<s>.

dissolution_release_factor

dissolution_release_factor(s)

The id of the factor of a modified-release formulation, f_dis_release_<s>.

dissolution_t50

dissolution_t50(s)

The id of the time of half dissolution of a Weibull dissolution (min), t50_dis_<s>.

dissolution_shape

dissolution_shape(s)

The id of the shape of a Weibull dissolution, shape_dis_<s>.

dissolution_lag

dissolution_lag(s)

The id of the lag time of a Weibull dissolution (min), lag_dis_<s>.

dissolution_dose50

dissolution_dose50(s)

The id of the undissolved amount of half the dissolution rate (mg), D50_dis_<s>.

solution

solution(s)

The id of the rate of the application of a solution, Ka_sol_<s>.

absorption

absorption(s)

The id of the rate of the absorption from the intestinal lumen, ka_<s>.

The first order absorption of the single lumen; in the segmented intestine the absorption rate constant of the small intestine, which the area factor of a segment scales.

dose_reaction

dose_reaction(kind, s)

The id of the application of a dose state, J_iv_<s>, J_po_<s>, J_sol_<s>.

absorption_reaction

absorption_reaction(s, seg=None)

The local id of the absorption from a lumen segment, J_abs_du_<s>.

feces_reaction

feces_reaction(s, seg=None)

The local id of the unabsorbed fraction of the absorption into the feces, J_feces_du_<s>.

Of a lumen segment with fabs_<s>, J_feces_<s> of the single lumen.

bile_reaction

bile_reaction(s)

The id of the transit of the bile into the intestinal lumen, J_bile_<s>.

Into the feces when the intestine has no lumen (standard organs).

pool_exchange_reaction

pool_exchange_reaction(pool, s)

The id of the exchange of s between plasma and blood cells of a pool, J_bc_ve_<s>.

arm

arm(s)

The id of the plasma concentration at the arm-vein site, Carm_<s>.

arm_free

arm_free(s)

The id of the unbound concentration at the arm-vein site, Carm_free_<s>.

arm_blood

arm_blood(s)

The id of the blood concentration at the arm-vein site, Carm_blood_<s>.

arm_weight

arm_weight(site)

The id of the weight of an organ outflow or a pool in the arm vein, w_arm_sk.

free

free(pool, s)

The id of the unbound concentration in a pool, Cve_free_<s>.

blood

blood(pool, s)

The id of the blood concentration in a pool, Cve_blood_<s>.

hepatic_vein

hepatic_vein(s)

The id of the concentration in the hepatic vein, Chv_<s>.

hepatic_vein_free

hepatic_vein_free(s)

The id of the unbound concentration in the hepatic vein, Chv_free_<s>.

hepatic_vein_blood

hepatic_vein_blood(s)

The id of the blood concentration in the hepatic vein, Chv_blood_<s>.

unbound

unbound(part, s, zone=None)

The local id of the unbound concentration of s in a tissue part, Cu_ti_<s>.

In a zone of a zonated organ Cu_ti_z1_<s>.

activity

activity(protein)

The id of the base activity of a protein in an organ, f_cyp3a4.

A constant of every organ in which a process uses the protein (flat LI__f_cyp3a4), relative to normal (1): the factor which genotype, impairment and the experiments set. Interactions act on top of it, not on it: mechanism-based inhibition and induction through the turnover state E_<protein> of the organ, reversible inhibition through the inhibitor terms in the rate of every process of the protein. A process of the protein runs with f_<protein> (times E_<protein>) on its Vmax or clearance.

enzyme

enzyme(protein)

The id of the turnover state of a protein in an organ, E_cyp3a4.

The amount of the protein relative to its baseline (initially 1), a state of the organs with a process of the protein when a substance of the definition inactivates (mechanism-based) or induces it.

kdeg

kdeg(protein)

The id of the degradation rate of a protein in an organ, kdeg_cyp3a4.

ki

ki(protein, s)

The id of the inhibition constant of s on a protein, Ki_cyp3a4_<s>.

The competitive constant of a mixed inhibition, the KI (half-maximal inactivation) of a mechanism-based inhibition.

kiu

kiu(protein, s)

The id of the uncompetitive constant of a mixed inhibition, Kiu_cyp3a4_<s>.

kinact

kinact(protein, s)

The id of the maximal inactivation rate of s on a protein, kinact_cyp3a4_<s>.

emax

emax(protein, s)

The id of the maximal induction of a protein by s, Emax_cyp3a4_<s>.

ec50

ec50(protein, s)

The id of the half-maximal inducing concentration of s, EC50_cyp3a4_<s>.

species_of

species_of(s, ids)

The flat species ids of substance s, by the id scheme.

Only species of exactly this substance match: api does not match the species of api_m2, drg not those of xdrg.

Parameters:

Name Type Description Default
s str

the substance id.

required
ids Iterable[str]

the ids to select from.

required

Returns:

Type Description
list[str]

The ids which are an organ species (of a zone as well), a slow

list[str]

pool of a tissue, a pool species, a blood cell pool species, a lumen,

list[str]

undissolved or mucosa species, a tubule species of s, in the order

list[str]

of ids.

steady_clearance

steady_clearance(s, organ=None)

The id of a clearance of the generated steady state, CLss_<s> [l/min].

In an organ (organ None) the clearance of its plasma at the steady state of s, the declared clearances of its tissue included (pkpdsim.pbpk.stationary); with organ its output in the top model, CLss_<o>_<s>. In the top model CLss_<s> is the clearance of the arterial plasma by the body at the steady state (without the organ of a saturable process), of a substance whose baseline the library solves.

steady_rate

steady_rate(s, organ=None)

The id of a net source of the generated steady state, Rss_<s> [mmole/min].

In an organ the net source into its plasma at the steady state of s (the declared rates of plasma and tissue), with organ its output in the top model, Rss_<o>_<s>; in the top model Rss_<s> is the net source of the body at the steady state (without the organ of a saturable process), see steady_clearance.

steady_vmax

steady_vmax(s, organ=None)

The id of the capacity of a saturable process at the steady state, Vss_<s> [mmole/min].

In an organ, with organ its output in the top model Vss_<o>_<s>.

steady_km

steady_km(s, organ=None)

The id of the Michaelis constant of a saturable process at the steady state, Kss_<s> [mM].

In an organ, with organ its output in the top model Kss_<o>_<s>.

steady_plasma

steady_plasma(organ, s)

The id of the plasma of the organ of a saturable process at the steady state, Css_<o>_<s> [mM].

A parameter of the top model, the root of the quadratic of the steady state of a substance whose baseline the library solves.

delta_base

delta_base(sid)

The id of the base of a delta, <sid>_0: the value of an observer at the start.

The constant which <sid>_delta subtracts (PBPKDefinition.deltas). It is no start of a species (PBPKDefinition.starts): the word "start" of the library names the initial concentrations of the species only.

delta

delta(sid)

The id of the change of an observer over its base, <sid>_delta.

annotation

The annotation of every element the library creates (#63).

Every generator annotates an element when it creates it, with annotate(element, kind, ...): the kind names what the element is (an organ volume, the plasma of an organ, a metabolism) and selects one row of the table KINDS, which holds its SBO term and its ontology terms. The context of the element adds the terms of where it is: the organ (UBERON and the compartment terms of pkpdsim.annotations, the PBPKO compartment), the blood pool, the lumen segment, the protein of a process (UniProt, NCIT) and the substance of a species (the annotations of its specification).

The PBPKO terms are those of the pinned pymetadata (PBPKO): a kind gives its PBPKO term, and an organ-specific term (VOLUME_OF_LIVER) where PBPKO has one for the organ. Where PBPKO has no term, the kind takes the nearest broader PBPKO term and names the missing one (requested); every missing term is listed in docs/pbpk/annotation.md ("terms requested upstream", requested_terms).

Every resource is written in one format, the identifiers.org collection/term of pkpdsim.annotations: pbpko/PBPKO:00558, uberon/UBERON:0002107, uniprot/P08684.

The qualifiers: BQB.IS for what the element is (the PBPKO term, the kind's terms, the protein of a process, the substance of a species); the location is BQB.IS_PART_OF for a compartment, BQB.IS_PROPERTY_OF for a parameter and BQB.OCCURS_IN for a reaction; a parameter of a protein (activity, inhibition constant) is BQB.IS_PROPERTY_OF the protein.

PBPKO_URL module-attribute

PBPKO_URL = 'https://bioregistry.io/'

The prefix of the resources of PBPKO terms, https://bioregistry.io/PBPKO:00558.

Term module-attribute

Term = tuple[BQB, str]

An annotation: the qualifier and the resource, collection/term.

ORGANS module-attribute

ORGANS = {
    Organ.LUNG: _organ(
        "lu", "lung", ("LUNG",), "LUNG_COMPARTMENT"
    ),
    Organ.HEART: _organ(
        "he", "heart", ("HEART",), "HEART_COMPARTMENT"
    ),
    Organ.BRAIN: _organ(
        "br", "brain", ("BRAIN",), "BRAIN_COMPARTMENT"
    ),
    Organ.LIVER: _organ(
        "li", "liver", ("LIVER",), "LIVER_COMPARTMENT"
    ),
    Organ.KIDNEY: _organ(
        "ki", "kidney", ("KIDNEY",), "KIDNEY_COMPARTMENT"
    ),
    Organ.STOMACH: _organ(
        "stomach",
        "stomach",
        ("STOMACH",),
        "STOMACH_COMPARTMENT",
    ),
    Organ.SMALL_INTESTINE: _organ(
        "si",
        "small intestine",
        ("SMALL_INTESTINE", "INTESTINE"),
        "SMALL_INTESTINE_COMPARTMENT",
    ),
    Organ.LARGE_INTESTINE: _organ(
        "la",
        "large intestine",
        ("LARGE_INTESTINE", "INTESTINE"),
        "LARGE_INTESTINE_COMPARTMENT",
    ),
    Organ.SPLEEN: _organ(
        "sp", "spleen", ("SPLEEN",), "SPLEEN_COMPARTMENT"
    ),
    Organ.PANCREAS: _organ(
        "pa",
        "pancreas",
        ("PANCREAS",),
        "PANCREAS_COMPARTMENT",
    ),
    Organ.MUSCLE: _organ(
        "mu", "muscle", ("MUSCLE",), "MUSCLE_COMPARTMENT"
    ),
    Organ.SKIN: _organ(
        "sk", "skin", ("SKIN",), "SKIN_COMPARTMENT"
    ),
    Organ.ADIPOSE: _organ(
        "ad", "adipose", ("FAT",), "ADIPOSE_COMPARTMENT"
    ),
    Organ.BONE: _organ("bo", "bone", ("BONE",), None),
    Organ.GONADS: _organ(
        "go", "gonads", ("GONAD",), "GONAD_COMPARTMENT"
    ),
}

The terms of the organs; the PBPKO token of adipose tissue is FAT, the intestines take the terms of the intestine where PBPKO has none of their own (MAXIMUM_RATE_IN_INTESTINE); PBPKO has no compartment of the bone (only of the bone marrow).

POOLS module-attribute

POOLS = {
    Pool.ARTERIAL: _Place(
        "arterial blood",
        (
            (BQB.IS_PART_OF, "uberon/UBERON:0013755"),
            *_location_terms("ar"),
        ),
        "ARTERIAL_BLOOD_COMPARTMENT",
    ),
    Pool.VENOUS: _Place(
        "venous blood",
        (
            (BQB.IS_PART_OF, "uberon/UBERON:0013756"),
            *_location_terms("ve"),
        ),
        "VENOUS_BLOOD_COMPARTMENT",
    ),
    Pool.PORTAL: _Place(
        "portal vein blood",
        (
            (BQB.IS_PART_OF, "uberon/UBERON:0002017"),
            *_location_terms("po"),
        ),
        None,
    ),
}

The terms of the blood pools; PBPKO has no compartment of the portal vein.

SEGMENTS module-attribute

SEGMENTS = {
    "st": _Place(
        "stomach",
        tuple(_compartments["stomach"]),
        "STOMACH_COMPARTMENT",
    ),
    "du": _Place(
        "duodenum",
        tuple(_compartments["duodenum"]),
        "DUODENUM_COMPARTMENT",
    ),
    "jej1": _Place(
        "upper jejunum",
        tuple(_compartments["jejunum"]),
        "JEJUNUM_COMPARTMENT",
    ),
    "jej2": _Place(
        "lower jejunum",
        tuple(_compartments["jejunum"]),
        "JEJUNUM_COMPARTMENT",
    ),
    "ile1": _Place(
        "upper ileum",
        tuple(_compartments["ileum"]),
        "ILEUM_COMPARTMENT",
    ),
    "ile2": _Place(
        "lower ileum",
        tuple(_compartments["ileum"]),
        "ILEUM_COMPARTMENT",
    ),
    "cae": _Place(
        "caecum",
        tuple(_compartments["caecum"]),
        "CECUM_COMPARTMENT",
    ),
    "asc": _Place(
        "ascending colon",
        tuple(_compartments["ascending colon"]),
        "ASCENDING_COLON_COMPARTMENT",
    ),
    "tra": _Place(
        "transverse colon",
        tuple(_compartments["transverse colon"]),
        "TRANSVERSE_COLON_COMPARTMENT",
    ),
    "des": _Place(
        "descending colon",
        tuple(_compartments["descending colon"]),
        "DESCENDING_COLON_COMPARTMENT",
    ),
    "sig": _Place(
        "sigmoid colon",
        tuple(_compartments["sigmoid colon"]),
        "SIGMOID_COLON_COMPARTMENT",
    ),
    "rec": _Place(
        "rectum",
        tuple(_compartments["rectum"]),
        "RECTUM_COMPARTMENT",
    ),
    "pt": _Place(
        "proximal tubule",
        tuple(_compartments["proximal tubule"]),
        "PROXIMAL_TUBULE_COMPARTMENT",
    ),
    "lh": _Place(
        "loop of Henle",
        tuple(_compartments["loop of Henle"]),
        "LOOP_OF_HENLE_COMPARTMENT",
    ),
    "dt": _Place(
        "distal tubule",
        tuple(_compartments["distal tubule"]),
        "DISTAL_TUBULE_COMPARTMENT",
    ),
    "cd": _Place(
        "collecting duct",
        tuple(_compartments["collecting duct"]),
        "COLLECTING_DUCT_COMPARTMENT",
    ),
}

The terms of the lumen segments of the intestine and of the tubule of the nephron kidney, by their id token.

SITES module-attribute

SITES = {
    "hepatic_vein": _Place(
        "hepatic vein",
        (
            *_location_terms("hv"),
            (BQB.IS_PART_OF, "uberon/UBERON:0001143"),
        ),
        None,
    ),
    "arm_vein": _Place(
        "arm vein", _location_terms("fov"), None
    ),
}

The terms of the sampling sites of the observers which are no blood pool.

KINDS module-attribute

KINDS = {
    "plasma": Kind(
        _C,
        "PLASMA_COMPARTMENT",
        pools={
            Pool.ARTERIAL: "ARTERIAL_PLASMA",
            Pool.VENOUS: "VENOUS_PLASMA_COMPARTMENT",
        },
        terms=_PLASMA,
    ),
    "blood_cells": Kind(
        _C,
        "RED_BLOOD_CELL_COMPARTMENT",
        terms=_BLOOD_CELLS,
    ),
    "capacity": Kind(
        SBO.IMPLICIT_COMPARTMENT,
        "COMPARTMENT",
        terms=(
            (BQB.IS_VERSION_OF, pbpko("BLOOD_COMPARTMENT")),
        ),
        requested="plasma-equivalent capacity of the blood (volume times BP)",
    ),
    "organ": Kind(_C, "COMPARTMENT", is_place=True),
    "tissue": Kind(
        _C,
        "COMPARTMENT",
        terms=((BQB.IS, "uberon/UBERON:0000479"),),
        requested="tissue compartment (interstitial and intracellular space)",
    ),
    "interstitial": Kind(
        _C,
        "COMPARTMENT",
        terms=(
            (BQB.IS, "uberon/UBERON:0000913"),
            (BQB.IS, "ncit/C120839"),
        ),
        requested="interstitial compartment",
    ),
    "intracellular": Kind(
        _C,
        "COMPARTMENT",
        organ="{}_INTRACELLULAR_SPACE_COMPARTMENT",
        terms=((BQB.IS, "go/GO:0005622"),),
        requested="intracellular space compartment",
        per_organ=False,
    ),
    "urine": Kind(
        _C,
        "URINE_COMPARTMENT",
        terms=tuple(_compartments["urine"]),
    ),
    "feces": Kind(
        _C,
        "FECES_COMPARTMENT",
        terms=tuple(_compartments["feces"]),
    ),
    "bile": Kind(
        _C,
        "BILE_COMPARTMENT",
        terms=tuple(_compartments["bi"]),
    ),
    "lumen": Kind(
        _C,
        "GUT_LUMEN_COMPARTMENT",
        terms=tuple(_compartments["gu_lumen"]),
    ),
    "mucosa": Kind(
        _C,
        "COMPARTMENT",
        terms=(
            (BQB.IS, "uberon/UBERON:0001242"),
            (
                BQB.IS_PART_OF,
                pbpko("INTESTINAL_TISSUE_COMPARTMENT"),
            ),
        ),
        requested="intestinal mucosa compartment (enterocytes)",
    ),
    "gut_wall": Kind(
        _C,
        "COMPARTMENT",
        terms=(
            (
                BQB.IS_PART_OF,
                pbpko("INTESTINAL_TISSUE_COMPARTMENT"),
            ),
        ),
        requested="intestinal tissue compartment without the mucosa",
    ),
    "tubule": Kind(_C, "FILTRATE_COMPARTMENT"),
    "body_weight": Kind(_P, "BODYWEIGHT"),
    "height": Kind(_P, "HEIGHT"),
    "age": Kind(_P, "AGE_IN_PBPK_MODEL"),
    "bmi": Kind(_P, "BODY_MASS_INDEX"),
    "bsa": Kind(
        _P,
        "SURFACE_AREA",
        terms=((BQB.IS, "ncit/C25157"),),
    ),
    "lean_mass": Kind(
        _P,
        _PHYS,
        terms=((BQB.IS, "ncit/C71258"),),
        requested="fat-free mass",
    ),
    "scaling_factor": Kind(
        _P, _PHYS, requested="covariate scaling factor"
    ),
    "organ_mass": Kind(
        _P,
        _PHYS,
        organ="{}_MASS",
        requested="mass of organ",
        per_organ=False,
    ),
    "organ_volume": Kind(
        _P, "VOLUME_OF_COMPARTMENT", organ="VOLUME_OF_{}"
    ),
    "blood_volume": Kind(_P, "VOLUME_OF_BLOOD"),
    "pool_volume": Kind(
        _P,
        "VOLUME_OF_COMPARTMENT",
        pools={
            Pool.ARTERIAL: "ARTERIAL_VOLUME",
            Pool.VENOUS: "VENOUS_VOLUME",
            Pool.PORTAL: "VOLUME_OF_PORTAL_VEIN",
        },
    ),
    "pool_fraction": Kind(
        _P,
        _PHYS,
        requested="fraction of the blood volume in a blood pool",
    ),
    "vascular_fraction": Kind(
        _P, "VOLUME_FRACTION_OF_BLOOD"
    ),
    "interstitial_fraction": Kind(
        _P,
        _PHYS,
        requested="interstitial volume fraction of an organ",
    ),
    "tissue_volume": Kind(_P, "VOLUME_OF_COMPARTMENT"),
    "zone_fraction": Kind(
        _P,
        _PHYS,
        requested="volume fraction of a zone of the liver",
    ),
    "hematocrit": Kind(
        _P,
        "VOLUME_FRACTION_OF_RED_BLOOD_CELLS",
        terms=(
            (BQB.IS_PROPERTY_OF, "uberon/UBERON:0000178"),
        ),
    ),
    "cardiac_output": Kind(_P, "CARDIAC_OUTPUT_RATE"),
    "flow_fraction": Kind(
        _P,
        "FRACTION_OF_BLOOD_FLOW_TO_A_COMPARTMENT",
        organ="FRACTION_OF_BLOOD_FLOW_TO_{}",
    ),
    "organ_flow": Kind(
        _P,
        "BLOOD_FLOW_RATE_TO_COMPARTMENT",
        organ="BLOOD_FLOW_RATE_TO_{}",
    ),
    "hepatic_artery_flow": Kind(
        _P,
        "BLOOD_FLOW_RATE_TO_COMPARTMENT",
        requested="hepatic artery blood flow",
    ),
    "portal_flow": Kind(
        _P, "BLOOD_FLOW_RATE_TO_PORTAL_VEIN"
    ),
    "hepatic_flow": Kind(_P, "HEPATIC_VEIN_BLOOD_FLOW"),
    "gfr": Kind(_P, "GLOMERULAR_FILTRATION_RATE"),
    "gfr_base": Kind(
        _P,
        _PHYS,
        terms=(
            (
                BQB.IS_VERSION_OF,
                pbpko("GLOMERULAR_FILTRATION_RATE"),
            ),
        ),
        requested="glomerular filtration rate at normal renal function",
    ),
    "egfr": Kind(
        _P,
        "GLOMERULAR_FILTRATION_RATE",
        terms=((BQB.IS, "ncit/C110935"),),
    ),
    "organ_function": Kind(
        _P, _PHYS, requested="relative organ function"
    ),
    "tubular_share": Kind(
        _P,
        _PHYS,
        requested="share of the tubular capacity which follows the renal function",
    ),
    "shunt": Kind(
        _P, _PHYS, requested="portosystemic shunt fraction"
    ),
    "child_pugh": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["child_pugh"],),
        requested="severity of hepatic impairment",
    ),
    "heart_failure": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["heart_failure"],),
        requested="severity of heart failure",
    ),
    "ckd": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["ckd"],),
        requested="stage of chronic kidney disease",
    ),
    "cirrhosis_factor": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["cirrhosis"],),
        requested="impairment factor",
    ),
    "ckd_factor": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["ckd"],),
        requested="impairment factor",
    ),
    "heart_failure_factor": Kind(
        _P,
        _PHYS,
        terms=(_DISEASES["heart_failure"],),
        requested="impairment factor",
    ),
    "impairment_factor": Kind(
        _P, _PHYS, requested="impairment factor"
    ),
    "molecular_weight": Kind(
        SBO.MOLECULAR_MASS, "MOLECULAR_WEIGHT"
    ),
    "fu": Kind(_P, "FRACTION_UNBOUND_PLASMA"),
    "fraction_reabsorbed": Kind(_P, "RESORPTION"),
    "reabsorption_threshold": Kind(
        _P,
        _BIOCHEM,
        requested="renal threshold of a saturable reabsorption",
    ),
    "reabsorption_n": Kind(
        _P,
        _BIOCHEM,
        requested="sharpness of the renal threshold of a saturable reabsorption",
    ),
    "baseline": Kind(
        _P,
        "CONCENTRATION_IN_PLASMA",
        requested="endogenous baseline plasma concentration",
    ),
    "steady_clearance": Kind(_P, "CLEARANCE_RATE"),
    "steady_rate": Kind(
        _P,
        _BIOCHEM,
        requested="net production rate at the steady state",
    ),
    "steady_vmax": Kind(
        SBO.MAXIMAL_VELOCITY, "MAXIMUM_RATE"
    ),
    "steady_km": Kind(
        SBO.MICHAELIS_CONSTANT,
        _BIOCHEM,
        requested="Michaelis constant",
    ),
    "steady_plasma": Kind(_P, "CONCENTRATION_IN_PLASMA"),
    "kp": Kind(_P, "TISSUE_PLASMA_PARTITION_COEFFICIENT"),
    "kp_organ": Kind(
        _P,
        "TISSUE_PLASMA_PARTITION_COEFFICIENT",
        organ="{}_PLASMA_PARTITION_COEFFICIENT",
    ),
    "kp_factor": Kind(
        _P,
        _BIOCHEM,
        requested="factor of the partition coefficients",
    ),
    "partition": Kind(_P, "PARTITION_COEFFICIENT"),
    "slow_pool_exchange": Kind(
        _P,
        _BIOCHEM,
        requested="exchange rate constant of a slow tissue pool per tissue volume",
    ),
    "tissue_composition": Kind(
        _P,
        _PHYS,
        requested="tissue composition (water, protein, lipid fractions)",
    ),
    "permeability": Kind(
        _P,
        _BIOCHEM,
        requested="permeability surface area product (exchange flow)",
    ),
    "bp": Kind(_P, "BLOOD_PLASMA_RATIO"),
    "kbc": Kind(
        _P, "RED_BLOOD_CELLS_PARTITION_COEFFICIENT"
    ),
    "exchange_rate": Kind(
        _P,
        _BIOCHEM,
        requested="exchange rate constant of plasma and blood cells",
    ),
    "endothelial_exchange": Kind(
        _P,
        _PHYS,
        requested="endothelial exchange rate constant per organ volume",
    ),
    "activity": Kind(
        SBO.RELATIVE_ACTIVITY,
        _BIOCHEM,
        requested="relative activity of enzyme or transporter",
    ),
    "enzyme_amount": Kind(
        SBO.RELATIVE_ACTIVITY,
        _BIOCHEM,
        requested="relative amount of enzyme or transporter",
    ),
    "kdeg": Kind(
        SBO.DECAY_CONSTANT, "DEGRADATION_RATE_CONSTANT"
    ),
    "ki": Kind(
        SBO.INHIBITORY_CONSTANT, "INHIBITION_CONSTANT"
    ),
    "kinact": Kind(
        SBO.INACTIVATION_RATE_CONSTANT,
        _BIOCHEM,
        requested="maximal inactivation rate constant",
    ),
    "emax": Kind(
        _P, _BIOCHEM, requested="maximal induction"
    ),
    "ec50": Kind(
        SBO.EC50,
        _BIOCHEM,
        requested="half-maximal effective concentration",
    ),
    "placement_weight": Kind(
        _P,
        _MISC,
        requested="abundance weight of a protein or process",
    ),
    "vmax": Kind(
        SBO.MAXIMAL_VELOCITY,
        "MAXIMUM_RATE",
        organ="MAXIMUM_RATE_IN_{}",
        per_organ=False,
    ),
    "vmax_basolateral": Kind(
        SBO.MAXIMAL_VELOCITY,
        "MAXIMUM_RATE_OF_BASOLATERAL_TRANSPORTER",
    ),
    "vmax_apical": Kind(
        SBO.MAXIMAL_VELOCITY,
        "MAXIMUM_RATE_OF_APICAL_TRANSPORTER",
    ),
    "km": Kind(
        SBO.MICHAELIS_CONSTANT,
        _BIOCHEM,
        organ="MICHAELIS_CONSTANT__{}",
        requested="Michaelis constant",
        per_organ=False,
    ),
    "km_basolateral": Kind(
        SBO.MICHAELIS_CONSTANT, "MICHAELIS_CONSTANT_BASO"
    ),
    "km_apical": Kind(
        SBO.MICHAELIS_CONSTANT, "MICHAELIS_CONSTANT_APICAL"
    ),
    "hill": Kind(SBO.HILL_COEFFICIENT, "HILL_COEFFICIENT"),
    "k_metabolism": Kind(
        SBO.KINETIC_CONSTANT, "INTRINSIC_CLEARANCE_RATE"
    ),
    "k_influx": Kind(
        SBO.KINETIC_CONSTANT, "CLEARANCE_RATE"
    ),
    "k_efflux": Kind(
        SBO.KINETIC_CONSTANT, "CLEARANCE_RATE"
    ),
    "k_metabolism_volume": Kind(
        SBO.KINETIC_CONSTANT,
        _BIOCHEM,
        terms=(
            (
                BQB.IS_VERSION_OF,
                pbpko("INTRINSIC_CLEARANCE_RATE"),
            ),
        ),
        requested="intrinsic clearance per organ volume",
    ),
    "k_transport_volume": Kind(
        SBO.KINETIC_CONSTANT,
        _BIOCHEM,
        terms=(
            (BQB.IS_VERSION_OF, pbpko("CLEARANCE_RATE")),
        ),
        requested="transport clearance per organ volume",
    ),
    "rate_ratio": Kind(
        _P,
        _BIOCHEM,
        requested="ratio of the capacity of a process to another process",
    ),
    "product_fraction": Kind(
        _P,
        _BIOCHEM,
        requested="fraction of a metabolism which forms a product",
    ),
    "custom_parameter": Kind(None, _MISC),
    "definition_parameter": Kind(None, _MISC),
    "custom_species": Kind(
        None, "CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "custom_amount": Kind(
        None, "AMOUNT_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "dose": Kind(
        _P,
        "PARAMETER",
        terms=((BQB.IS, "ncit/C25488"),),
        requested="dose",
    ),
    "iv_time": Kind(
        _P,
        "PARAMETER",
        terms=_IV_BOLUS,
        requested="injection time of an intravenous dose",
    ),
    "iv_rate": Kind(
        SBO.FORWARD_RATE_CONSTANT,
        "PARAMETER",
        terms=_IV_BOLUS,
        requested="injection rate constant of an intravenous dose",
    ),
    "infusion_rate": Kind(
        _P,
        "PARAMETER",
        terms=_IV_INFUSION,
        requested="infusion rate of an intravenous infusion",
    ),
    "dissolution": Kind(
        _P, _MISC, requested="dissolution of a formulation"
    ),
    "application_rate": Kind(
        SBO.FORWARD_RATE_CONSTANT,
        "ABSORPTION_RATE_CONSTANT",
    ),
    "absorption_rate": Kind(
        SBO.FORWARD_RATE_CONSTANT,
        "ABSORPTION_RATE_CONSTANT_INTESTINE",
    ),
    "transit_time": Kind(_P, "INTESTINAL_TRANSIT_TIME"),
    "gastric_transit_time": Kind(
        _P, _PHYS, requested="gastric emptying time"
    ),
    "fed": Kind(
        _P,
        _MISC,
        terms=((BQB.IS_VERSION_OF, "ncit/C65056"),),
        requested="prandial state (fed or fasted)",
    ),
    "intestine_geometry": Kind(
        _P,
        _PHYS,
        requested="intestinal mucosa and absorption geometry",
    ),
    "gut_flow": Kind(_P, "BLOOD_FLOW_RATE_TO_GUT"),
    "gut_volume": Kind(_P, "VOLUME_OF_GUT"),
    "mucosa_flow": Kind(
        _P,
        "BLOOD_FLOW_RATE_TO_COMPARTMENT",
        requested="blood flow rate to intestinal mucosa",
    ),
    "mucosa_volume": Kind(_P, "ENTEROCYTE_VOLUME"),
    "bile_transit": Kind(
        SBO.FORWARD_RATE_CONSTANT,
        _PHYS,
        requested="bile transit rate constant",
    ),
    "tubule_fraction": Kind(
        _P,
        _PHYS,
        requested="tubular flow fraction of the glomerular filtration rate",
    ),
    "fraction_absorbed": Kind(
        _P, "UPTAKE_FRACTION_TO_BLOOD"
    ),
    "colon_absorption": Kind(
        _P,
        _PHYS,
        requested="absorption factor of the large intestine",
    ),
    "regional_absorption": Kind(
        _P,
        _BIOCHEM,
        requested="relative absorption of a substance in an intestinal segment",
    ),
    "lumen_conversion_rate": Kind(
        SBO.FORWARD_RATE_CONSTANT,
        _BIOCHEM,
        requested="rate constant of a conversion in the intestinal lumen",
    ),
    "arm_weight": Kind(
        _P,
        _PHYS,
        requested="weight of a tissue in the arm vein sampling site",
    ),
    "outflow": Kind(
        _P,
        "TOTAL_VENOUS_CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT",
    ),
    "outflow_blood_cells": Kind(
        _P, "CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "organ_concentration": Kind(
        _P, "CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "organ_amount": Kind(
        _P, "AMOUNT_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "plasma_concentration": Kind(
        _P, "CONCENTRATION_IN_PLASMA"
    ),
    "free_concentration": Kind(
        _P, "UNBOUND_CONCENTRATION_IN_PLASMA"
    ),
    "blood_concentration": Kind(
        _P, "CONCENTRATION_IN_BLOOD"
    ),
    "unbound_concentration": Kind(
        _P,
        "UNBOUND_CONCENTRATION_OF_COMPUND_IN_COMPARTMENT",
    ),
    "urine_rate": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=((BQB.IS_VERSION_OF, pbpko("URINARY_RATE")),),
        requested="urinary excretion rate (amount of compound per time)",
    ),
    "lumen_amount": Kind(_P, "AMOUNT_IN_LUMEN"),
    "intestine_absorption": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=((BQB.IS_VERSION_OF, pbpko("ABSORPTION")),),
        requested="intestinal absorption rate (amount of compound per time)",
    ),
    "intestine_efflux": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=(
            (
                BQB.IS_VERSION_OF,
                pbpko("DISTRIBUTION_PROCESS"),
            ),
        ),
        requested="intestinal efflux rate into the lumen (amount of compound per time)",
    ),
    "feces_rate": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=(
            (BQB.IS_VERSION_OF, pbpko("FECAL_EXCRETION")),
        ),
        requested="fecal excretion rate (amount of compound per time)",
    ),
    "absorbed_amount": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=((BQB.IS_VERSION_OF, pbpko("ABSORPTION")),),
        requested="amount of compound absorbed from the intestinal lumen",
    ),
    "absorbed_fraction": Kind(
        _P,
        "OUTPUT_PARAMETER",
        terms=((BQB.IS_VERSION_OF, pbpko("ABSORPTION")),),
        requested="fraction of the oral dose absorbed from the intestinal lumen",
    ),
    "oral_dose_applied": Kind(
        _P,
        "OUTPUT_PARAMETER",
        requested="amount of the oral dose applied to the intestinal lumen",
    ),
    "observer": Kind(_P, "OUTPUT_PARAMETER"),
    "concentration": Kind(
        _SPECIES, "CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT"
    ),
    "concentration_plasma": Kind(
        _SPECIES, "CONCENTRATION_IN_PLASMA"
    ),
    "concentration_tissue": Kind(
        _SPECIES,
        "CONCENTRATION_OF_COMPOUND_IN_COMPARTMENT",
        organ="CONCENTRATION_IN_{}",
    ),
    "concentration_lumen": Kind(
        _SPECIES, "CONCENTRATION_IN_LUMEN"
    ),
    "concentration_mucosa": Kind(
        _SPECIES, "CONCENTRATION_IN_INTESTINAL_TISSUE"
    ),
    "concentration_bile": Kind(
        _SPECIES, "CONCENTRATION_IN_BILE"
    ),
    "concentration_tubule": Kind(
        _SPECIES, "CONCENTRATION_IN_FILTRATE"
    ),
    "amount_urine": Kind(
        _SPECIES, "CUMULATIVE_AMOUNT_IN_URINE"
    ),
    "amount_feces": Kind(
        _SPECIES, "CUMULATIVE_AMOUNT_IN_FECES"
    ),
    "amount_undissolved": Kind(
        _SPECIES,
        "AMOUNT_IN_LUMEN",
        requested="amount of undissolved drug",
    ),
    "blood_flow": Kind(
        _T,
        "DISTRIBUTION_PROCESS",
        terms=((BQB.IS, "go/GO:0008015"),),
    ),
    "exchange": Kind(_T, "DISTRIBUTION_PROCESS"),
    "metabolism": Kind(
        SBO.BIOCHEMICAL_REACTION,
        "LINEAR_ELIMINATION",
        terms=((BQB.IS, "go/GO:0008152"),),
    ),
    "metabolism_saturable": Kind(
        SBO.BIOCHEMICAL_REACTION,
        "NON_LINEAR_ELIMINATION",
        terms=((BQB.IS, "go/GO:0008152"),),
    ),
    "gut_metabolism": Kind(
        SBO.BIOCHEMICAL_REACTION,
        "GUT_METABOLISM",
        terms=((BQB.IS, "go/GO:0008152"),),
    ),
    "metabolism_product": Kind(
        SBO.BIOCHEMICAL_REACTION,
        None,
        terms=((BQB.IS_PART_OF, "go/GO:0008152"),),
    ),
    "transport": Kind(
        _T,
        "DISTRIBUTION_PROCESS",
        terms=((BQB.IS, "go/GO:0055085"),),
    ),
    "biliary_excretion": Kind(
        _T,
        "BILIARY_ELIMINATION",
        terms=((BQB.IS, "go/GO:0055085"),),
    ),
    "renal_secretion": Kind(
        _T,
        "RENAL_EXCRETION",
        terms=((BQB.IS, "go/GO:0097254"),),
    ),
    "reabsorption": Kind(
        _T,
        "RESORPTION",
        terms=((BQB.IS, "go/GO:0055085"),),
    ),
    "filtration": Kind(
        _T,
        "RENAL_EXCRETION",
        terms=((BQB.IS, "go/GO:0003094"),),
    ),
    "tubular_flow": Kind(
        _T,
        None,
        terms=(
            (BQB.IS_PART_OF, pbpko("RENAL_EXCRETION")),
            (BQB.IS_PART_OF, "go/GO:0007588"),
        ),
    ),
    "absorption": Kind(
        _T,
        "ABSORPTION",
        terms=((BQB.IS, "go/GO:0050892"),),
    ),
    "dissolution_reaction": Kind(
        _T,
        None,
        terms=((BQB.IS_PART_OF, pbpko("ABSORPTION")),),
        requested="dissolution process",
    ),
    "transit": Kind(
        _T,
        None,
        terms=((BQB.IS_VERSION_OF, "go/GO:0022600"),),
        requested="gastrointestinal transit process",
    ),
    "fecal_excretion": Kind(
        _T,
        "FECAL_EXCRETION",
        terms=((BQB.IS, "go/GO:0007588"),),
    ),
    "lumen_conversion": Kind(
        SBO.BIOCHEMICAL_REACTION,
        None,
        terms=(
            (BQB.IS_VERSION_OF, pbpko("GUT_METABOLISM")),
        ),
        requested="conversion in the intestinal lumen",
    ),
    "bile_flow": Kind(
        _T,
        None,
        terms=(
            (
                BQB.IS_PART_OF,
                pbpko("ENTEROHEPATIC_RECIRCULATION"),
            ),
        ),
    ),
    "iv_application": Kind(
        _T,
        None,
        terms=(
            (
                BQB.IS_VERSION_OF,
                pbpko("INTRAVENOUS_BOLUS_EXPOSURE"),
            ),
            (
                BQB.IS_VERSION_OF,
                pbpko("INTRAVENOUS_INFUSION_EXPOSURE"),
            ),
        ),
    ),
    "oral_application": Kind(_T, "ORAL_EXPOSURE"),
    "custom_reaction": Kind(
        SBO.BIOCHEMICAL_OR_TRANSPORT_REACTION,
        None,
        terms=((BQB.IS_VERSION_OF, "go/GO:0008150"),),
    ),
}

The kinds of the elements the library creates.

Kind dataclass

Kind(
    sbo,
    pbpko,
    organ=None,
    pools=dict(),
    terms=(),
    requested=None,
    per_organ=True,
    is_place=False,
)

What an element is: its SBO term and its ontology terms.

Attributes:

Name Type Description
sbo str | None

the SBO term, None keeps the SBO term of the element.

pbpko str | None

the name of the PBPKO term, the broader term where PBPKO has no term for the kind (requested), None for no PBPKO term.

organ str | None

the name of the organ-specific PBPKO term with {} for the token of the organ (VOLUME_OF_{}), which replaces pbpko where PBPKO has it.

pools Mapping[Pool, str]

the PBPKO term of the kind by blood pool, which replaces pbpko.

terms tuple[Term, ...]

further terms of the kind (BQB.IS, other ontologies).

requested str | None

the PBPKO term which is missing, if pbpko is a broader term.

per_organ bool

the organ-specific terms which PBPKO lacks are requested for every organ (the physiology), not only where PBPKO has some (the kinetics of the processes, MICHAELIS_CONSTANT__LIVER).

is_place bool

the element is the place itself (the whole organ of a flow-limited organ), so the terms of the place are BQB.IS.

pbpko

pbpko(name)

Get the resource of a term of the pinned PBPKO by its name.

Parameters:

Name Type Description Default
name str

the name of the term in the pymetadata enum, LIVER_COMPARTMENT.

required

Returns:

Type Description
str

The resource https://bioregistry.io/PBPKO:00558: identifiers.org

str

does not register PBPKO, so pymetadata cannot parse a

str

pbpko/PBPKO:00558 (it logs a MIRIAM error and writes an

str

identifiers.org url which does not resolve); the bioregistry url is

str

written as given and resolves.

Raises:

Type Description
AttributeError

if PBPKO has no term of the name.

initial_assignment

initial_assignment(symbol, formula, unit, name)

Get the initial assignment of a constant, with a name and an SBO term.

Every quantity of the library which depends on parameters only is a constant with an initial assignment; the assignment carries the name of its target and the SBO term of a mathematical expression, so the factory has nothing to hint about.

Parameters:

Name Type Description Default
symbol str

the id of the target.

required
formula str

the formula.

required
unit UnitType

the unit of the formula.

required
name str

the name of the target.

required

Returns:

Type Description
InitialAssignment

The initial assignment.

annotate

annotate(
    element,
    kind,
    *,
    organ=None,
    pool=None,
    segment=None,
    site=None,
    protein=None,
    substance=None,
)

Annotate an element the library creates by its kind and its place.

Parameters:

Name Type Description Default
element S

the compartment, species, parameter or reaction.

required
kind str

the kind of the element, a key of KINDS.

required
organ Organ | None

the organ of the element.

None
pool Pool | None

the blood pool of the element.

None
segment str | None

the lumen segment of the element (du, pt), a key of SEGMENTS.

None
site str | None

the sampling site of an observer, a key of SITES.

None
protein str | None

the protein of a process or of its parameters; a protein which is not in the protein table adds no terms (a definition checks its proteins, PBPKDefinition.validate).

None
substance Substance | None

the substance of a species, whose annotations it takes.

None

Returns:

Type Description
S

The element, with the SBO term of the kind (a kind which keeps the

S

SBO term of the element gives a generic one to an element without)

S

and its terms added to its annotations; a term of the place whose

S

resource the element has already (as what it is) is not repeated.

Raises:

Type Description
KeyError

if the kind, the segment or the site is unknown.

model_annotations

model_annotations(substances)

Get the annotations of a PBPK model: its type, the taxon and the approach.

A model is perfusion-limited when every substance which enters tissue does so flow-limited (Mode.PERFUSION), permeability-limited when one has a finite exchange.

Parameters:

Name Type Description Default
substances Iterable[Substance]

the substances of the model.

required

Returns:

Type Description
list[Term]

The terms of the model.

requested_terms

requested_terms()

Get the PBPKO terms the library needs and the pinned PBPKO lacks.

Returns:

Name Type Description
dict[str, str]

The missing terms with the broader PBPKO term the library uses

instead dict[str, str]

the requested terms of the kinds and the organ-specific

dict[str, str]

terms of the kinds which PBPKO lacks for an organ.

values

Values with provenance.

A number of a PBPK model is a Value: the number, its unit and where it comes from (a key of data/sources.toml, see pkpdsim.pbpk.data). A fitted value is a Value as well, from the keyword arguments of a fit record. A value which is tied to other parameters (a metabolite with the Kp of its parent, a fixed ratio) is a Formula over ids of the top model, written as the initial assignment of its parameter. A constant which no field of the library holds is a ModelParameter with such a value.

SID module-attribute

SID = re.compile('[A-Za-z_][A-Za-z0-9_]*')

An SBML SId, the ids of a definition (substances, processes, parameters).

Q

Q = float | Value | Formula

A number, plain or with unit and provenance, or a formula.

Value dataclass

Value(
    value, unit, source=None, notes=None, uncertainties=None
)

A number with unit and provenance.

Attributes:

Name Type Description
value float

the number.

unit UnitType

the unit of the number.

source str | None

the key of the source in data/sources.toml, fit for a fitted value.

notes str | None

a remark on the value.

uncertainties list[Uncertainty] | None

the uncertainty of a fitted value.

Formula dataclass

Formula(expression, unit, notes=None)

A value tied to other parameters: a formula over ids of the top model.

The parameter of the value gets the formula as its initial assignment, as the covariates do: a change of a parameter it reads before the simulation is followed, and an id of PBPKDefinition.dynamic keeps it an assignment rule. The ids of the formula are constant parameters and compartments of the top model (the parameters of the substances, the covariates, the physiology), also for a value of an organ, which reads them through input ports under the same ids; the build refuses an id the top model does not have and the species and observers (they change during the simulation). The unit is the unit of the parameter, it is not inferred from the formula.

One exception reads the ids of an organ instead: the steady state of a custom reaction (CustomReaction.stationary) is a Formula of the organ, as its rate law, over the elements of the organ (Vti, the parameters of the reaction, species of other substances at their start) and constants of the top model; the Formula of a ModelParameter of a custom reaction reads the constants of its organ which are no ids of the top model as well (another parameter of a custom reaction of the organ, Vti); every other Formula (a value, a parameter of the definition, a start of PBPKDefinition.starts, a baseline) reads the ids of the top model only.

Attributes:

Name Type Description
expression str

the formula (SBML L3 infix), e.g. Kp_gli or ftissue_gli * fu_ref_gli / fu_ref_gli_m1.

unit UnitType

the unit of the parameter.

notes str | None

a remark on the value, e.g. why it is tied.

ModelParameter dataclass

ModelParameter(sid, value, unit, name=None, notes=None)

A constant parameter which the model package states, with its provenance.

In PBPKDefinition.parameters a constant of the top model which no field of the library holds (a production rate which the baseline of a substance and a custom reaction of the muscle share): the formulas of the definition, its observers and the custom reactions of the organs read it under its id, an organ through an input port under the same id. In CustomReaction.parameters a constant of the organ of the reaction (a fitted constant of the mechanism): a local id of the organ, which the reactions of the organ read, <ORGAN>__<id> in the flat model.

Attributes:

Name Type Description
sid str

the id of the parameter, an id of the top model which is no id of the library, or a local id of the organ.

value Q

the number in unit, a Value (a fitted value with its uncertainty, fitted(FITS.parameter(pid, unit=...))) or a Formula over ids of the top model (its initial assignment); a Value or a Formula is in unit.

unit UnitDefinition

the unit of the parameter.

name str | None

the name of the parameter, the id by default.

notes str | None

the notes of the parameter, e.g. its meaning and source.

FrozenMap

FrozenMap(items)

Bases: Mapping[str, V]

A read-only, hashable mapping from an id to a value.

The mapping fields of the frozen dataclasses of a definition (the values per substance of the intestine, PerSubstance; the starts of the species, PBPKDefinition.starts; the regional absorption profiles per substance, whose values are profiles) are kept as this copy: it reads back as a Mapping (ka["a"], .items()), cannot be changed after the validation and is hashed by its items (a dict is unhashable).

Copy the items.

fitted

fitted(kwargs, source='fit', notes=None)

Get the value of a fitted parameter.

Parameters:

Name Type Description Default
kwargs Mapping[str, Any]

the keyword arguments of FitRecords.parameter(pid, unit=...): value, uncertainties and unit.

required
source str

the provenance of the value.

'fit'
notes str | None

a remark on the value, e.g. the literature of the process; the provenance of the fit is in the uncertainties.

None

Returns:

Type Description
Value

The value with the uncertainty of the fit.

equal_by_value

equal_by_value(a, b)

Compare two parts of a definition by their values.

The objects of sbmlutils which a definition holds (the Uncertainty of a fitted value, a Parameter or Species of a custom reaction) have no equality of their own and compare by identity, so two definitions which take the same fitted value from a fit record (fitted(FITS.parameter(...)) creates new uncertainties at every call) would differ. Here a dataclass is equal by its equality (PDComponent by the id of its model, its inputs and outputs) or by its fields, a mapping by its items, a list or tuple by its elements, and an object which compares by identity by the fields of its __dict__, each by value; every other object (numbers, strings, enum members, a Creator) by ==.

Parameters:

Name Type Description Default
a object

the one object.

required
b object

the other object.

required

Returns:

Type Description
bool

Whether they are equal by value.

as_value

as_value(x, unit)

Get a value of a number, a value or a formula.

Parameters:

Name Type Description Default
x Q

a number, which gets the unit, or a value or a formula, which is returned as it is.

required
unit UnitType

the unit of a number.

required

Returns:

Type Description
Value | Formula

The value or the formula.

number

number(q)

Get the number of a plain float or a Value, None for none or a Formula.

check_positive

check_positive(where, name, q)

Check that a number is positive.

check_unit

check_unit(where, name, q, unit)

Check that a Value is given in the unit of its parameter.

The numbers of a definition are in the units of the model; a Value in another unit (an exchange in l/min where one per litre of organ is meant) would be taken as it is.

unit_text

unit_text(unit)

The definition of a unit, e.g. 1/min, the id of a unit of a kind (dimensionless).

check_literals

check_literals(obj)

Check the fields of a dataclass which are typed with a Literal.

A definition written in a script or a notebook may give any text: a text which is none of the choices would select no branch of the builder (a route without doses, an erythrocyte mode treated as another), so it raises.

Parameters:

Name Type Description Default
obj object

the dataclass instance.

required

Raises:

Type Description
ValueError

if a field holds none of its choices, naming the field and the allowed values.

data

The data files of the PBPK library.

The data are TOML files in pkpdsim/pbpk/data. A number is a table { value = 1.8, unit = "kg", source = "ICRP89" } whose source is a key of sources.toml, so every number states where it comes from.

Source dataclass

Source(key, citation, doi=None)

A publication a number is taken from.

Attributes:

Name Type Description
key str

the key of the source, e.g. ICRP89.

citation str

the citation.

doi str | None

the DOI of the publication.

load

load(name)

Load a data file.

Parameters:

Name Type Description Default
name str

the name of the file without extension, e.g. sources.

required

Returns:

Type Description
dict[str, Any]

The content of data/<name>.toml, a copy which the caller may change.

value

value(name, section, key)

Get a number of a data file with its unit, source and notes.

Parameters:

Name Type Description Default
name str

the name of the file without extension, e.g. routes.

required
section str

the table of the number.

required
key str

the key of the number in the table.

required

Returns:

Type Description
Value

The value.

Raises:

Type Description
ValueError

if the unit of the number is not a unit of the model.

sources cached

sources()

Get the sources by their key.

cite

cite(key)

Get the citation of a source with its DOI.

Parameters:

Name Type Description Default
key str

the key of the source.

required

Returns:

Type Description
str

The citation, followed by the DOI if the source has one.

Raises:

Type Description
KeyError

if no source has the key.

units

The units of the PBPK models.

Time is in min, substance in mmole, volume in litre and area in m2, the model_units of the models. Every unit of U is a unit definition of every model; a unit outside U (EXTRA_UNITS, ML_PER_MIN_1P73M2) is one only of a model which uses it.

ML_PER_MIN_1P73M2 module-attribute

ML_PER_MIN_1P73M2 = UnitDefinition(
    "ml_per_min_1p73m2",
    "ml/min/(1.73*meter^2)",
    name="ml/min/1.73 m2",
)

Millilitre per minute per 1.73 m2 body surface area, the unit of a clearance or a GFR per body surface area (eGFR, CLrenal/BSA).

1 ml/min/1.73 m2 = 1e-3/1.73 l/min/m2: a quantity in l/min divided by the body surface area BSA (m2) is 1730 times the number in this unit, in consistent units GFR / BSA * 1730 ml_per_min_1p73m2 * 1 m2 / 1 l_per_min. Not a unit of U, so the models without it keep their unit definitions; a model defines it wherever it uses it (an observer, a parameter of the definition, a custom reaction, a number of a formula).

EXTRA_UNITS module-attribute

EXTRA_UNITS = (ML_PER_MIN_1P73M2,)

The units of the library outside U: a model defines one when it uses it, as the unit of an element or by its id in a formula.

UNIT_LABELS module-attribute

UNIT_LABELS = MappingProxyType(
    {"ml_per_min_1p73m2": "ml/min/1.73\xa0m²"}
)

The text of a unit of EXTRA_UNITS on a figure, by the unit id.

sbmlsim writes a unit which pint does not read (a unit id of the model, ml_per_min_1p73m2) on an axis as it is given; the figures show this text instead (unit_label, axis). The words of a text are joined by a non-breaking space (U+00A0, 1.73 m²): sbmlsim wraps a label which is longer than its axis at its spaces, and a unit is not broken. The unit definition keeps its name in the SBML.

U

Bases: Units

UnitDefinitions.

unit_label

unit_label(unit)

The text of a unit on a figure.

Parameters:

Name Type Description Default
unit str | None

the unit of an axis, a unit id of the model or a unit which pint reads.

required

Returns:

Type Description
str

The text of UNIT_LABELS for a unit of EXTRA_UNITS by id, else the

str

short form of sbmlsim (h for hr, empty for dimensionless).

axis

axis(label, unit, **kwargs)

An axis of sbmlsim in a unit, with the text of the unit on the figure.

The unit stays what the data and the model are converted to (ml_per_min_1p73m2, a unit of the model), the label of the axis is <label> [<unit_label(unit)>]: a clearance per body surface area reads [ml/min/1.73 m²], not the unit id which sbmlsim writes.

Parameters:

Name Type Description Default
label str

the label of the axis.

required
unit str | None

the unit of the axis.

required
**kwargs Any

further arguments of sbmlsim.plot.Axis (scale, min, ...).

{}

Returns:

Type Description
Axis

The axis, its name the label with the text of the unit.