Generates linear regression plots for each measured feature within a dataset. The function allows for customization of the plot's appearance and format, and it can filter features based on specified criteria.
Usage
plot_responsecurves(
data = NULL,
variable = "intensity",
filter_data = FALSE,
output_pdf = FALSE,
include_feature_filter = "",
exclude_feature_filter = "",
max_regression_value = NA,
path = "",
rows_page = 4,
cols_page = 5,
specific_page = NA,
point_size = 1.5,
line_width = 0.7,
scaling_factor = 1,
page_orientation = "LANDSCAPE",
font_base_size = 7,
show_progress = TRUE,
return_plots = FALSE
)
Arguments
- data
A
MidarExperiment
object containing the dataset with sample amounts and detector signals. Required.- variable
The variable name to plot on the y-axis, usually a measure of intensity. Defaults to
"intensity"
.- filter_data
Logical. Indicates whether to use quality control (QC) filtered data (
TRUE
) or the raw data (FALSE
). Defaults toFALSE
.- output_pdf
Logical. If
TRUE
, saves the generated plots as a PDF file. Defaults toFALSE
.- include_feature_filter
A regex pattern to filter and include features that match the criteria. If omitted, all features are considered.
- exclude_feature_filter
A regex pattern to filter and exclude features that match the criteria. If omitted, no features are excluded.
- max_regression_value
The maximum x value (analyzed amount) for which the regression line is fitted. Defaults to
NA
, considering all data points.- path
The file path for saving the PDF. Defaults to an empty string, meaning no file is saved.
- rows_page
The number of rows of plots per page for the PDF output. Defaults to 4.
- cols_page
The number of columns of plots per page for the PDF output. Defaults to 5.
- specific_page
An integer specifying a particular page to plot. If
NA
, all pages are plotted.- point_size
Numeric value specifying the size of points in the plot. Defaults to 1.5.
- line_width
Numeric value specifying the width of regression lines. Defaults to 0.7.
- scaling_factor
A universal scaling factor for fonts, symbols, and lines. Defaults to 1.
- page_orientation
The orientation of the PDF paper, either
"LANDSCAPE"
or"PORTRAIT"
. Defaults to"LANDSCAPE"
.- font_base_size
The base font size for text in the plots. Defaults to 7.
- show_progress
Logical. Show a progress bar during plot creation if set to
TRUE
. Defaults toTRUE
.- return_plots
Logical. If
TRUE
, returns the plots as a list ofggplot2
objects. Each item represents a page of plots. Defaults toFALSE
.