extractObsConcTime: Extract observed concentration-time data from an Excel file

View source: R/extractObsConcTime.R

extractObsConcTimeR Documentation

Extract observed concentration-time data from an Excel file

Description

Extract observed data from an Excel file that follows the Simcyp Simulator template for converting concentration-time data into an XML file.

Usage

extractObsConcTime(
  obs_data_file,
  compound_name = NA,
  perpetrator_name = NA,
  add_t0 = FALSE,
  returnDosingInfo = FALSE
)

Arguments

obs_data_file

name of the Excel file containing the observed concentration-time data, in quotes. This is the file that is ready to be converted to an XML file, not a file that contains only digitized time and concentration data and not the XML file itself that you would include in a Simulator workspace for observed data.

compound_name

the name of the compound, e.g., "midazolam". If you have more than one compound that you want to specify – for example, the data include both the substrate and primary metabolite 1 – you can specify them with a named character vector like this: compound_name = c("substrate" = "midazolam", "primary metabolite 1" = "OH-midazolam"). All possible compound IDs permissible here: "substrate", "primary metabolite 1", "primary metabolite 2", "secondary metabolite", "inhibitor 1", "inhibitor 2", or "inhibitor 1 metabolite".

perpetrator_name

the name of the perpetrator, where applicable, e.g., "itraconazole". This will be listed in the column "Inhibitor" in the output.

add_t0

TRUE or FALSE (default) for whether to add t0 points if they're missing. Sometimes, observed data do not include a measurement at t0 because, presumably, the concentration should always be 0 at that time. If you're using these data to calculate PK, though, you'll miss that initial part of the AUC if t0 is missing. If add_t0 is set to TRUE, this will add a concentration of 0 and time 0 for all of the individual concentration-time profiles.

returnDosingInfo

TRUE or FALSE (default) for whether to return a second data.frame with dosing and demographic information from the Excel file.

Value

a data.frame or a list of two data.frames. The observed concentration-time data.frame, which is named "ObsCT" if the output is a list, has the following columns:

Individual

the individual ID

CompoundID

the compound ID listed in the observed file, e.g., "Sub Plasma", "Sub PM1 Plasma", "Sub (Inb) Plasma" will become "substrate" and so on

Tissue

the tissue

Time

time since dosing

Conc

concentration

Time_units

the units of measurement for the time column

Conc_units

the units of measurement for the concentration column

Period, Age, Weight_kg, Height_cm, Sex, SerumCreatinine_umolL, HSA_gL, Haematocrit, PhenotypeCYP2D6, SmokingStatus

the columns in the template for "Period" and "Covariates" but with R-friendly names.

If the user requested dosing information, the second item in the list will be a data.frame titled "ObsDosing" and will include both dosing and demographic information from the Excel file.

Examples

extractObsConcTime(obs_data_file = "My observed data.xlsx")


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.