checkSS: Create a graph of simulated concentrations to check for...

View source: R/checkSS.R

checkSSR Documentation

Create a graph of simulated concentrations to check for whether a perpetrator drug is at steady-state when the victim drug is dosed

Description

checkSS creates a graph with time on the x axis and then some useful concentration point – C0, Cmax, Cmin (see notes on usage), or Clast for each dose – on the y axis. You can optionally overlay this graph with the full concentration-time data for that same compound or a different one. For example, you could create a graph with points for Clast for an inhibitor and then lines showing the substrate concentration-time data overlaid on top of that. This way, you can check whether the substrate is dosed after the inhibitor reaches steady state, and you could also check whether the inhibitor was present the entire time the substrate was getting eliminated. Additionally, if you supply a data.frame of enzyme-abundance data, that will be graphed above the concentration-time data, giving another check for whether everything important is at steady state.

Usage

checkSS(
  ct_dataframe,
  accum_compoundID = "inhibitor 1",
  overlay_compoundID = "substrate",
  sim_enz_dataframe = NA,
  t0 = 0,
  conc_point = "Clast",
  mark_dosing_substrate = "none",
  mark_dosing_inhibitor1 = "none",
  mark_dosing_inhibitor2 = "none",
  diff_cutoff = 0.05,
  mean_type = "arithmetic",
  x_axis_interval = NA,
  graph_title = NA,
  graph_title_size = 14,
  save_graph = NA,
  fig_height = 4,
  fig_width = 8
)

Arguments

ct_dataframe

the input concentration-time data generated by running the function extractConcTime or, if you'd also like to see an overlay of the substrate with or without any inhibitors, by running extractConcTime_mult. This function assumes there's data for only one tissue and that it's appropriate to compare all the data included, so you'll get graph artifacts if those are not the case.

accum_compoundID

the compound ID to monitor for accumulation. Defaults to "inhibitor 1". The time point requested will be shown as points and will be colored by percent difference from the previous point.

overlay_compoundID

the compound ID to overlay the complete concentration-time data for. Defaults to "substrate"; use "none" for no overlaid plot. This was designed for the following scenario: Monitor Ctrough for an inhibitor to make sure that it's at steady state, plot that as points, and then plot the concentration-time profile of a substrate over that to make sure that the inhibitor is present the whole time the substrate is being eliminated.

sim_enz_dataframe

optionally include a data.frame of enzyme abundances to plot below the main accumulation plot. If provided, all enzymes and tissues in the data will be included in the plot.

t0

start time for compound being plotted

conc_point

Concentration point to plot. Options are:

"C0"

concentration for the first time point available for that dose

"Clast"

(default) concentration for the last time point available for that dose

"Cmin"

the minimum concentration for that dosing interval, which may not be the last time point; this is somewhat prone to sampling artifacts and we generally recommend using "Clast" instead

"Cmax"

the maximum concentration for that dose number

mark_dosing_substrate

optionally mark substrate dosing intervals on the graph as "none" (default) to have no marks for the dosing intervals or a combination of a color in R and a named linetype, e.g., "red dotted" or "blue dashed" or even "#FFBE33 longdash".

mark_dosing_inhibitor1

optionally mark inhibitor 1 dosing intervals on the graph as "none" (default) to have no marks for the dosing intervals or a combination of a color in R and a named linetype, e.g., "red dotted" or "blue dashed" or even "#FFBE33 longdash".

mark_dosing_inhibitor2

optionally mark inhibitor 2 dosing intervals on the graph as "none" (default) to have no marks for the dosing intervals or a combination of a color in R and a named linetype, e.g., "red dotted" or "blue dashed" or even "#FFBE33 longdash".

diff_cutoff

what percent difference cutoff would you like to use to color the points? The default is for points with less than a 5% difference from the previous point to be blue and points with a larger percent difference to be red.

mean_type

the mean type to use since this function only displays summary data; defaults to the arithmetic mean

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.

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 conc time graph.png". If you do not designate a file extension, 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. Leaving this as NA means the file will not be automatically saved to disk.

fig_height

figure height in inches; default is 6

fig_width

figure width in inches; default is 5

Value

a ggplot2 graph

Examples


checkSS(ct_dataframe = MDZ_Keto)

checkSS(ct_dataframe = MDZ_Keto, conc_point = "Cmax")

checkSS(ct_dataframe = MDZ_Keto, conc_point = "Cmax",
   accum_compoundID = "inhibitor 1", overlay_compoundID = "none",
   mark_dosing_substrate = "pink dotted", diff_cutoff = 0.01,
   save_graph = "MDZ keto accumulation check.png")



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