calculate_mgfr_msp: Iohexol Multiple Sample Protocol (MSP) estimate of GFR

View source: R/calculate_mgfr_msp.R

calculate_mgfr_mspR Documentation

Iohexol Multiple Sample Protocol (MSP) estimate of GFR

Description

This method uses multiple sample measurements of iohexol to determine GFR (glomerular filtration rate), using a single compartment model of the late slope and adjustment using the Brochner-Mortenson correction equation (. Relevant Methods and recommendations are detailed in the European Kidney Function Consortium statment paper. The function can be compared against an excel spreadsheet provided in the supplemental material.

Usage

calculate_mgfr_msp(
  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",
  method_adj = "BM",
  t_late = 120,
  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

t_late

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

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.

Examples

library(tabletools)
library(dplyr)
# data from Ebert KI 2024, in online XLS file: https://pubmed.ncbi.nlm.nih.gov/39097002/
df1_dem <- data.frame(height=168,     # cm
                      weight=87,      # kg
                      ioh_inj_wt = 6.82594, # injected weight g; syringe wt pre-post
                      ioh_vol = 5.06, # mL
                      ioh_conc = 647)   # Omnipaque 300

dat_ebert

calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol,
                   ioh_inj_vol = 5.06,
                   height = df1_dem$height, weight = df1_dem$weight)  
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol,
                   ioh_inj_wt = 6.82594, 
                   ioh_inj_vol=NULL, # make this NULL if weight given
                   height = df1_dem$height, weight = df1_dem$weight)  
                   
# methods designed to match the fuller for 2C
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output = "summary")
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output = "gfr")
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output = "gfr_bsa")
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output = "fit")
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, ioh_inj_vol = 5.06, output = "plot", id="test")
calculate_mgfr_msp(dat_ebert$time, dat_ebert$iohexol, height = 1.68, weight=87, 
ioh_inj_vol = 5.06, output = "plot", id="test", legend_cex = 1.5)

# Example for multiple dataset analysis
df2_dem <- data.frame(id=1:5,
                      height= rnorm(5, 168, 10),     # cm
                     weight= rnorm(5, 87, 5),      # kg
                     ioh_inj_wt = rep(6.82594,5), # injected weight g; syringe wt pre-post
                     ioh_vol = rep(5.06,5)) # mL
dat2 <- data.frame(id=rep(1:5, each=6),
                  time = rep(c(160,180,200,220,232,240), 5),
                  iohexol_ucg_ml = rep(c(70,60,47,37,30,25), 5))

# merged with time series df in a column
df2_m <- merge(df2_dem, dat2, all.x = T) |> 
 dplyr::group_by(id) |> 
 tidyr::nest(dat = c(time, iohexol_ucg_ml))
library(purrr)
df2_m |> 
 mutate(mgfr = map(dat, ~calculate_mgfr_msp(.x$time, .x$iohexol_ucg_ml,
                                            ioh_inj_vol = ioh_vol,
                                            height = height, weight = weight))) |> 
 tidyr::unnest(mgfr)

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