ontogeny_plot: Graph the ontogenies of drug-metabolizing enzymes and...

View source: R/ontogeny_plot.R

ontogeny_plotR Documentation

Graph the ontogenies of drug-metabolizing enzymes and transporters

Description

ontogeny_plot uses the betas from the Simcyp Simulator to make graphs of the ontogenies of all the enzymes and transporters included in the Simulator.

Usage

ontogeny_plot(
  enzyme = NA,
  enzyme_type = NA,
  ontogeny_equations_to_use = NA,
  simulator_version = 23,
  compare_to_no_ontogeny = FALSE,
  age_range = c(0, 18),
  x_axis_interval = 3,
  facet1_column,
  facet1_title = NA,
  facet2_column,
  facet2_title = NA,
  colorBy_column,
  color_set = "default",
  legend_position = "right",
  save_graph = NA,
  fig_height = NA,
  fig_width = NA
)

Arguments

enzyme

drug-metabolizing enzymes and transporters to plot, which should be supplied as either a single string, in quotes, that we'll try to match (e.g., "CYP3A4" will get you both the Upreti and Salem CYP3A4 ontogeny profiles as well as "CYP3A4 in vitro" and "Intestinal CYP3A4") or as a character vector of the enzymes or transporters you want. Options are listed in the data.frame OntogenyEquations. Whatever you supply, we'll look for it in either the column "Enzyme", which is just the actual isoform name, or in the column EnzymeDescription, which specifies exactly which ontogeny profile it is. To see the object OntogenyEquations and get a better idea of what we mean, type this into the console: view(OntogenyEquations)

enzyme_type

type of enzyme or transporter. Instead of graphing only a specific enzyme or enzymes, you can request any enzymes or transporters of a specific type. Please see the options in "OntogenyEquations" in the column "EnzymeType". This should be supplied as a character vector, e.g., enzyme_type = c("transporters", "UGTs")

ontogeny_equations_to_use

By default, the ontogeny equations are from the object OntogenyEquations, which is from the Simcyp Simulator help file. This can be useful for more-advanced R users if, for example, you want to filter OntogenyEquations more flexibly than just listing a string or character vector of enzymes to match for the arguments enzyme and enzyme_type or if you want to supply your own set of equations to describe the profiles as long as the data.frame is set up like OntogenyEquations. If you supply something here, the arguments enzyme and enzyme_type will be ignored.

simulator_version

Simcyp Simulator version to display. Options are 21, 22, 23 (default), or, once it's available on Simcyp Consultancy Team VDIs, 24.

compare_to_no_ontogeny

TRUE or FALSE (default) for whether to show a line on the graph for no ontogeny, which would be a horizontal line at 1.

age_range

age range in years as a numeric vector. Default is age_range = c(0, 18), which will include ages 0 to 18 years in the graph.

x_axis_interval

optionally specify the x-axis interval to use. Default is an interval of 3 years.

facet1_column

optionally break up the graph into small multiples; this specifies the first of up to two columns to break up the data by, and the designated column name should be unquoted, e.g., facet1_column = Tissue. If floating_facet_scale is FALSE and you haven't specified facet_ncol or facet_nrow, then facet1_column will designate the rows of the output graphs.

facet1_title

optionally specify a title to describe facet 1. This is ignored if floating_facet_scale is TRUE or if you have specified facet_ncol or facet_nrow.

facet2_column

optionally break up the graph into small multiples; this specifies the second of up to two columns to break up the data by, and the designated column name should be unquoted, e.g., facet2_column = CompoundID. If floating_facet_scale is FALSE and you haven't specified facet_ncol or facet_nrow, then facet2_column will designate the columns of the output graphs.

facet2_title

optionally specify a title to describe facet 2. This is ignored if floating_facet_scale is TRUE or if you have specified facet_ncol or facet_nrow.

colorBy_column

(optional) the column in OntogenyEquations that should be used for determining which color lines should be. This should be unquoted, e.g., colorBy_column = Tissue.

color_set

the set of colors to use. Options:

"default"

a set of colors from Cynthia Brewer et al. from Penn State that are friendly to those with red-green colorblindness. The first three colors are green, orange, and purple. This can also be referred to as "Brewer set 2". If there are only two unique values in the colorBy_column, then Brewer set 1 will be used since red and blue are still easily distinguishable but also more aesthetically pleasing than green and orange.

"Brewer set 1"

colors selected from the Brewer palette "set 1". The first three colors are red, blue, and green.

"ggplot2 default"

the default set of colors used in ggplot2 graphs (ggplot2 is an R package for graphing.)

"rainbow"

colors selected from a rainbow palette. The default palette is limited to something like 6 colors, so if you have more than that, that's when this palette is most useful. It's not very useful when you only need a couple of colors.

"blue-green"

a set of blues fading into greens. This palette can be especially useful if you are comparing a systematic change in some continuous variable – for example, increasing dose or predicting how a change in intrinsic solubility will affect concentration-time profiles – because the direction of the trend will be clear.

"blues"

a set of blues fading from sky to navy. Like "blue-green", this palette can be especially useful if you are comparing a systematic change in some continuous variable.

"greens"

a set of greens fading from chartreuse to forest. Like "blue-green", this palette can be especially useful if you are comparing a systematic change in some continuous variable.

"purples"

a set of purples fading from lavender to aubergine. Like "blue-green", this palette can be especially useful if you are comparing a systematic change in some continuous variable.

"Tableau"

uses the standard Tableau palette; requires the "ggthemes" package

"viridis"

from the eponymous package by Simon Garnier and ranges colors from purple to blue to green to yellow in a manner that is "printer-friendly, perceptually uniform and easy to read by those with colorblindness", according to the package author

a character vector of colors

If you'd prefer to set all the colors yourself to exactly the colors you want, you can specify those colors here. An example of how the syntax should look: color_set = c("dodgerblue3", "purple", "#D8212D") or, if you want to specify exactly which item in colorBy_column gets which color, you can supply a named vector. For example, if you're coloring the lines by the compound ID, you could do this: color_set = c("substrate" = "dodgerblue3", "inhibitor 1" = "purple", "primary metabolite 1" = "#D8212D"). If you'd like help creating a specific gradation of colors, please talk to a member of the R Working Group about how to do that using colorRampPalette.

legend_position

Specify where you want the legend to be. Options are "left", "right" (default in most scenarios), "bottom", "top", or "none" if you don't want one at all.

save_graph

optionally save the output graph by supplying a file name in quotes here, e.g., "My ontogeny graph.png"If you leave off ".png", the graph 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

fig_width

figure width in inches

Value

a ggplot2 graph

Examples

# none yet


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