plot_dye_screen: Map dye screen aesthetics to a ggplot

View source: R/plot_dye_screen.R

plot_dye_screenR Documentation

Map dye screen aesthetics to a ggplot

Description

This function maps the core dye screening data to aesthetics used in the dye screen plots. Later functions introduce faceting (add_facet_wrap_10(), add_facet_grid()), and enforce standard panel sizing (force_panel_sizing()).

Usage

plot_dye_screen(
  tidied_screen,
  .temp_col = "Temperature",
  .value_col = "value",
  .color_col = "channel_f",
  .linetype_col = "type",
  .variable_col = "variable",
  .line_size = 0.3,
  .line_alpha = 0.8,
  .color_legend_title = "Channel",
  .linetype_legend_title = "",
  .scale_color_vals = c(Cy5.5 = "#67000d", Cy5 = "#a50f15", ROX = "#ef3b2c", TAMRA =
    "#f16913", JOE = "#74c476", FAM = "#2171b5"),
  .scale_linetype_vals = c(buffer = "dashed", protein = "solid"),
  .plot_theme = theme_screen_austere,
  .use_default_x_scaling = TRUE,
  .x_scale_breaks = NULL,
  ...
)

Arguments

tidied_screen

a tibble containing raw data from a dye screen, both protein and buffer, e.g. as output by tidy_dye_screen()

.temp_col

the name of the column in tidied_screen containing Temperatures, as a string. Defaults to "Temperature".

.value_col

the name of the column in tidied_screen containing raw values, as a string. Defaults to "value".

.color_col

the name of the column in tidied_screen to be mapped to color. Defaults to "channel_f". If this column does not contain only the values "FAM", "JOE", "TAMRA", "ROX", "Cy5", and "Cy5.5", a vector mapping values to colors will need to be specified in the .scale_color_vals argument of this fucntion.

.linetype_col

the name of the column in tidied_screen to be mapped to linetype. Defaults to "type". If this column does not contain only the values "protein", and "buffer", a vector mapping values to linetypes will need to be specified in the .scale_linetype_vals argument of this fucntion.

.variable_col

the name of the column in tidied_screen which uniquely identified each trace. Defaults to "variable".

.line_size

a number, giving the size of the lines on the plot. Defaults to 0.3

.line_alpha

a number, giving the transparency of the lines on the plot. Defaults to 0.8

.color_legend_title

a string, which appears as the title of the color variable in the legend. Defaults to "Channel"

.linetype_legend_title

a string, which appears as the title of the linetype variable in the legend. Defaults to "", as this legend is pretty much self-explanatory in the default DSFworld plots.

.scale_color_vals

a named character vector, passed to the values argument of scale_color_manual, assigning values mapped to the color aesthetic via the .color_col argument of this function, to their specific colors. Defaults to c("Cy5.5" = "#67000d", "Cy5" = "#a50f15", "ROX" = "#ef3b2c", "TAMRA" = "#f16913", "JOE" = "#74c476", "FAM" = "#2171b5").

.scale_linetype_vals

a named character vector, passed to the values argument of scale_linetype_manaul, assigning values mapped to the linetype aesthetic via the .linetype_col argument of this function, to their specific linetypes. Defaults to c("Cy5.5" = "#67000d", "Cy5" = "#a50f15", "ROX" = "#ef3b2c", "TAMRA" = "#f16913", "JOE" = "#74c476", "FAM" = "#2171b5").

.plot_theme

a theme to apply to the final plot. Defaults to 'theme_screen_austere', a theme defined inside this package.

.use_default_x_scaling

a boolean value; whether or not to use the default x scale from ggplot2. Defaults to TRUE. If FALSE, the x axis is created with breaks set by the argument '.x_scale_breaks' to this function.

.x_scale_breaks

a vector, giving values at which to place breaks on the x axis, if .use_default_x_scaling is set to FALSE. Defaults to NULL.

...

additional argument, passed to theme_screen_austere.

Value

a ggplot2 object containing dye screen data, and aesthetic mappings for geom_line(), along with olors, and linetypes.


taiawu/dsfworld_package documentation built on June 18, 2024, 5:39 a.m.