inductFit | R Documentation |
inductFit
fits induction data – either activity or mRNA expression –
to one or all of four models for calculating Indmax or Emax, EC50, and, when
appropriate, a slope. Two important notes:
With the exception of the sigmoidal 3-parameter model, the fitted parameter describing maximal induction is Emax and not Indmax, the parameter used in the Simcyp Simulator. Note that Indmax = Emax + 1.
If you're
familiar with Howie's R script for fitting induction data
("Induction_fit_script_ver2.r"), one way in which this function differs is
that the default setting includes no upper or lower bounds for parameter
estimates. This means that, if sufficient data to describe the curve do not
exist, the function will fail to deliver any fitted parameters, which is
meant to be a benefit but could be an annoyance depending on your
perspective. If you would like this function to behave more like Howie's
script, please look at the help file for the arguments bounds_Emax
,
bounds_EC50
, and bounds_slope
.
For detailed instructions and examples, please see the SharePoint file "Simcyp PBPKConsult R Files - Simcyp PBPKConsult R Files/SimcypConsultancy function examples and instructions/Fitting induction data/Fitting-induction-data.docx". (Sorry, we are unable to include a link to it here.)
inductFit(
DF,
conc_column = Concentration_uM,
fold_change_column = FoldInduction,
donor_column = DonorID,
fitByDonor = TRUE,
model = "all",
graph_mean_of_fits = FALSE,
measurement = "mRNA",
enzyme = "CYP3A4",
drug = NA,
weights = "1/y^2",
bounds_Emax = NA,
bounds_EC50 = NA,
bounds_slope = NA,
bounds_gamma = NA,
omit = NA,
color_set = "default",
y_axis_limits = NA,
y_axis_label = NA,
hline_foldinduct1 = FALSE,
vert_line = NA,
Imaxu_line = NA,
rounding = NA,
include_fit_stats = TRUE,
graph_title = NA,
graph_title_size = 14,
save_graph = NA,
save_table = NA,
page_orientation = "portrait",
fig_height = 5,
fig_width = 5.5,
save_output = NA
)
DF |
the data.frame containing induction data with a column for the drug
concentration, a column for the fold induction observed, and, if you want
to fit the data by individual, a column for the donor ID. For an example,
please run |
conc_column |
the name of the column within DF that contains concentration data. This should be unquoted. |
fold_change_column |
the name of the column within DF that contains fold-change data, e.g., mRNA measurements or activity. This should be unquoted. |
donor_column |
the name of the column within DF that contains the donor IDs, unquoted |
fitByDonor |
TRUE (default) or FALSE for whether to fit the data by individual donor |
model |
which model(s) you would like to use. The four model options are:
|
graph_mean_of_fits |
TRUE or FALSE (default) for whether to graph a line
representing the mean of all donors' fitted parameters. Please note that
this is NOT line showing the model fitted to the mean data; instead, this
is the mean of all the donors individually fitted parameters. This only
applies when |
measurement |
the type of measurement used. Options are "mRNA" or "activity". This only affects the y axis labels on the output graph(s). |
enzyme |
the enzyme involved. Default is "CYP3A4" but can be set to NA to leave as unspecified. This only affects the figure and table headings and captions in the Word document output. |
drug |
the drug used in the incubations. Default is NA to leave this unspecified, but supplying a value will include the drug name in the x-axis label on the graphs as well as the figure and table headings and captions in the Word document output. |
weights |
weighting scheme to use for the regression. User may supply a numeric vector of weights to use or choose from "none", "1/x", "1/x^2", "1/y" or "1/y^2" (default). Be careful that you don't have any infinite values or this will fail! |
bounds_Emax |
lower and upper boundaries for fitting Indmax or Emax,
specified as a vector of numbers, e.g., |
bounds_EC50 |
lower and upper boundaries for fitting IndC50 or EC50,
specified as a vector of numbers, e.g., |
bounds_slope |
lower and upper boundaries for fitting the slope,
specified as a vector of numbers, e.g., |
bounds_gamma |
lower and upper boundaries for fitting the Hill
coefficient gamma, specified as a vector of numbers, e.g., |
omit |
An index of which, if any, samples to omit from regression(s).
These samples will be depicted as open circles in the graph but will not be
included in the regression. An example of acceptable input where, say, you
want to omit samples where the concentration was greater than 100 uM but
still want to see those points on the graph(s): |
color_set |
the set of colors to use. Options:
|
y_axis_limits |
optionally set the Y axis limits, e.g., |
y_axis_label |
optionally supply a character vector or an expression to use for the y axis label |
hline_foldinduct1 |
TRUE or FALSE (default) on whether to include a dotted red line where the fold induction = 1. |
vert_line |
optionally include a vertical dotted red line at some concentration. Use a numeric value for the concentration you want or leave as NA (default) for no vertical line. |
Imaxu_line |
optionally specify a value for 30*Imax,u (see p. 5 USFDA Guidance (2020) "In Vitro Drug Interaction Studies - Cytochrome P450 Enzyme and Transporter Mediated Drug Interactions") and this will create red dotted line that goes down from the top of the graph at that concentration and then across to the y axis at the 2-fold change level. Points within that upper left corner are a potential concern for induction. Use a numeric value for the concentration you want or leave as NA (default) for no line. |
rounding |
option for what rounding to perform, if any. Options are:
|
include_fit_stats |
TRUE (default) or FALSE for whether to include statistics describing the goodness of fit: the standard error (SE), the p value, and the Akaike information criterion (AIC). These values come from the nonlinear regression of the various models to the data. |
graph_title |
optionally specify a title that will be centered across your graph or set of graphs |
graph_title_size |
the font size for the graph title if it's included; default is 14. This also determines the font size of the graph labels. |
save_graph |
optionally save the output graph by supplying a file name
in quotes here, e.g., "My induction graph.png". If you leave off ".png", it
will be saved as a png file, but if you specify a different file extension,
it will be saved as that file format. Acceptable extensions are "eps",
"ps", "jpeg", "jpg", "tiff", "png", "bmp", or "svg". Do not include any
slashes, dollar signs, or periods in the file name. If you only want to
save the table of fitted parameters, please use the argument
|
save_table |
optionally save the table of fitted parameters by supplying
a file name in quotes here, e.g., "My fitted induction parameters.csv".
Saving as an xlsx file is also supported. Do not include any slashes,
dollar signs, or periods in the file name. If you only want to save the
graphs, please use the argument |
page_orientation |
set the page orientation for the Word file output to "portrait" (default) or "landscape" |
fig_height |
figure height in inches; default is 5 |
fig_width |
figure width in inches; default is 5.5 |
save_output |
optionally save a) the equations used for fitting, b) the
fitted parameters, and c) the graphs by supplying a file name in quotes
here, e.g., "My induction results.docx". Do not include any slashes, dollar
signs, or periods in the file name. If you only want to save the graphs,
please use the argument |
Returns a list of
the fitted parameters
the mean fitted parameters for all donors
a graph or set of graphs of the data with the fitted parameters depicted as lines
a data.frame of numeric data used to graph the fitted parameters in case you'd like to plot the fitted parameters in some other way
# IndData is a data.frame of example induction data included with the package.
inductFit(IndData, model = "Emax")$Graph
inductFit(IndData %>% rename(Conc_uM = Concentration_uM),
conc_column = Conc_uM, model = "EmaxSlope")$Graph
inductFit(IndData, model = "slope")$Graph
inductFit(IndData, model = "Sig3Param")
inductFit(IndData, model = "EmaxSlope", measurement = "activity")
MyFit <- inductFit(IndData, model = "all")
MyFit$Graph; MyFit$Fit
MyFit <- inductFit(IndData, model = "Sig3Param", fitByDonor = TRUE, donor_column = DonorID)
MyFit$Fit; MyFit$Fit_means; MyFit$Graph
MyFit <- inductFit(IndData, model = "all", fitByDonor = TRUE, donor_column = DonorID)
MyFit$Fit; MyFit$Fit_means; MyFit$Graph
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.