Skip to contents

make_summary_EPSC_data() allows you to divide data from a long recording (e.g. 30 minutes) into evenly-spaced intervals (e.g. 5 minutes). It will generate summary data like the mean current amplitude for each interval. This can be useful for inserting into statistical models to compare effect sizes across broad stretches of time. The interval length would have been previously specified in make_normalized_EPSC_data() using the interval_length argument.

Usage

make_summary_EPSC_data(
  data = patchclampplotteR::sample_raw_eEPSC_df,
  current_type = "eEPSC",
  save_output_as_RDS = "no",
  decimal_places = 2
)

Arguments

data

A data.frame object. If the data are evoked currents (current_type == "eEPSC"), this should be the raw evoked current data generated using make_normalized_EPSC_data(). If the data are spontaneous currents (current_type == "sEPSC"), this should be the pruned data $individual_cells dataset generated using make_pruned_EPSC_data().

current_type

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

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.

decimal_places

A numeric value indicating the number of decimal places the data should be rounded to. Used to reduce file size and prevent an incorrect representation of the number of significant digits.

Value

A dataframe with summary data such as the mean current amplitude, coefficient of variation, standard deviation, standard error, variance, variance-to-mean ratio, and inverse coefficient of variation squared for each interval.

New columns for evoked current data (current_type == "eEPSC") include:

  • mean_P1_transformed The amplitude of the first evoked current amplitude (% Baseline eEPSC amplitude) normalized to the mean baseline amplitude and averaged over the interval.

  • mean_P1_raw The amplitude of the first evoked current amplitude (pA) averaged over the interval.

  • n The number of datapoints used to create the averaged values. Corresponds to the number of sweeps per interval.

  • sd The standard deviation of the normalized evoked current data (P1_transformed).

  • cv The coefficient of variation of P1_transformed.

  • se The standard error of P1_transformed.

  • cv_inverse_square The inverse of the squared coefficient of variation of P1_transformed.

  • variance The variance of P1_transformed.

  • VMR The variance-to-mean ratio (VMR) of P1_transformed.

  • interval A character value indicating the interval that the data point belongs to. For example, interval will be "t0to5" for any data points from 0 to 5 minutes. Example values: "t0to5", "t5to10", etc.

  • letter, synapses, sex, treatment, etc. Unmodified columns from the original dataset describing the cell's properties.

New columns for spontaneous current data (current_type == "sEPSC") include:

  • mean_transformed_amplitude The average normalized spontaneous current amplitude (% Baseline sEPSC amplitude).

  • mean_raw_amplitude The average raw spontaneous current amplitude (pA).

  • n The number of datapoints used to create the average.

  • sd_transformed_amplitude The standard deviation of the normalized spontaneous current data (mean_transformed_amplitude).

  • se_transformed_amplitude The standard error of mean_transformed_amplitude.

  • mean_transformed_frequency The average normalized frequency (% Baseline frequency).

  • sd_transformed_frequency The standard deviation of mean_transformed_frequency.

  • se_frequency The standard error of mean_transformed_frequency.

  • mean_raw_frequency The average raw frequency (Hz).

  • letter, synapses, sex, treatment, etc. Unmodified columns from the original dataset describing the cell's properties.

See also

make_summary_EPSC_data() for an example of a function that further processes the data.

Examples


make_summary_EPSC_data(
  data = sample_raw_eEPSC_df,
  current_type = "eEPSC",
  save_output_as_RDS = "no",
  decimal_places = 2
)
#> # A tibble: 95 × 20
#>    category letter sex    treatment interval mean_P1_transformed mean_P1_raw
#>    <fct>    <fct>  <fct>  <fct>     <fct>                  <dbl>       <dbl>
#>  1 2        AO     Male   Control   t0to5                  100         36.8 
#>  2 2        AO     Male   Control   t5to10                  34.0       12.5 
#>  3 2        AO     Male   Control   t10to15                 17.7        6.49
#>  4 2        AO     Male   Control   t15to20                 18.6        6.85
#>  5 2        AO     Male   Control   t20to25                 21.3        7.82
#>  6 2        AZ     Female Control   t0to5                  100         44.3 
#>  7 2        AZ     Female Control   t5to10                  74.1       32.8 
#>  8 2        AZ     Female Control   t10to15                 53.7       23.8 
#>  9 2        AZ     Female Control   t15to20                 56.0       24.8 
#> 10 2        AZ     Female Control   t20to25                 50.7       22.4 
#> # ℹ 85 more rows
#> # ℹ 13 more variables: n <dbl>, sd <dbl>, cv <dbl>, se <dbl>,
#> #   cv_inverse_square <dbl>, variance <dbl>, VMR <dbl>, age <dbl>,
#> #   animal <dbl>, X <dbl>, Y <dbl>, time <dbl>, synapses <fct>

make_summary_EPSC_data(
  data = sample_pruned_sEPSC_df$individual_cells,
  current_type = "sEPSC",
  save_output_as_RDS = "no",
  decimal_places = 2
)
#> # A tibble: 35 × 16
#> # Groups:   category, letter, sex, treatment [7]
#>    category letter sex    treatment interval mean_transformed_amplitude
#>    <fct>    <fct>  <fct>  <fct>     <fct>                         <dbl>
#>  1 2        AZ     Female Control   t0to5                         100. 
#>  2 2        AZ     Female Control   t5to10                         96.6
#>  3 2        AZ     Female Control   t10to15                        94.5
#>  4 2        AZ     Female Control   t15to20                        94.6
#>  5 2        AZ     Female Control   t20to25                        88.3
#>  6 2        BO     Male   HNMPA     t0to5                         100. 
#>  7 2        BO     Male   HNMPA     t5to10                         89.3
#>  8 2        BO     Male   HNMPA     t10to15                        81.9
#>  9 2        BO     Male   HNMPA     t15to20                        82.2
#> 10 2        BO     Male   HNMPA     t20to25                        82.0
#> # ℹ 25 more rows
#> # ℹ 10 more variables: mean_raw_amplitude <dbl>,
#> #   sd_transformed_amplitude <dbl>, n <dbl>, se_transformed_amplitude <dbl>,
#> #   mean_transformed_frequency <dbl>, sd_transformed_frequency <dbl>,
#> #   se_transformed_frequency <dbl>, mean_raw_frequency <dbl>, time <dbl>,
#> #   synapses <fct>