calculate_mgfr_2c: Iohexol measured GFR with 2-compartment model (early and late...

View source: R/calculate_mgfr_2c.R

calculate_mgfr_2cR Documentation

Iohexol measured GFR with 2-compartment model (early and late sampling)

Description

This method requires multiple early (alpha phase, typically <120 min) and late (beta phase) sample measurements of iohexol to determine GFR (glomerular filtration rate). This function uses nonlinear modeling via Levenberg-Marquardt method in the gsl_nsl package and the gslnls() function to fit the 2-compartment model of iohexol kinetics. The NLLS methods use the formula C=A \cdot exp^{- \alpha \cdot t} + B*e^{- \beta \cdot t} and weighted by 1/Iohexol^2. Initial estimates for early (A, a) and late (B, b) parameters used for NLLS estimation are obtained using standard "Slope-Intercept" methods for linear regresion of log(Iohexol)~time for two lines for the early and late portions. Results for this model can be obtained using the nls_v="SI" option. Use of the gsl_nsl package allows for better support of parameter constraints (constrained to positive values) and other methods (e.g. predict methods using fit object) compared to the base nls() function. The general method and provided examples are modified from Schwartz et al. Kidney Int. 2006.. Further discussion and details regarding methods of fitting the 2-compartment models can be found at Pottel et al. Results are returned as a non-indexed value for GFR (mgfr_2c) and also indexed to BSA of 1.73m2 if height and weight are provided (mgfr_2c_bsa). The summary provides estimates of kinetic parameters (k10, k21, k12) which can be used in ODE models (see example in compare_mgfr_summary), but is not implemented here.

Usage

calculate_mgfr_2c(
  time,
  iohexol_conc,
  omnipaque_v = 300,
  ioh_inj_vol = 5,
  ioh_inj_wt = NULL,
  ioh_units = "ug/mL",
  time_units = "min",
  id = NULL,
  height = NA,
  height_units = "m",
  weight = NA,
  weight_units = "kg",
  nls_weights = TRUE,
  nls_v = "gslnls",
  t_late = 120,
  t_early = 100,
  legend_cex = 1,
  output = "summary"
)

Arguments

time

A vector of time values (minutes)

iohexol_conc

A vector of Iohexol plasma measurements (ug/mL)

omnipaque_v

Omnipaque version (eg 300 = Omnipaque 300 recommended). Other versions commonly available include 300 and 350 (USA) and 140, 280, 240 (other areas)

ioh_inj_vol

Iohexol injection Volume by syringe volume injected (Not preferred; use if weights not available)

ioh_inj_wt

Iohexol injection Weight by syringe weight determination (Pre-Post weight difference; recommnded method) in grams

ioh_units

Iohexol concentration units, defaults to ug/mL

time_units

Time units, defaults to min

id

Study identifier (optional, passed to plot title)

height

Patient Height, m

height_units

Height units, if not in m

weight

Patient Weight, kg

weight_units

Weight units, if not in kg

nls_weights

Use weights in nls model (TRUE or FALSE), defaults to TRUE. Uses 1/iohexol^2 as weights, which more heavily weight lower concentrations obtained at later time points

nls_v

Model estimation method (defaults to gslnls). Can also use SI, base, or MSP. If MSP is selected, only "late" time points will be used and "early" time points will be discarded. If no early timepoints are available, method defaults to MSP.

t_late

First Time point (minutes) to use in the "Late" elimination phase, defaults to 120

t_early

Last Time point (minutes) to use in the "Early" distribution phase, defaults to 100

legend_cex

Magnification factor for plot text, default 1.0 (100%)

output

Desired output, defaults to summary of model. Alternatively can specify gfr, gfr_bsa, fit, or plot

The mgfr_method describes the method for estimation, which can have the following options:

  • SI Slope-Intercept method obtained by performing two linear regressions of log(iohexol) vs time for early and late time points. Obtained by setting nls_v = "SI"

  • modified-SI SI method with shared time-point(s) between early and late periods (ie overlapping t_early = t_late). Obtained by setting, for example ⁠nls_v = "SI", t_early=120, t_late=120⁠ or another option with overlapping times.

  • NLLS-gslnls-weighted (Default method) NLS fit using the gslnls() function from the gsl_nls package. Obtained by setting ⁠nls_v = "gslnls", nls_weights=T⁠

  • NLLS-base-weighted NLS fit using the nls() function from the base stats package. Obtained by setting ⁠nls_v = "base", nls_weights=T⁠. Similar to gslnls method, except that parameter constraints cannot be set with nls(), and so implausible estimates (negative for a, b) may be obtained.

  • NLLS-gslnls-unweighted NLS fit using the gslnls() function from the gsl_nls package. Obtained by setting ⁠nls_v = "gslnls", nls_weights=F⁠

  • NLLS-base-unweighted NLS fit using the nls() function from the base stats package. Obtained by setting ⁠nls_v = "base", nls_weights=F⁠. This method weights heavily to early time points (higher concentration). Also, parameter constraints cannot be set with nls(), and so implausible estimates (negative for a, b) may be obtained.

  • MSP-BM The Multiple Sample Protocol (MSP), or Multiple Late Sample (MLS) estimate using 1-compartment analysis of Late time points only (>120 minutes post injection). Adjustment made using the Brochner-Mortenson correction equation to correct for unmeasured early time points.

  • SS-Jacobbson Single Sample estimate of GFR

For output = "summary" results returned includes the named variables:

  • mgfr_method Method used for GFR calculation (see above). Results should be similar.

  • mgfr_2c Measured GFR (mL/min)

  • mgfr_2c_bsa The measured GFR (mL/min/1.73 m2) indexed to body surface area (BSA calculated by DuBois equation)

  • iohexol_m Iohexol mass (ucg) injected. Determined either by user-provided syringe weight or volume injected.

  • iohexol_0 Iohexol concentration at t=0 calculated by A+B (theoretical, not measured)

  • iohexol_vd Iohexol Volume of distribution estimated by Dose/Iohexolt0

  • ioh_auc Iohexol calculated AUC from t=0 to Infinity, estimated by A/a + B/b.

  • A Model parameter A

  • a Model parameter a, or \alpha

  • B Model parameter B

  • b Model parameter b, or \beta

  • model_r2 Model Pseudo-R2, calculated as the linear regression R2 for predicted~observed values

  • ssr Sum of squared residuals

  • sse Sum of squared residuals for early time points

  • ssl Sum of squared residuals for late time points

  • k10 Iohexol elimination rate constant from central compartment (1/min)

  • k21 Iohexol transfer rate constant from peripheral to central compartment (1/min)

  • k12 Iohexol transfer rate constant from central to peripheral compartment (1/min)

  • n_early Number of early time points measured and used in model

  • n_late Number of late time points measured and used in model

gfr returns a single mgfr_2c value, the measured GFR (mL/min). gfr_bsa returns a single mgfr_2c_bsa value, the measured GFR (mL/min/1.73 m2) indexed to body surface area (BSA calculated by DuBois equation).

fit returns the non-linear regression model fit object.

plot returns a base-R plot of observed and predicted regression curve vs time, and summary measures in the legend.

Value

Desired output with either a data.frame of results (summary), a single value of BSA adjusted GFR (gfr or gfr_bsa), an ⁠nls object⁠ for model fit (fit), or a plot with observed values, model fit curve, and summary results in the figure legend (plot)

See Also

compare_mgfr_summary() for quick Table of results calculated by available methods. compare_mgfr_plot() for quick Visual comparison of plots calculated by available methods.

Examples

library(tabletools)
# PUBLISHED IOHEXOL DATA ----
# data available in package by calling
## ├ Schwartz Data ----
# Data extracted from Schwartz Fig1 https://pubmed.ncbi.nlm.nih.gov/16612328/
# Iohexol 5mL IV injection (Omnipaque 300, 5mL ~3235mg Iohexol)
# sampling at 10, 20, 30, 60, 120, 240, 300, 360 min
# time (minutes)
# Iohexol (ug/ml)
# age, height, weight not known for the example
dat_schwartz

## ├ Pottel data ----
# from Supplemental document in https://pubmed.ncbi.nlm.nih.gov/33952185/
dat10
dat17

## ├ Tondel data ----
# full example data provided by Tondel in Table 2: https://pubmed.ncbi.nlm.nih.gov/29134449/
dat_tondel

# Comparison of Output options
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5) # Default
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="gfr")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="gfr_bsa")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="fit")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="fit", nls_v="base")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="fit", nls_v="SI") # two fits

