Skip to content

pbpk kidney validity

The simulated individual and the validity of the kidney outflow: the filtered plasma water (the GFR) and the net filtered plasma flow of a substance below the plasma flow of the kidney, which the experiments of a model built on the PBPK library check for every individual they simulate, see Standard organ and Impairment.

The simulated individual and the validity of the kidney outflow.

The plasma leaving the kidney lacks the net filtrate, so the outflow of the kidney is valid while the filtered plasma water is below the plasma flow of the kidney, GFR < Qki*(1 - HCT) (the glomeruli filter the water of the plasma which flows through them, independent of the substances), and the net filtered plasma flow of every substance is below the flow which carries it, fu*GFR*(1 - f_reabsorbed) < Qki*(1 - HCT) (Qki*BP with erythrocytes in equilibrium, fu*GFR with a threshold reabsorption, whose fraction falls to 0 at a high concentration). The water bounds the renal function of every model which filters a substance (a PD component which filters the water at the GFR, the fluid of hctz, as well); with fu <= 1 and BP >= 1 - HCT it is the tighter bound of the two. A model without a filtered substance is not simulated and has no bound. GFR, flow, hematocrit and fu are initial assignments of the parameters of the individual, so kidney_outflow reads them for an individual, the changes of a simulation before its initialization, from a simulation of one minute (individual_values, which healthy_gfr reads the GFR with as well), and simulated_individuals gives the individuals a simulation or a scan of an experiment simulates. PBPKSimulationExperiment (pkpdsim.pbpk.experiment) checks them all when it is initialized.

What makes an individual is the changes of the ids which the flows depend on through initial assignments and assignment rules of the flat model, so a dose makes no individual. The values are cached per model file, its modification time and the individual, and the model is parsed and loaded once per process (pkpdsim.pbpk.flat_model, shared with the equilibration). The check reads the start of a simulation: its changes before the initialization (of its presimulation as well) and the values of the dimensions of a scan without a time. It does not check a change during a simulation (Simulation.changes, also at its start, of an id the definition names dynamic), a dimension with a time (at), a scan over models and the draws of the fitted parameters of a run over them (pkpdsim.uncertainty).

The module imports sbmlsim; pkpdsim.pbpk exports its names lazily, so import pkpdsim.pbpk (a factory) imports no simulator.

KidneyOutflow dataclass

KidneyOutflow(
    substance,
    gfr,
    filtered,
    plasma_flow,
    formula="fu*GFR*(1 - f_reabsorbed)",
)

The net filtered plasma flow of a substance or the plasma water, and the plasma flow of the kidney.

The outflow of the kidney is valid while the net filtered plasma flow is below the plasma flow which carries the substance through the kidney; the filtered plasma water (substance None, the formula GFR) is valid while the GFR is below the plasma flow of the kidney.

Attributes:

Name Type Description
substance str | None

the substance, filtered into the urine; None for the water of the plasma, which the glomeruli filter at the GFR.

gfr float

the GFR of the individual [ml/min].

filtered float

the net filtered plasma flow [ml/min], see formula.

plasma_flow float

the flow which carries the substance through the kidney, Qki*(1 - HCT), Qki*BP with erythrocytes in equilibrium [ml/min].

formula str

the formula of the net filtered plasma flow: fu*GFR*(1 - f_reabsorbed), fu*GFR with a threshold reabsorption (its fraction falls to 0 at a high concentration), GFR of the water.

valid property

valid

Whether the net filtered plasma flow is below the plasma flow.

text

text()

Describe the flows, for a message.

IndividualValues dataclass

IndividualValues(numbers, units)

The start values of an individual, in the units of the model.

Attributes:

Name Type Description
numbers Mapping[str, float]

id -> the value at the start.

units Mapping[str, str]

id -> its unit.

number

number(sid)

Get the value of an id in the unit of the model.

ml_per_min

ml_per_min(sid)

Get the value of a flow in ml/min.

covariate_changes

covariate_changes(
    bw,
    height,
    hf_severity,
    cp_severity,
    renal_function=None,
)

Get the changes before the initialization of an individual by its covariates.

Parameters:

Name Type Description Default
bw float | None

the body weight [kg], None for that of the model.

required
height float | None

the height [cm], None for that of the model.

required
hf_severity float

the severity of heart failure HF_severity (0 to 4).

required
cp_severity float

the severity of cirrhosis CP_severity (0 to 3).

required
renal_function float | None

the renal function f_renal_function, None for that of the model.

None

Returns:

Type Description
dict[str, Value]

The changes, quantities.

kidney_outflow

kidney_outflow(model_path, changes=None)

Get the net filtered plasma flows and the plasma flow of the kidney of an individual.

The filtered plasma water first (substance None, GFR against Qki*(1 - HCT)), then one KidneyOutflow for every substance which the kidney filters (its filtration reaction is in the model), read from the start values of the individual (individual_values). A model without a filtered substance has no outflow of its kidney to check and is not simulated (its GFR is no flow of the library), nor is a model without the GFR, the flow of the kidney and the hematocrit (no model of the library).

Parameters:

Name Type Description Default
model_path Path

the flat SBML model of the library.

required
changes Mapping[str, Value] | None

the changes of the individual before the initialization (Simulation.preinit_changes), numbers in the units of the model or quantities.

None

Returns:

Type Description
KidneyOutflow

The flows of the water and of every filtered substance, in the order

...

of the model.

individual_values

individual_values(model_path, changes)

Get the start values of the flows of the kidney outflow and GFR_base of an individual.

The values are initial assignments, so they are read from a simulation of one minute with the changes before the initialization, which evaluates the initial assignments again. Only the changes of the ids which the values depend on make the individual (simulated_individuals), and the values are cached per model file, its modification time and the individual: a model file which is created again is simulated again.

Parameters:

Name Type Description Default
model_path Path

the flat SBML model of the library.

required
changes Mapping[str, Value]

the changes of the individual before the initialization.

required

Returns:

Type Description
IndividualValues

The values of GFR, GFR_base, Qki, HCT and of the filtered

IndividualValues

substances fu_<s>, BP_<s> and f_reabsorbed_<s>.

simulated_individuals

simulated_individuals(simulation, model_path)

Get the individuals a simulation or a scan simulates on a model, each once.

An individual is the changes before the initialization of the ids which the flows of the validity depend on, at the start of the simulation: of its presimulation and of itself, of every simulation of a dimension of simulations and of every point of the dimensions of values without a time (Simulation.with_values). A dimension with a time, the draws of the fitted parameters (pkpdsim.uncertainty) and the changes during a simulation are not read, and a scan over models has no individual of this model.

Parameters:

Name Type Description Default
simulation Simulation | Scan

a simulation or a scan of an experiment.

required
model_path Path

the flat SBML model the simulation runs.

required

Returns:

Type Description
list[dict[str, Value]]

The changes of every individual.

changes_text

changes_text(changes)

Describe the changes of an individual, for a message.