check_doseint: Check whether an AUC interval ends on a dosing interval

View source: R/check_doseint.R

check_doseintR Documentation

Check whether an AUC interval ends on a dosing interval

Description

Check whether an AUC interval ends on a dosing interval

Usage

check_doseint(
  sim_data_file,
  existing_exp_details,
  compoundID = "substrate",
  interval = NA,
  stop_or_warn_missing_file = "warn",
  warnings = "silent"
)

Arguments

sim_data_file

the simulation output Excel file to check

existing_exp_details

the output from running extractExpDetails_mult or a data.frame with the following columns:

File

this should include sim_data_file)

SimDuration

the length of the simulation in hours

StartHr_sub, StartHr_inhib, and StartHr_inhib2

the first dose time in hours since the start of the simulation for the substrate, inhibitor 1, and inhibitor 2, respectively. It's ok to skip this for any compounds that are not compoundID.

DoseInt_sub, DoseInt_inhib, and DoseInt_inhib2

the dosing interval for the substrate, inhibitor 1, and inhibitor 2, respectively. It's ok to skip this for any compounds that are not compoundID.

DoseInt_sub, DoseInt_inhib, and DoseInt_inhib2

the dosing interval for the substrate, inhibitor 1, and inhibitor 2, respectively. It's ok to skip this for any compounds that are not compoundID.

compoundID

the specific compoundID you're interested in. Options are "substrate", "primary metabolite 1", "primary metabolite 2", "secondary metabolite", "inhibitor 1", "inhibitor 2", or "inhibitor 1 metabolite".

interval

optionally include any specific intervals that you want to check. This should be a list of the intervals where each item in that list is either a text string of the start to end times in h, e.g., "36 to 48 h" (this is not at all coincidentally exactly the format of the the text that is listed at the top of Excel sheets for custom AUC intervals in Simulator output Excel files) or a numeric vector of the start and end times, e.g., c(36, 48). An example of how to supply multiple intervals to check: interval = list(c(24, 48), c(168, 180)) These will be checked in addition to the first- and last-dose intervals, which are always checked.

stop_or_warn_missing_file

stop or just warn (default) if no information on the dosing interval is available. NB: This is NOT stop or warn if the dose interval doesn't match; it's only asking whether you want this to pass through to another function (choose "warn") if the file doesn't exist or completely stop.

warnings

"silent" (default) or "show" to see warnings in this function

Value

list of 1) message: "custom dosing" (as in, we can't tell whether the interval matched), "good", "mismatch last dose", "mismatch user-defined interval", or "can't check - missing file" and 2) data.frame of File, CompoundID, SimDuration, DoseInt, StartHr, NumDoses, StartHr_last, IntDuration_last, OneDoseIntRemaining, UserIntervalStart, UserIntervalEnd, UserIntervalStartGood, UserIntervalEndGood. If info is not available, e.g., custom dosing or missing file, then not all of those columns will be included in the data.frame.

Examples

# none yet

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