enz_plot | R Documentation |
Using simulated enzyme-abundance data generated from running the function
extractEnzAbund
, make publication-quality graphs that match the
consultancy template formatting instructions. For detailed instructions and
examples, please see the SharePoint file "Simcyp PBPKConsult R Files - Simcyp
PBPKConsult R Files/SimcypConsultancy function examples and
instructions/Enzyme abundance plots/Enzyme-abundance-plot-examples.docx".
(Sorry, we are unable to include a link to it here.)
enz_plot(
sim_enz_dataframe,
gut_tissue = "colon",
figure_type = "means only",
mean_type = "arithmetic",
linear_or_log = "linear",
time_range = NA,
x_axis_interval = NA,
x_axis_label = NA,
pad_x_axis = TRUE,
pad_y_axis = TRUE,
y_axis_limits_lin = NA,
y_axis_limits_log = NA,
y_axis_label = NA,
line_type = NA,
line_transparency = NA,
line_color = NA,
line_width = NA,
hline_position = NA,
hline_style = "red dotted",
vline_position = NA,
vline_style = "red dotted",
legend_position = "none",
legend_label = NA,
prettify_compound_names = TRUE,
graph_labels = TRUE,
graph_title = NA,
graph_title_size = 14,
qc_graph = FALSE,
existing_exp_details = NA,
return_caption = FALSE,
save_graph = NA,
fig_height = 4,
fig_width = 6
)
sim_enz_dataframe |
the data.frame of enzyme abundance data obtained
from running the function |
gut_tissue |
Which of the two types of gut tissue would you like to
plot? Acceptable options are "colon" (default) or "small intestine".
Applicable only when the tissue extracted with
|
figure_type |
type of figure to plot. Options are:
|
mean_type |
graph "arithmetic" (default) or "geometric" means or "median" for median concentrations. If that option was not included in the output, you'll get a warning and the graph will include one that was. |
linear_or_log |
the type of graph to be returned. Options:
|
time_range |
time range to show relative to the start of the simulation. Options:
|
x_axis_interval |
optionally set the x-axis major tick-mark interval. Acceptable input: any number or leave as NA to accept default values, which are generally reasonable guesses as to aesthetically pleasing and PK-relevant intervals. |
x_axis_label |
optionally supply a character vector or an expression to use for the x axis label |
pad_x_axis |
optionally add a smidge of padding to the the x axis
(default is TRUE, which includes some generally reasonable padding). If
changed to FALSE, the y axis will be placed right at the beginning of your
time range and all data will end exactly at the end of the time
range specified. If you want a specific amount of x-axis padding,
set this to a number; the default is |
pad_y_axis |
optionally add a smidge of padding to the y axis (default
is TRUE, which includes some generally reasonable padding). As with
|
y_axis_limits_lin |
optionally set the Y axis limits for the linear
plot, e.g., |
y_axis_limits_log |
optionally set the Y axis limits for the semi-log
plot, e.g., |
y_axis_label |
optionally supply a character vector or an expression to use for the y axis label |
line_type |
Optionally specify what types of lines are used to depict
Input should look like
this, for example:
|
line_transparency |
optionally specify the transparency for the trial mean or percentile lines. Acceptable values are from 0 (fully transparent, so no line at all) to 1 (completely opaque or black). If left as the default NA, this value will be automatically determined. |
line_color |
optionally specify what colors to use for the lines.
Acceptable input for, e.g., the substrate alone to be blue and the
substrate + Inhibitor 1 to be red: |
line_width |
optionally specify how thick to make the lines. Acceptable input is a number; the default is 1 for most lines and 0.8 for some, to give you an idea of where to start. |
hline_position |
numerical position(s) of any horizontal lines to add to
the graph. The default is NA to have no lines, and good syntax if you
do want lines would be, for example, |
hline_style |
the line color and type to use for any horizontal lines
that you add to the graph with |
vline_position |
numerical position(s) of any vertical lines to add to
the graph. The default is NA to have no lines, and good syntax if you
do want lines would be, for example, |
vline_style |
the line color and type to use for any vertical lines that
you add to the graph with |
legend_position |
specify where you want the legend to be. Options are "left", "right", "bottom", "top", or "none" (default) if you don't want one at all. |
legend_label |
optionally indicate on the legend whether the perpetrator is an inhibitor, inducer, activator, or suppressor. Input will be used as the label in the legend for the line style and the shape. If left as the default NA when a legend is included and a perpetrator is present, the label in the legend will be "Inhibitor". |
prettify_compound_names |
TRUE (default), FALSE or a character vector:
This is asking whether to make compound names prettier in legend entries
and in any Word output files. This was designed for simulations where the
substrate and any metabolites, perpetrators, or perpetrator metabolites are
among the standard options for the simulator, and leaving
|
graph_labels |
TRUE or FALSE for whether to include labels (A, B, C, etc.) for each of the small graphs. (Not applicable if only outputting linear or only semi-log graphs.) |
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 |
qc_graph |
TRUE or FALSE (default) on whether to create a second copy of
the graph where the left panel shows the original graph and the right panel
shows information about the simulation trial design. This works MUCH faster
when you have already used |
existing_exp_details |
output from |
return_caption |
TRUE or FALSE (default) for whether to return any
caption text to use with the graph. This works best if you supply something
for the argument |
save_graph |
optionally save the output graph by supplying a file name in quotes here, e.g., "My conc time graph.png" or "My conc time graph.docx". If you leave off ".png" or ".docx" from the file name, it will be saved as a png file, but if you specify a different graphical file extension, it will be saved as that file format. Acceptable graphical file extensions are "eps", "ps", "jpeg", "jpg", "tiff", "png", "bmp", or "svg". Do not include any slashes, dollar signs, or periods in the file name. Leaving this as NA means the file will not be saved to disk. |
fig_height |
figure height in inches; default is 6 |
fig_width |
figure width in inches; default is 5 |
Output is a ggplot2 graph or two ggplot2 graphs arranged with ggpubr::ggarrange()
enz_plot(sim_enz_dataframe = CYP3A4_liver)
enz_plot(sim_enz_dataframe = CYP3A4_gut, legend_position = "right")
enz_plot(sim_enz_dataframe = CYP3A4_gut,
gut_tissue = "small intestine",
figure_type = "percentile ribbon",
legend_position = "right")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.