View source: R/calculate_mgfr_2c.R
calculate_mgfr_2c | R Documentation |
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.
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"
)
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 |
time_units |
Time units, defaults to |
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 ( |
nls_v |
Model estimation method (defaults to |
t_late |
First Time point (minutes) to use in the "Late" elimination
phase, defaults to |
t_early |
Last Time point (minutes) to use in the "Early" distribution
phase, defaults to |
legend_cex |
Magnification factor for plot text, default 1.0 (100%) |
output |
Desired output, defaults to The
For
|
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
)
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.