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