Skip to content

pbpk liver lobes

The lobes of the liver: the lobe sets of the species, the lobed liver variant, the remodelling of the anatomy and the interventions on the lobes, see Liver lobes.

lobes

The lobes of the liver: the sets of a species, their shares and the configuration.

The liver of a model is one organ with one hepatic artery inflow, one portal vein inflow and one hepatic vein outflow, so everything it says is a statement about the whole organ. A lobed liver splits it along a second spatial axis, parallel to the zones along the sinusoid: one chain per lobe, each with its own mass, its own arterial and portal inflow and its own drainage, so that the perfusion of a deportalised lobe, the exposure of a lobe which lives on arterial blood alone and the function left after a resection are quantities of the model.

A Lobe carries the share of the liver mass of a lobe and, when a source gives them, its shares of the arterial and of the portal inflow. No supply fraction was found for any species, so a lobe without one is supplied in proportion to its mass: a Couinaud segment is defined as a portal territory and the hepatic artery branch runs with the portal branch in the portal triad, which makes an equal perfusion per mass the defensible default. The measured perfusion per lobe of a portal vein ligation study is the test of it.

The sets of the species are the tables database/tables/liver_lobes_{human,rat,mouse}.toml: the anatomical lobes for the rodents (the regions a lobe resolved study reports) and the eight Couinaud segments for the human (the units of a planned resection or a portal vein embolisation). The pig has a physiology table but no lobe data was sought, so it has no lobes.

This module is configuration: it holds no SBML. HABR configures the hepatic arterial buffer response, whose objects pkpdsim.pbpk.cardiovascular writes, and Remodelling is the protocol of a driver of the lobe masses, whose implementations are in pkpdsim.pbpk.remodelling.

LOBE_SPECIES module-attribute

LOBE_SPECIES = frozenset(
    {Species.HUMAN, Species.RAT, Species.MOUSE}
)

The species with a lobe set; the pig has a physiology but no lobe data.

TOLERANCE module-attribute

TOLERANCE = 1e-06

How far the shares of a lobe set may miss 1.

Lobe dataclass

Lobe(
    token,
    name,
    mass_fraction,
    arterial_fraction=None,
    portal_fraction=None,
    annotation=None,
)

A lobe of the liver with its share of the mass and of the blood supply.

Attributes:

Name Type Description
token str

the token of the lobe in the ids of the model, e.g. lll (the left lateral lobe of the rat) or sg8 (Couinaud segment VIII). A lower case identifier; it joins the zone token of a zonated liver into the site <lobe>_<zone>.

name str

the name of the lobe, for the name of its elements.

mass_fraction Value

the share of the liver mass of the lobe; the shares of a set sum to 1.

arterial_fraction Value | None

the share of the hepatic artery inflow, None for the share of the mass.

portal_fraction Value | None

the share of the portal vein inflow, None for the share of the mass.

annotation str | None

the term of an ontology for the lobe, None for a lobe whose term was not researched.

arterial_share

arterial_share()

The share of the hepatic artery inflow, the share of the mass without one.

portal_share

portal_share()

The share of the portal vein inflow, the share of the mass without one.

HABR dataclass

HABR(gain=_habr_gain(), maximum=2.0)

The hepatic arterial buffer response of a lobe.

The hepatic artery of a territory whose portal inflow falls dilates, so a deportalised lobe is not simply ischaemic. The conductance of the arterial branch of a lobe rises with the portal flow which is missing, measured against the arterial reference of the lobe (Lautt: the artery compensates a fraction of the lost portal flow): 1 + gain*max(0, Qpo_ref_<lobe> - Qpo_<lobe>)/Qha_ref_<lobe>, capped at maximum. Without a buffer response (None in the lobed liver, the default) the arterial branches do not react, which is what a model without lobes does today. The response acts on a conductance, so it needs the pressure driven circulation (PressureFlow); a lobed liver which asks for it without one is refused at the definition.

Attributes:

Name Type Description
gain Value

the fraction of a lost portal flow the artery compensates, None for the measured default of the table (liver_remodelling.toml, 0.255 of Lautt 1985; Lautt 1990 reports 0.44 with the passive pressure effect included).

