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 = TRUE, scales = "free", x_axis_scale_log10 = TRUE, export = FALSE, 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 |
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. |
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_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.