Skip to contents

This function enables you to perform a series of paired t-tests comparing the mean current amplitude within each interval relative to the mean current amplitude during the baseline. This uses the paired_t_test function from rstatix, with paired = TRUE and Holm's adjustment for multiple comparisons (p.adjust.method = "holm"). The resulting output table can also be used to apply significance stars to the plot in plot_summary_current_data().

Usage

perform_t_tests_for_summary_plot(
  data,
  test_category,
  include_all_treatments = "yes",
  list_of_treatments = NULL,
  current_type = "eEPSC",
  parameter = "amplitude",
  baseline_interval = "t0to5",
  interval_length = 5,
  treatment_colour_theme,
  save_output_as_RDS = "no"
)

Arguments

data

A dataframe containing the summary data generated from make_summary_EPSC_data().

test_category

A numeric value describing the experimental category. In the sample dataset for this package, 2 represents experiments where insulin was applied continuously after a 5-minute baseline period.

include_all_treatments

A character ("yes" or "no") specifying if the plot will include data from all treatments. If "no", you must specify a list of treatments in list_of_treatments.

list_of_treatments

A list of character values describing the treatments that will be in the plot. Defaults to NULL, since include_all_treatments is "yes" by default.

current_type

A character describing the current type. Allowed values are "eEPSC" or "sEPSC".

parameter

A character value specifying the parameter to be plotted on the y-axis. For evoked currents (current_type = "eEPSC"), the available parameter is "amplitude", which contains amplitudes normalized relative to the baseline. For spontaneous currents (current_type = "sEPSC"), the available parameters are "amplitude" (normalized currents), "raw_amplitude", "frequency" (normalized frequency) or "raw_frequency".

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().

interval_length

Length of each interval (numeric; in minutes). Used to divide the dataset into broad ranges for statistical analysis. Important! max_recording_length must be evenly divisible by interval_length. Defaults to 5.

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.

save_output_as_RDS

A character ("yes" or "no") describing if the resulting object should be saved as an RDS file in the raw data folder.

Value

A dataframe

See also

make_normalized_EPSC_data() for an example of how the normalized current amplitudes were created.

Examples

perform_t_tests_for_summary_plot(
  data = sample_summary_eEPSC_df,
  test_category = 2,
  include_all_treatments = "yes",
  list_of_treatments = NULL,
  current_type = "eEPSC",
  parameter = "amplitude",
  baseline_interval = "t0to5",
  interval_length = 5,
  treatment_colour_theme = sample_treatment_names_and_colours,
  save_output_as_RDS = "no"
)
#>        treatment                 .y. group1  group2 n1 statistic df p_string
#> 1        Control mean_P1_transformed  t0to5 t10to15  4      4.89  3    0.033
#> 2        Control mean_P1_transformed  t0to5 t15to20  4      6.96  3    0.018
#> 3        Control mean_P1_transformed  t0to5 t20to25  4      8.01  3    0.016
#> 4        Control mean_P1_transformed  t0to5  t5to10  4      2.28  3     0.11
#> 5          HNMPA mean_P1_transformed  t0to5 t10to15  5      3.15  4     0.13
#> 6          HNMPA mean_P1_transformed  t0to5 t15to20  5      2.99  4     0.13
#> 7          HNMPA mean_P1_transformed  t0to5 t20to25  5      3.19  4     0.13
#> 8          HNMPA mean_P1_transformed  t0to5  t5to10  5      3.10  4     0.13
#> 9            PPP mean_P1_transformed  t0to5 t10to15  5      0.89  4     0.84
#> 10           PPP mean_P1_transformed  t0to5 t15to20  5      1.50  4     0.63
#> 11           PPP mean_P1_transformed  t0to5 t20to25  5      1.96  4     0.48
#> 12           PPP mean_P1_transformed  t0to5  t5to10  5      0.78  4     0.84
#> 13 PPP_and_HNMPA mean_P1_transformed  t0to5 t10to15  5      0.94  4   > 0.99
#> 14 PPP_and_HNMPA mean_P1_transformed  t0to5 t15to20  5      0.84  4   > 0.99
#> 15 PPP_and_HNMPA mean_P1_transformed  t0to5 t20to25  5      1.39  4     0.95
#> 16 PPP_and_HNMPA mean_P1_transformed  t0to5  t5to10  5     -0.59  4   > 0.99
#>    significance_stars asterisk_time
#> 1                   *          12.5
#> 2                   *          17.5
#> 3                   *          22.5
#> 4                               7.5
#> 5                              12.5
#> 6                              17.5
#> 7                              22.5
#> 8                               7.5
#> 9                              12.5
#> 10                             17.5
#> 11                             22.5
#> 12                              7.5
#> 13                             12.5
#> 14                             17.5
#> 15                             22.5
#> 16                              7.5