maximum float

the largest factor the arterial conductance reaches, so that a fully deportalised lobe does not take an unbounded arterial flow.

Remodelling

Bases: Protocol

A driver of the lobe masses after an intervention.

A lobe which loses its portal inflow atrophies and its neighbours hypertrophy. A driver says how: pkpdsim.pbpk.remodelling.FlowDriven grows a lobe towards the mass at which its perfusion per mass is back at the target, which predicts a ligation pattern it was not fitted to; PrescribedVolume and PrescribedFlow follow a measured time course, which replays the data. Both write the same ids.

name property

name

The name of the driver, for the notes of its elements.

objects

objects(lobes, species)

Get the SBML objects which drive the masses of the lobes.

lobe_table_name

lobe_table_name(species)

The name of the table of the lobe set of a species.

Parameters:

Name Type Description Default
species Species

the species.

required

Returns:

Type Description
str

The name of the table without extension, liver_lobes_<species>.

Raises:

Type Description
ValueError

for a species without a lobe set, naming it and the species which have one.

check_lobes

check_lobes(lobes)

Check a lobe set and return it.

Parameters:

Name Type Description Default
lobes Sequence[Lobe]

the lobes.

required

Returns:

Type Description
tuple[Lobe, ...]

The lobes as a tuple, in the order they were given.

Raises:

Type Description
ValueError

for an empty set, a token which is no lower case identifier, a token which carries an underscore (it would not be told from the site <lobe>_<zone> of another lobe), a repeated token, a negative share of the mass or of an inflow, mass fractions which do not sum to 1, or supply fractions which do not sum to 1 when any lobe gives them.

lobe_table

lobe_table(species)

Get the lobe set of a species from its table.

Parameters:

Name Type Description Default
species Species

the species.

required

Returns:

Type Description
tuple[Lobe, ...]

The lobes in the order of the table.

Raises:

Type Description
ValueError

for a species without a lobe set, or for a table whose shares are not a lobe set (check_lobes).

variants.liver_lobes

The lobed liver: the liver as lobes perfused in parallel.

The liver of the standard organ is one chain fed by the hepatic artery and the portal vein. The lobed liver is one chain per lobe: each lobe holds its share of the liver volume (f_vol_<lobe>), is fed at its own flows (Qha_<lobe>, Qpo_<lobe>) and drains at its own concentration (Cout_<lobe>_<s>), and the body receives the flow weighted mix of the lobes under the unchanged id Cout_<s>. The whole organ flows Qha, Qpo and Qh are the sums of the lobe flows, so every consumer of them (the observers, the steady state, the PK and the pressure driven circulation) reads what it read before.

The lobe and the zone are the two spatial axes of the liver and they compose: the lobes are perfused in parallel, the zones of a lobe in series along its sinusoid, and a site (ids.site) carries both. The single lobe liver is the liver without lobes, exactly as the single zone liver is the liver without zones: it emits no lobe token and no lobe parameter, so a model which asks for one lobe is the standard liver.

Each lobe is supplied in proportion to its reference supply share, which the lobe table gives or which is the share of its mass, renormalized over the patent lobes: a lobe whose branch is closed (g_po_<lobe> 0, portal vein ligation) passes its flow to the lobes which are open, which is what happens when the splanchnic bed keeps delivering its blood to a liver with one branch less. With the pressure driven circulation the flows come from per lobe vascular branches instead, through the same ids.

MAX_SITES module-attribute

MAX_SITES = 40

How many sites (lobes times zones) a liver may have.

A model choice: a site carries the parts of the liver for every substance, and the tests of the PBPK library compile their models at O0, so a liver of 40 sites with the six layers of the sinusoid geometry is the largest the suite builds in its budget. The eight Couinaud segments therefore take at most five zones each; raise it knowingly.

LobedLiver dataclass

LobedLiver(
    lobes=None,
    zonation=None,
    remodelling=None,
    habr=None,
    name="lobes",
)

The liver as lobes perfused in parallel.

