drc_4p_plot | R Documentation |
Function for plotting four-parameter dose response curves for each group (precursor, peptide or
protein), based on output from fit_drc_4p
function.
drc_4p_plot(
data,
grouping,
response,
dose,
targets,
unit = "uM",
y_axis_name = "Response",
facet_title_size = 15,
facet = TRUE,
scales = "free",
x_axis_scale_log10 = TRUE,
x_axis_limits = c(NA, NA),
colours = NULL,
export = FALSE,
export_height = 25,
export_width = 30,
export_name = "dose-response_curves"
)
data |
a data frame that is obtained by calling the |
grouping |
a character column in the |
response |
a numeric column in a nested data frame called |
dose |
a numeric column in a nested data frame called |
targets |
a character vector that specifies the names of the precursors, peptides or
proteins (depending on |
unit |
a character value specifying the unit of the concentration. |
y_axis_name |
a character value specifying the name of the y-axis of the plot. |
facet_title_size |
a numeric value that specifies the size of the facet title. Default is 15. |
facet |
a logical value that indicates if plots should be summarised into facets of 20 plots. This is recommended for many plots. |
scales |
a character value that specifies if the scales in faceted plots (if more than one
target was provided) should be |
x_axis_scale_log10 |
a logical value that indicates if the x-axis scale should be log10 transformed. |
x_axis_limits |
a numeric vector of length 2, defining the lower and upper x-axis limit. The
default is |
colours |
a character vector containing at least three colours. The first is used for the points, the second for the confidence interval and the third for the curve. By default the first two protti colours are used for the points and confidence interval and the curve is black. |
export |
a logical value that indicates if plots should be exported as PDF. The output
directory will be the current working directory. The name of the file can be chosen using the
|
export_height |
a numeric value that specifies the plot height in inches for an exported plot.
The default is |
export_width |
a numeric value that specifies the plot height in inches for an exported plot.
The default is |
export_name |
a character value providing the name of the exported file if
|
If targets = "all"
a list containing plots for every unique identifier in the
grouping
variable is created. Otherwise a plot for the specified targets is created with
maximally 20 facets.
set.seed(123) # Makes example reproducible
# Create example data
data <- create_synthetic_data(
n_proteins = 2,
frac_change = 1,
n_replicates = 3,
n_conditions = 8,
method = "dose_response",
concentrations = c(0, 1, 10, 50, 100, 500, 1000, 5000),
additional_metadata = FALSE
)
# Perform dose response curve fit
drc_fit <- fit_drc_4p(
data = data,
sample = sample,
grouping = peptide,
response = peptide_intensity_missing,
dose = concentration,
retain_columns = c(protein)
)
str(drc_fit)
# Plot dose response curves
if (!is.null(drc_fit)) {
drc_4p_plot(
data = drc_fit,
grouping = peptide,
response = peptide_intensity_missing,
dose = concentration,
targets = c("peptide_2_1", "peptide_2_3"),
unit = "pM"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.