Skip to contents

plot_spontaneous_current_parameter_comparison() is a useful function to see how spontaneous current amplitude or frequency change after adding a hormone. This function produces sina plots (with raw datapoints on top) for the raw amplitude (or raw frequency) for two time intervals: the baseline interval, and a user-specified interval after a hormone or other modification has been applied.

Usage

plot_spontaneous_current_parameter_comparison(
  data,
  plot_category = 2,
  plot_treatment = "Control",
  parameter = "raw_amplitude",
  hormone_added = "Insulin",
  baseline_interval = "t0to5",
  post_hormone_interval = "t20to25",
  large_axis_text = "no",
  treatment_colour_theme,
  theme_options,
  save_plot_png
)

Arguments

data

Summary data for spontaneous currents generated using make_summary_EPSC_data() where current_type == "sEPSC".

plot_category

A numeric value specifying the category, which can be used to differentiate different protocol types. In the sample dataset for this package, plot_category == 2 represents experiments where insulin was applied continuously after a 5-minute baseline period.

plot_treatment

A character value specifying the treatment you would like to plot (e.g. "Control"). plot_treatment represents antagonists that were present on the brain slice, or the animals were fasted, etc.

parameter

A character value ("raw_amplitude" or "raw_frequency") only. Normalized amplitude and frequency are not available because all baseline values are 100.

hormone_added

A character value that will be used as the label over the line annotating the period when a hormone was applied. Examples include "500 nM Insulin", "CCK + Leptin", and "Insulin". If you applied a high-frequency stimulation (HFS) protocol instead, write "HFS", and an annotation arrow will be added instead.

baseline_interval

A character value indicating the name of the interval used as the baseline. Defaults to "t0to5", but can be changed. Make sure that this matches the baseline interval that you set in make_normalized_EPSC_data().

post_hormone_interval

A character value specifying the interval used for the data points after a hormone or protocol was applied. This must match the post_hormone_interval used in make_variance_data().

large_axis_text

A character ("yes" or "no"). If "yes", a ggplot theme layer will be applied which increases the axis text.

treatment_colour_theme

A dataframe containing treatment names and their associated colours as hex values. See sample_treatment_names_and_colours for an example of what this dataframe should look like.

theme_options

A dataframe containing theme options. See sample_theme_options for an example of what this dataframe should look like.

save_plot_png

A character ("yes" or "no"). If "yes", the plot will be saved as a .png using ggsave. The filepath depends on the current type, but they will all go in subfolders below Figures/ in your project directory.

Value

A ggplot object

Examples

plot_spontaneous_current_parameter_comparison(
  data = sample_summary_sEPSC_df,
  plot_category = 2,
  plot_treatment = "Control",
  parameter = "raw_amplitude",
  hormone_added = "Insulin",
  baseline_interval = "t0to5",
  post_hormone_interval = "t20to25",
  large_axis_text = "no",
  treatment_colour_theme = sample_treatment_names_and_colours,
  theme_options = sample_theme_options,
  save_plot_png = "no"
)