Skip to content
Danpc11Public

About

Liver Perfusion Network model: vascular optimisation predicts the haemodynamic load on a partial liver graft, where pressure load = flow load × resistance load.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

LiPNet - Liver Perfusion Network model

A physics-based model of hepatic perfusion and haemodynamic load in partial liver grafts

Python Tests Calculator Version DOI


What this is

LiPNet treats the liver as a vascular transport network and asks a single question: what turns portal flow into portal pressure?

The answer is one identity. It follows from the definition of vascular resistance, $R=\Delta P/Q$ per 100 g, and splits the pressure load into a flow component and a resistance component:

$$\boxed{z_P = z_F , z_R}\qquad\text{pressure load}=\text{flow load}\times\text{resistance load}$$

$$z_F=\frac{\text{graft PVF per }100,\text{g}}{\text{donor PVF per }100,\text{g}},\qquad z_P=\frac{\text{PVP}-\text{CVP}}{5\ \text{mmHg}},\qquad z_R=\frac{R_{\text{graft}}}{R_{\text{donor}}}$$

Because $z_P/z_F=(\Delta P_{\text{graft}}/\Delta P_{\text{donor}})/(Q_{\text{graft}}/Q_{\text{donor}})=R_{\text{graft}}/R_{\text{donor}}$, the identity holds exactly. Its empirical content is which surgical configurations give $z_R<1$.

All three loads equal 1 in a healthy donor. Flow and pressure therefore carry the same information only while $z_R=1$: whenever the venous outflow is enlarged, $z_R$ falls and a graft can take three or four times the donor's flow without the pressure that would normally come with it. In the five published groups that report both loads, the four with reconstructed or enlarged outflow had $z_R = 0.31,;0.54,;0.55,;0.74$, all below one, with adverse outcomes of 0 to 10%. The fifth group, with standard outflow, had $z_R = 0.72$, so the contrast between configurations still needs more series.

The derivation, the four predictions that follow from it and all the numbers are in THEORY.md.

Graphical abstract of LiPNet showing the liver as a perfusion network and the relation between flow load, resistance load and pressure load


Included clinical series

Thirty-one groups from seventeen published series of adult living-donor liver transplantation. Every value in data/series.tsv carries its source table and page, and a provenance label.

Series Journal Link
Troisi 2003 Liver Transpl 2003;9(9):S36–41 10.1053/jlts.2003.50200
Troisi 2005 Am J Transplant 2005;5(6):1397–1404 10.1111/j.1600-6143.2005.00850.x
Yagi 2005 Liver Transpl 2005;11(1):68–75 10.1002/lt.20317
Yagi 2006 Transplantation 2006;81(3):373–378 10.1097/01.tp.0000198122.15235.a7
Yamada 2008 Am J Transplant 2008;8(4):847–853 10.1111/j.1600-6143.2007.02144.x
Botha 2010 Liver Transpl 2010;16(5):649–657 10.1002/lt.22043
Ogura 2010 Liver Transpl 2010;16(6):718–728 10.1002/lt.22059
Ou 2010 Transplant Proc 2010;42(3):876–878 10.1016/j.transproceed.2010.02.064
Chan 2011 Liver Transpl 2011;17(2):115–121 10.1002/lt.22034
Ishizaki 2012 Liver Transpl 2012;18(3):305–314 10.1002/lt.22440
Vasavada 2014 Int J Surg 2014;12(2):177–180 10.1016/j.ijsu.2013.12.006
Wang 2014 Surg Today 2015;45(8):979–985 10.1007/s00595-014-0999-9
Alim 2016 Liver Transpl 2016;22(12):1643–1648 10.1002/lt.24523
Uemura 2016 Surgery 2016;159(6):1623–1630 10.1016/j.surg.2016.01.009
Kanetkar 2017 J Clin Exp Hepatol 2017;7(3):235–246 10.1016/j.jceh.2017.01.114
Osman 2017 Hepatol Res 2017;47(4):293–302 10.1111/hepr.12727
Yao 2018 Transplantation 2018;102(4):623–631 10.1097/TP.0000000000002047

Every value in the extraction is sourced to its table and page in data/series.tsv.


Calculator

A browser-based research calculator is available at:

https://danpc11.github.io/LiPNet/

The calculator runs locally in the browser.

Users can enter:

  • current PVP,
  • current CVP,
  • expected pressure after a planned manoeuvre,
  • a reference event rate or cohort-specific baseline.

The calculator returns:

  • $z_F$,
  • $z_P$,
  • $z_R$,
  • the estimated odds ratio associated with a pressure change,
  • an absolute risk estimate anchored to the user-provided baseline.