Attributes:

Name Type Description
lobes Sequence[Lobe] | None

the lobes, None for the set of the species (pkpdsim.pbpk.lobes.lobe_table: the anatomical lobes of rat and mouse, the eight Couinaud segments of the human). The shares of the mass sum to 1, the tokens are unique lower case identifiers.

zonation ZonatedLiver | None

the zonation of every lobe, None for lumped lobes. Each lobe is then the zonated liver of this setting, with its share of the volume and of the flow.

remodelling Remodelling | None

the driver of the lobe volumes during a simulation, None for a constant anatomy. A deportalised lobe atrophies and its neighbours hypertrophy; the driver says how (pkpdsim.pbpk.remodelling).

habr HABR | None

the hepatic arterial buffer response, None for arterial branches which do not react to a lost portal inflow.

name str

the name of the component, the prefix of the id of the model definition (lobes_li).

lobe_set

lobe_set(species)

The lobes of the component, the set of a species where it gives none.

Parameters:

Name Type Description Default
species Species

the species of the build.

required

Returns:

Type Description
tuple[Lobe, ...]

The lobes.

Raises:

Type Description
ValueError

for a species without a lobe set, or for more sites than MAX_SITES.

resolved

resolved(ctx)

The lobes of the component in the context of a build.

body_objects

body_objects(definition)

Get the anatomy, the supply and the flows of the lobes in the top model.

Parameters:

Name Type Description Default
definition PBPKDefinition

the definition of the model.

required

Returns:

Type Description
list[Sbase]

The objects of the top model, none for a liver of one lobe (it is

list[Sbase]

the liver without lobes).

Raises:

Type Description
ValueError

for a species without a lobe set.

build

build(ctx)

Build the model of the lobed liver and its boundary.

A liver of one lobe is the liver without lobes: the standard liver, or the zonated liver of the zonation of the component.

Parameters:

Name Type Description Default
ctx OrganContext

the context of the liver.

required

Returns:

Type Description
tuple[ModelDefinition, Boundary]

The model definition and the boundary.

Raises:

Type Description
ValueError

if the organ is not the liver, the species has no lobe set, there are more sites than MAX_SITES, or the liver refuses a substance or a process (the standard and the zonated liver).

LobedBuilder

LobedBuilder(ctx, liver, lobes)

Bases: ZonatedBuilder

The SBML objects of the lobed liver: the chains of the lobes in parallel.

It is the builder of the zonated liver with a second axis: the lobes are the parallel chains, the zones the steps along each chain, and a site (ids.site) carries both. A lumped lobed liver has no zone token, as the zonated liver of one lobe has no lobe token.

Start the collection of the elements of the lobed liver.

Parameters:

Name Type Description Default
ctx OrganContext

the context of the liver.

required
liver LobedLiver

the component.

required
lobes Sequence[Lobe]

the resolved lobes.

required

Raises:

Type Description
ValueError

for another organ than the liver, or whatever the zonated liver refuses (a process it cannot place, a species without the geometry of the sinusoid).

lobe_objects

lobe_objects(lobes, *, pressure=False)

Get the objects of the top model of a lobe set.

The shares of the volume and of the inflows, the patency of the branches, the volume, the three blood flows and the perfusion per volume of every lobe, and the remnant fraction of the liver.

Parameters:

Name Type Description Default
lobes Sequence[Lobe]

the lobes, a checked set.

required
pressure bool

whether the flows come from the pressure driven circulation (pressure_objects) instead of the shares of the inflows of the liver; the flows are then variables of the network and this function leaves them to it.

False

Returns:

Type Description
list[Sbase]

The objects.

pressure_objects

pressure_objects(lobes, habr)

Get the per lobe vascular network of the pressure driven circulation.

One sinusoidal node per lobe with three branches to it, the hepatic artery, the portal vein and the hepatic vein, whose volume balance solves the pressure of the lobe; the flows of the liver are the sums of the lobe flows and the sinusoidal pressure of the liver is their flow weighted mean, so the ids the rest of the model reads are unchanged. The splanchnic bed therefore delivers its blood into a liver with one branch fewer after a ligation and the portal pressure rises, which a prescribed flow cannot show.

