View source: R/pksummary_mult.R
pksummary_mult | R Documentation |
Make a summary PK table for a report or slide deck - THIS FUNCTION HAS BEEN DEPRECATED IN FAVOR OF THE FUNCTION pk_table.
pksummary_mult(
sim_data_files = NA,
compoundsToExtract = "substrate",
tissues = "plasma",
PKparameters = NA,
PKorder = "default",
sheet_PKparameters = NA,
observed_PK = NA,
existing_exp_details = NA,
mean_type = NA,
use_median_for_tmax = TRUE,
includeCV = TRUE,
includeSD = FALSE,
includeConfInt = TRUE,
includeMedian = FALSE,
includeRange = FALSE,
includePerc = FALSE,
includeTrialMeans = FALSE,
concatVariability = FALSE,
variability_format = "to",
convert_conc_units = NA,
include_dose_num = NA,
add_header_for_DDI = TRUE,
rounding = NA,
prettify_columns = TRUE,
extract_forest_data = FALSE,
checkDataSource = TRUE,
highlight_gmr_colors = NA,
highlight_so_cutoffs = NA,
highlight_so_colors = "yellow to red",
save_table = NA,
single_table = FALSE,
page_orientation = "portrait",
fontsize = 11,
...,
adjust_conc_units = NA
)
sim_data_files |
a character vector of simulator output files, each in
quotes and encapsulated with |
compoundsToExtract |
For which compound(s) do you want to extract PK data? Options are any combination of the following:
To
specify multiple compounds, enclose the compound IDs with parentheses,
e.g., |
tissues |
For which tissue(s) would you like the PK parameters to be
pulled? Options are any combination of "plasma" (default), "unbound
plasma", "blood", "unbound blood", "peripheral plasma", or "peripheral
blood". NOTE: PK for peripheral sampling is not as well tested as
for other tissues and is only set up for V21+. Please check your results
carefully.. For multiple tissues, enclose them with parentheses, e.g.,
|
PKparameters |
(optional) the PK parameters to include as a character vector.
An example of acceptable input here: |
PKorder |
Would you like the order of the PK parameters to be the order
specified in the Consultancy Report Template (default), or would you like
the order to match the order you specified with the argument
|
sheet_PKparameters |
(optional) If you want the PK parameters to be
pulled from a specific tab in the simulator output file, list that tab
here. Otherwise, this should be left as NA. If you want some parameters
from a custom-interval tab and others from the regular tabs, please supply
a named character vector where the names are the PK parameters and the
values are the tabs. Example: |
observed_PK |
(optional) If you have a data.frame, a named numeric vector, or an Excel or csv file with observed PK parameters, supply the full file name in quotes or supply the unquoted name of the the data.frame or vector here, and the simulated-to-observed mean ratios will be calculated. If you supply an Excel file, R will be looking to read a tab named exactly "observed PK". The supplied data.frame or file must be set up in one of two possible ways:
Additionally, if you have more than one set of PK parameters, you must
include a column titled "File" that lists which simulator output file
should be compared to that observed data. If there's only one set of PK
parameters, you can omit the column "File" and the PK data will be compared
to ALL the simulated files included in |
existing_exp_details |
If you have already run
|
mean_type |
What kind of means and CVs do you want listed in the output table? Options are "arithmetic" or "geometric" (default). |
use_median_for_tmax |
TRUE (default) or FALSE for whether to use median
for tmax values, regardless of what the other summary statistics are. This
is typically the case, but, if you've got client data where they actually
gave you tmax using the same summary statistic as the other PK parameters
(like geometric mean, for example), then set this to FALSE and whatever
mean type you specified with the argument |
includeCV |
TRUE (default) or FALSE for whether to include rows for CV in the table |
includeSD |
TRUE or FALSE (default) for whether to include rows for the standard deviation in the table |
includeConfInt |
TRUE (default) or FALSE for whether to include whatever confidence intervals were included in the simulator output file. Note that the confidence intervals are geometric since that's what the simulator outputs (see an AUC tab and the summary statistics; these values are the ones for, e.g., "90% confidence interval around the geometric mean(lower limit)"). |
includeMedian |
TRUE or FALSE (default) for whether to include rows for the median in the table |
includeRange |
TRUE or FALSE (default) for whether to include the minimum and maximum values |
includePerc |
TRUE or FALSE (default) for whether to include 5th to 95th percentiles |
includeTrialMeans |
TRUE or FALSE (default) for whether to include the range of trial means for a given parameter. Note: This is calculated from individual values rather than being pulled directly from the output. |
concatVariability |
TRUE or FALSE (default) for whether to concatenate the variability. If "TRUE", the output will be formatted into a single row and listed as the lower confidence interval or percentile to the upper CI or percentile, e.g., "2400 to 2700". Please note that the current SimcypConsultancy template lists one row for each of the upper and lower values, so this should be set to FALSE for official reports. |
variability_format |
formatting used to indicate the variability When the variability is concatenated. Options are "to" (default) to get output like "X to Y", "hyphen" to get output like "X - Y", "brackets" to get output like "[X, Y]", or "parentheses" for the eponymous symbol if you're an American and a bracket if you're British, e.g., "(X, Y)". (Sorry for the ambiguity; this was written by an American who didn't originally realize that there was another name for parentheses.) |
convert_conc_units |
Would you like to convert the units to something
other than what was used in the simulation? Default is NA to leave the
units as is, but if you set the concentration units to something else, this
will attempt to convert the units to match that. This only adjusts only the
simulated values, since we're assuming that that's the most likely problem
and that observed units are relatively easy to fix, and it also only
affects AUC and Cmax values. Acceptable input is any concentration unit
listed in the Excel form for PE data entry, e.g. |
include_dose_num |
NA (default), TRUE, or FALSE on whether to include the dose number when listing the PK parameter. By default, the parameter will be labeled, e.g., "Dose 1 Cmax ratio" or "Last dose AUCtau ratio", if you have PK data for both the first dose and the last dose. Also by default, if you have data only for the first dose or only for the last dose, the dose number will be omitted and it will be labeled, e.g., "AUCtau ratio" or "Cmax ratio". Set this to TRUE or FALSE as desired to override the default behavior and get exactly what you want. |
add_header_for_DDI |
TRUE (default) or FALSE for whether to add an extra header row to the top of your table denoting when the PK are for baseline, with a perpetrator, or are the geometric mean ratios. |
rounding |
option for what rounding to perform, if any. Options are:
|
prettify_columns |
TRUE (default) or FALSE for whether to make easily
human-readable column names. TRUE makes pretty column names such as "AUCinf
(h*ng/mL)" whereas FALSE leaves the column with the R-friendly name from
|
extract_forest_data |
TRUE or FALSE (default) to get forest-plot data at
the same time. This only applies when the compound to extract is the
substrate or a substrate metabolite. If set to TRUE, this will return a
list that includes data formatted for use with the function
|
checkDataSource |
TRUE (default) or FALSE for whether to include in the output a data.frame that lists exactly where the data were pulled from the simulator output file. Useful for QCing. |
highlight_gmr_colors |
optionally specify a set of colors to use for highlighting geometric mean ratios for DDIs. Options are "yellow to red", "green to red" or a vector of 4 colors of your choosing. If left as NA, no highlighting for GMR level will be done. |
highlight_so_cutoffs |
optionally specify cutoffs for highlighting any
simulated-to-observed ratios. Anything that is above those values or below
the inverse of those values will be highlighted. To figure out what cells
to highlight, this looks for a column titled "Statistic" or "Stat", then
looks for what row contains "S/O" or "simulated (something something)
observed" (as in, we'll use some wildcards to try to match your specific
text). Next, it looks for any values in that same row that are above those
cutoffs. This overrides anything else you specified for highlighting. The
default is NA, for not highlighting based on S/O value. Acceptable
input for, say, highlighting values that are > 125% or < 80% of the
observed and also, with a second color, values that are > 150% or < 66%
would be: |
highlight_so_colors |
optionally specify a set of colors to use in the
Word file output for highlighting S/O values outside the limits you
specified with
If you do specify your own bespoke colors, you'll need to make sure that
you supply one color for every value in |
save_table |
optionally save the output table and, if requested, the QC
info, by supplying a file name in quotes here, e.g., "My nicely formatted
table.docx" or "My table.csv", depending on whether you'd prefer to have
the table saved as a Word or csv file. Do not include any slashes, dollar
signs, or periods in the file name. (You can also save the table to a Word
file later with the function |
single_table |
TRUE (default) or FALSE for whether to save all the PK data in a single table or break the data up by tissue, compound ID, and file into multiple tables. This only applies to the Word output. |
page_orientation |
set the page orientation for the Word file output to "portrait" (default) or "landscape" |
fontsize |
the numeric font size for Word output. Default is 11 point. This only applies when you save the table as a Word file. |
... |
Returns a data.frame with summary PK parameters from multiple simulator output files
# Create PK summary tables for all the Simulator output files
# in your working directory with the default PK parameters
pksummary_mult(sim_data_files = NA)
# Include a data.frame of observed data for S/O comparisons
pksummary_mult(
sim_data_files = NA,
observed_PK = data.frame(File = c("mdz-5mg-qd-keto-400mg-qd.xlsx",
"mdz-5mg-qd-rif-600mg-qd.xlsx"),
AUCtau_last = c(55, 55),
Cmax_last = c(20, 20),
AUCtau_last_withInhib = c(800, 20),
Cmax_last_withInhib = c(100, 5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.