# Plot options: ideally pass the ID information
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", id="Name-IDnumber-Date")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "SI") # fit not found
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "SI", t_early = 120, t_late = 120)
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "gslnls")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "base")
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "gslnls", nls_weights = F)
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", nls_v = "base", nls_weights = F)
calculate_mgfr_2c(dat_schwartz$time, dat_schwartz$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot", legend_cex = 1.5)

# examples with fewer time points
dat_5p <- dat_schwartz[dat_schwartz$time %in% c(10, 20, 30, 120, 300), ]
calculate_mgfr_2c(dat_5p$time, dat_5p$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot")

dat_5p <- dat_schwartz[dat_schwartz$time %in% c(10, 30, 60, 120, 300), ]
calculate_mgfr_2c(dat_5p$time, dat_5p$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot")

dat_7p <- dat_schwartz[dat_schwartz$time %in% c(10, 20, 30, 60, 240, 300, 360), ]
calculate_mgfr_2c(dat_7p$time, dat_7p$iohexol_ug_ml, height = 1.67, weight = 70, ioh_inj_vol = 5, output="plot")

# if early time points not present, defaults to MSP-BM estimation (using `calculate_mgfr_msp` with warning)
dat_ebert
calculate_mgfr_2c(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06)
calculate_mgfr_2c(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output="plot", leg)
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06)

JMLuther/tabletools documentation built on April 14, 2025, 3:09 a.m.