The outflow of a lobe is deliberately not clamped at a positive pressure difference, as the branches of the whole liver circulation are: the balance is then linear in the pressure of the lobe and has the one solution P_ve + (Qha + Qpo) * R_h, so a lobe whose both branches are closed sits at the venous pressure and carries no flow instead of leaving the solver an under determined node. The two inflows are never negative, so the outflow never is either.

Parameters:

Name Type Description Default
lobes Sequence[Lobe]

the lobes, a checked set.

required
habr HABR | None

the hepatic arterial buffer response, None for a model without one.

required

Returns:

Type Description
list[Sbase]

The objects of the top model.

remodelling

The remodelling of the lobes of the liver: the anatomy follows the simulation.

A lobe which loses its portal inflow atrophies and the lobes which keep theirs hypertrophy, over days: the volume of a lobe (Vli_<lobe>) is therefore a state of the model and not a constant of the individual, and its share of the liver f_vol_<lobe> follows it. The driver of a LobedLiver says what moves it, and every driver moves it through the one quantity dVli_<lobe> (l/min), the growth of the lobe, so the liver always knows how fast it is losing tissue and what that tissue carries away.

Two kinds of driver, both of which a study needs:

  • FlowDriven predicts the remodelling. The stimulus is the perfusion per volume of the lobe against the reference perfusion of the liver, which is what the hyperperfusion of the remnant after a resection and the hypoperfusion of a deportalised lobe after a ligation are: a lobe which is perfused above the reference grows, one below it shrinks, and the liver comes to rest when every lobe is at the reference again.
  • PrescribedVolume and PrescribedFlow map a measured course onto the model: the volume of a lobe over time, as an imaging study reports it, or its growth rate.

The tissue a lobe loses carries its content away. The state of a species of the liver is its amount, so a lobe which grows dilutes what it holds by itself, which is what growing tissue does; a lobe which shrinks would concentrate it instead, which no tissue does. The remodelling therefore emits one flux per species and part of a shrinking lobe into the sink Aremodelled_<s>, A*max(0, -dVli_<lobe>)/Vli_<lobe>, so that the concentration of a shrinking lobe is left alone and the amount which left the body is auditable.

REMODELLING_SINK module-attribute

REMODELLING_SINK = 'Aremodelled'

The prefix of the sink of the tissue a lobe has lost, Aremodelled_<s>.

VREMODELLED module-attribute

VREMODELLED = 'Vremodelled'

The nominal compartment of the sink of the remodelling.

K_GROWTH module-attribute

K_GROWTH = 'k_growth'

The id of the rate constant of the flow driven growth of a lobe (1/min).

Q_TARGET module-attribute

Q_TARGET = 'q_li_target'

The id of the perfusion per volume a flow driven lobe grows towards (1/min).

TAU_TRACK module-attribute

TAU_TRACK = 'tau_track'

The id of the tracking time of a prescribed lobe volume (min).

FlowDriven dataclass

FlowDriven(
    k=_k_growth(),
    target=None,
    total_cap=False,
    name="flow_driven",
)

The predictive driver: a lobe grows towards the reference perfusion per volume.

dVli_<lobe> = f_present_<lobe>*k_growth*Vli_<lobe>*(q_<lobe>/q_target - 1), the stimulus being the perfusion per volume of the lobe against the reference perfusion of the liver. The remnant after a resection carries the whole hepatic inflow in a fraction of the volume, so it is perfused above the reference and grows; a lobe whose portal branch is ligated keeps its arterial inflow only, so it is perfused below the reference and atrophies. The liver comes to rest when every lobe is at the reference perfusion again, which is the intact liver, so the law needs no ceiling of its own; total_cap adds one for a study which wants a hard limit.

Attributes:

Name Type Description
k Value

the rate constant of the growth (1/min), the relative growth of a lobe at twice the reference perfusion. A model choice to be fitted, not a measured constant (pkpdsim.database.tables.liver_remodelling).

target Value | None

the perfusion per volume a lobe grows towards (1/min), None for the reference perfusion of the liver of the individual, Qh/Vli.

total_cap bool

the growth of a lobe is scaled by max(0, 1 - Vli_lobes/Vli_ref), so the liver cannot grow past the volume of the intact organ whatever the perfusion is. It is off by default: the perfusion stimulus already brings the liver to rest at the intact volume, and the cap slows the whole approach to it.

name str

the name of the driver.

objects

objects(lobes, species)

Get the constants, the growth and the rate rules of the flow driven growth.

PrescribedVolume dataclass

PrescribedVolume(
    curves=dict(),
    tau=_tau_track(),
    name="prescribed_volume",
)

The data driven driver: a lobe follows a measured volume over time.

The volume of a lobe is a state which tracks the given curve with the time constant tau_track, dVli_<lobe> = (Vli_target_<lobe> - Vli_<lobe>)/tau_track, and not an assignment rule of the curve itself: the growth of a lobe has to be a quantity of the model, since the liver reads it for the tissue a shrinking lobe carries away, and the rate of change of an assignment rule is not available to a rate law. One hour is fast against the days of liver remodelling, and the state lags the curve by the tracking time times its slope.

Attributes:

Name Type Description
curves Mapping[str, Formula]

the volume of a lobe over time (l), by lobe token; a lobe without a curve keeps its volume. The formula reads the constants of the top model and time, as every Formula of the library does (Vli_ref is the volume of the intact liver).

tau Value

the tracking time (min).

name str

the name of the driver.

objects

objects(lobes, species)

Get the targets, the tracking time, the growth and the rate rules.

Raises:

Type Description
ValueError

for a curve which names no lobe of the liver.

PrescribedFlow dataclass

PrescribedFlow(curves=dict(), name='prescribed_flow')

The data driven driver: a lobe grows at a measured rate over time.

dVli_<lobe> is the given curve, so the volume of the lobe is its integral. It is the driver of a study which reports the growth rate of a lobe instead of its volume, and the exact form of PrescribedVolume, which has to track its course.

Attributes:

Name Type Description
curves Mapping[str, Formula]

the growth of a lobe over time (l/min), by lobe token; a lobe without a curve keeps its volume.

name str

the name of the driver.

objects

objects(lobes, species)

Get the growth and the rate rules of the prescribed growth.

Raises:

Type Description
ValueError

for a curve which names no lobe of the liver.

remodelling_sink

remodelling_sink(s)

The id of the sink of the tissue a lobe has lost, Aremodelled_<s> (mmole).

lobe_target

lobe_target(lobe)

The id of the prescribed volume a lobe follows, Vli_target_<lobe> (l).

lobes_dynamic

lobes_dynamic(definition)

The quantities of the lobes which change during a simulation.

The patency of the two branches of a lobe and its presence, which an intervention changes, and the volumes of the lobes where a driver moves them. The quantities of the top model and of the organs which read them (the lobe flows, the share of a lobe, the compartments of its sites, its perfusion) must follow them, so they are the seeds of pkpdsim.pbpk.builder._dynamic.

Parameters:

Name Type Description Default
definition PBPKDefinition

the definition.

required

Returns:

Type Description
tuple[str, ...]

The ids, empty for a liver without lobes.

Raises:

Type Description
ValueError

for a species without a lobe set.

sink_objects

sink_objects(definition)

Get the sink of the remodelling: the tissue the lobes have lost.

Parameters:

Name Type Description Default
definition PBPKDefinition

the definition.

required

Returns:

Type Description
list[Sbase]

The nominal compartment and one amount species per substance.

interventions

The interventions on the lobes of the liver: ligation and resection.

An intervention is a set of changes of parameters of the model, as the impairment maps of the library are (pkpdsim.pbpk.impairment): the models of the library have no events, so a study applies the changes before a simulation or between the phases of one, which is what a surgery at a time point is. Three procedures:

  • PortalLigation closes the portal branch of its lobes (g_po_<lobe> 0). The lobes keep their hepatic artery inflow, so they stay perfused below the reference and atrophy, and the lobes which keep their portal inflow take over the portal flow and hypertrophy. It is the portal vein ligation or embolisation which grows the future liver remnant before a hepatectomy.
  • ArterialLigation closes the hepatic artery branch instead; both together devascularise a lobe.
  • Resection removes its lobes: both branches close, f_present_<lobe> goes to 0, so the lobe has no capacity and no growth, and the remnant fraction of the liver falls to the share which is left.

An occlusion acts on the conductance of a branch and never on its resistance, so no rate law divides by zero and a liver whose every branch is closed is simply a liver without inflow.

The named procedures of the literature are the scenarios of pkpdsim.database.tables.liver_interventions, one set per species: scenarios(species) gives them as interventions and scenario_changes(species) as the parameter maps which an experiment reads.

Intervention module-attribute

An intervention on the lobes of the liver.

PortalLigation dataclass

PortalLigation(lobes, name='portal_ligation')

The portal vein ligation of a set of lobes.

Attributes:

Name Type Description
lobes tuple[str, ...]

the tokens of the lobes whose portal branch is closed.

name str

the name of the intervention.

Take the lobes in the order they are given.

changes

changes(of_liver)

The parameter changes of the ligation.

Parameters:

Name Type Description Default
of_liver Sequence[str]

the lobe tokens of the liver of the model.

required

Returns:

Type Description
dict[str, float]

The conductance of the portal branch of every ligated lobe, 0.

Raises:

Type Description
ValueError

for a lobe which the liver does not have, or none.

ArterialLigation dataclass

ArterialLigation(lobes, name='arterial_ligation')

The hepatic artery ligation of a set of lobes.

Attributes:

Name Type Description
lobes tuple[str, ...]

the tokens of the lobes whose hepatic artery branch is closed.

name str

the name of the intervention.

Take the lobes in the order they are given.

changes

changes(of_liver)

The parameter changes of the ligation.

Parameters:

Name Type Description Default
of_liver Sequence[str]

the lobe tokens of the liver of the model.

required

Returns:

Type Description
dict[str, float]

The conductance of the arterial branch of every ligated lobe, 0.

Raises:

Type Description
ValueError

for a lobe which the liver does not have, or none.

Resection dataclass

Resection(lobes, name='resection')

The resection of a set of lobes: a hepatectomy.

Both branches of the lobe close and the lobe is no longer in place, so it holds no capacity, does not grow and leaves the remnant fraction of the liver. What the lobe still held stays in it, cut off from the circulation; a study which wants the content of the resected tissue removed as well sets the species of the lobe to 0 in the same step.

Attributes:

Name Type Description
lobes tuple[str, ...]

the tokens of the lobes which are removed.

name str

the name of the intervention.

Take the lobes in the order they are given.

changes

changes(of_liver)

The parameter changes of the resection.

Parameters:

Name Type Description Default
of_liver Sequence[str]

the lobe tokens of the liver of the model.

required

Returns:

Type Description
dict[str, float]

Both conductances and the presence of every removed lobe, 0.

Raises:

Type Description
ValueError

for a lobe which the liver does not have, or none.

scenarios

scenarios(species)

Get the named procedures of a species.

Parameters:

Name Type Description Default
species Species

the species.

required

Returns:

Type Description
dict[str, Intervention]

The interventions by the name of the procedure

dict[str, Intervention]

(pkpdsim.database.tables.liver_interventions); a species without a

dict[str, Intervention]

procedure gets an empty mapping. The mapping refuses a name of

dict[str, Intervention]

another species, naming the names it has.

Raises:

Type Description
ValueError

for a scenario whose kind is no intervention, or which names a lobe the species does not have.

scenario_changes

scenario_changes(species)

Get the parameter changes of the named procedures of a species.

The map of an experiment (PBPKSimulationExperiment.lobe_map): the name of a procedure to the parameters it changes and their values.

Parameters:

Name Type Description Default
species Species

the species.

required

Returns:

Type Description
dict[str, dict[str, float]]

The changes by the name of the procedure.

Raises:

Type Description
ValueError

whatever scenarios refuses.