The slope, its interval, the per-series levels and the prediction bands all come from the same posterior, the primary analysis of the paper: the hierarchical model fitted to small-for-size syndrome or early graft dysfunction, $\mu_\beta$ = +1.55 (95% CrI +0.33 to +2.79), an odds ratio of 4.70 per unit of $z_P$ and 1.36 per mmHg of gradient, from 7 groups in 3 series (76 events in 573 recipients). The reference series it offers are the same three, so the outcome you anchor on matches the outcome the slope was fitted on. Anchoring on a cohort's overall rate and average gradient is an approximation, because the average risk of a spread-out cohort is not the risk at its average gradient; anchoring on a rate measured at one gradient has no such error, and the page says so.

If a user provides a reference probability:

$$p_{\mathrm{ref}}$$

at pressure load:

$$z_{\mathrm{ref}},$$

the model uses:

$$\mathrm{logit},p(z)=\mathrm{logit},p_{\mathrm{ref}}+\mu_\beta(z-z_{\mathrm{ref}}).$$

The resulting curve therefore passes through the supplied clinical anchor.


Recalibration

A centre can estimate its own baseline using:

indices.baseline_from_rate(rate, mean_zP, beta)

which computes:

alpha = logit(rate) - beta * mean(zP)

For local outcome data, the intercept can be recalibrated using:

indices.recalibrate(outcomes, zP, beta)

while keeping the slope fixed.

This corresponds to recalibration-in-the-large, a standard first step in prediction-model updating.


Repository structure

src/model/
    Network model:
    - 2D and 3D vascular graphs
    - optimization
    - closed-form scaling
    - allometric closure

src/predictions.py
    Tests predictions P1-P4, with the sweep of the two
    normalisation references behind zR (P2)
    Output:
    results/predictions.json

src/indices.py
    Calculates:
    - zF
    - zP
    - zR
    - stratified models
    - hierarchical models
    - internal-external validation
    - recalibration

src/fem/
    Lobule-scale finite elements:
    - anisotropic Darcy perfusion
    - O2 with haemoglobin, ethanol, acetaldehyde, drug
    - sinusoid/hepatocyte two-phase exchange, zonal membrane
    - NO wall sub-model
    - shape factor and z_R(z_F) back to the network
    Output:
    results/fem_*.json, results/fem_*.pdf

src/ipd/
    Patient-level layer:
    - Kaplan-Meier reconstruction (Guyot)
    - within-group dispersion model
    Output:
    results/ipd_*.json

src/plots.py
    Generates 19 stand-alone figures

src/build_app.py
    Rebuilds the browser calculator

data/series.tsv
    31 groups from 17 published clinical series

sfss_calculator.html
index.html
tests/
docs/FEM.md
docs/IPD.md
run_all.sh

Reproduce the analysis

Install the dependencies:

pip install -r requirements.txt

Run the complete workflow:

./run_all.sh

This reproduces:

  • haemodynamic indices,
  • predictions,
  • statistical analyses,
  • figures,
  • calculator.

Typical runtime is approximately three minutes.

To run only the four main predictions:

python src/predictions.py

To generate the summary prediction figure:

python src/plots.py predictions

The model campaigns used to generate the cached tables are stored in:

src/model/

They include:

  • optimized networks from 37 to 1478 lobules,
  • 2D and 3D networks,
  • exhaustive optimization on seven lobules,
  • allometric closure.

The corresponding commands are documented in:

run_all.sh

Data

The main clinical dataset is:

data/series.tsv

It contains raw published values.

The normalized indices are not stored as fixed results.

They are recalculated by:

src/indices.py

Each variable includes provenance information.

The *_basis columns identify whether each value was:

  • reported,
  • derived,
  • imputed,
  • defined by a threshold,
  • not applicable.

Structural variables include:

  • centre_id,
  • cohort_id,
  • recruitment_start,
  • recruitment_end,
  • overlap_set,
  • outflow,
  • gradient_timing,
  • gradient_sd,
  • outcome_definition,
  • outcome_horizon,
  • modulation_strategy.

These fields are used to distinguish publications, cohorts, centres and overlapping patient populations.

Groups defined only by a clinical cut-off are excluded from the primary analysis.

Second partitions of already-counted cohorts are also excluded from the primary analysis.

They are reported separately in:

results/sensitivity.tsv

The seventeen series and their links are listed in Included clinical series above.


Inside the lobule

The network model represents a whole lobule as one edge of conductance $w=r^4/l$: a rigid Poiseuille tube whose resistance does not depend on its flow. src/fem/ opens that edge up with a finite-element model of a single hexagonal lobule, and hands two things back.

The first is a shape factor. Comparing the computed resistance against an equal-area radial annulus with the same permeability gives $\kappa = R_{\text{FEM}}/R_{\text{annulus}} = 0.996$, so the hexagonal outline costs the network model essentially nothing. The single edge is a better idealisation than it looks.

The second is the part that is not geometric. Driving the lobule at a prescribed flow and closing the loop shear $\to$ eNOS $\to$ sinusoidal calibre $\to$ permeability gives a resistance that falls as flow rises:

$z_F$ 0.5 1 1.5 2 3 4
lobule $z_R$ 1.21 1.00 0.85 0.74 0.59 0.56

With the feedback gain at zero this is identically 1, so the two models are nested.

Put back into the series, though, the effect is small. The dissipation-optimal network puts 21% of its resistance in the sinusoids, which is where the published measurements put it too (0 in the cat and dog, 0.08 to 0.26 by micropuncture in the rabbit, a third in the perfused rat) even though the share was never used in the optimisation. At that share a graft at four times the donor's flow per gram reaches a measured $z_R$ of 0.91, not the 0.31 to 0.74 of the published series. Sinusoidal autoregulation is a small, same-signed background term to be subtracted before attributing the rest, not a competing explanation for the clinical observation.

The same solve also puts 47% of the intralobular pressure drop in the quarter nearest the central vein, reproducing the outlet-dominated profile that Henriksen and Lassen derived in 1988 from a quite different argument.

The same solve carries oxygen with its haemoglobin-bound pool, ethanol through ADH and CYP2E1, acetaldehyde, and a pericentrally cleared drug, either in one continuum or with the sinusoid and the hepatocyte separated by a membrane of finite permeability. Without fitting, it reproduces a periportal-to-pericentral $pO_2$ of 56 to 33 mmHg, 33% hepatic oxygen extraction, a transit time of 8.6 s and a sinusoidal wall shear stress of 0.19 Pa, and it puts the reactive drug metabolite and the acetaldehyde peak where centrilobular necrosis is.

python src/fem/run_fem.py all
python tests/test_fem.py

The derivation, the numerical traps and the limits are in docs/FEM.md.


Limitations

The main clinical analysis uses aggregated group-level data.

Prediction 3 is based on five series from three centres (Cairo, Fukuoka, Kyoto), with 104 clinical events.

Only three series report the primary outcome.

Several Kyoto publications overlap in recruitment period.

These limitations reduce the amount of independent information available for estimating between-study heterogeneity.

CVP is not available in all studies.

When CVP is assumed as a constant within a study, it shifts all groups from that study by the same amount on the $z_P$ axis.

This does not change the within-study slope because the study-specific intercept absorbs the shift.

It can, however, change the absolute position of the groups on the normalized pressure scale.

Because the available data are aggregated, the analysis can estimate:

  • likelihood,
  • deviance,
  • observed-to-expected ratios,
  • study-level slopes.

It cannot provide reliable individual-level measures such as:

  • c-statistic,
  • individual calibration curves,
  • Brier score,
  • decision-curve analysis.

These limitations apply mainly to Prediction 3.

Predictions 1, 2 and 4 do not depend on the hierarchical outcome model.

The calculator is therefore a research tool.

It is not a medical device and should not be used as a stand-alone tool for clinical decision-making.


Scope

LiPNet is a mechanistic framework, not an individual risk score. It gives a common normalised language for portal hyperperfusion, venous outflow reconstruction, small-for-size physiology, portal hypertension, hepatic resection and vascular obstruction, and it says which part of that language transfers between centres: the change in risk with a change in load does, the baseline risk does not.


Publication

The article associated with this repository is currently in preparation:

Vascular resistance modulates portal flow-pressure decoupling in partial liver grafts

Until a preprint is available, please cite the archived software release.


Citation

The software is archived on Zenodo. The version used in the article is v0.4.2:

DOI: 10.5281/zenodo.23656741 (this version) · 10.5281/zenodo.22861276 (all versions)

A machine-readable citation is also available in:

CITATION.cff

Licence

Source code is distributed under:

PolyForm Noncommercial 1.0.0

https://polyformproject.org/licenses/noncommercial/1.0.0

Clinical values stored in data/ remain the intellectual property of the authors of the original publications.

About

Liver Perfusion Network model: vascular optimisation predicts the haemodynamic load on a partial liver graft, where pressure load = flow load × resistance load.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages