make_normalized_EPSC_data() creates a dataframe of evoked or spontaneous
current data from a raw .csv file. The function will create a new column
containing the evoked or spontaneous current amplitudes normalized relative
to the mean current amplitude during the baseline period. For evoked current
data, the function also adds a column for the paired pulse ratio (PPR = P2/P1, where P2 is the amplitude of the
second evoked current).
Usage
make_normalized_EPSC_data(
filename = "Data/Sample-eEPSC-data.csv",
current_type = "eEPSC",
min_time_value = 0,
max_time_value = 25,
baseline_length = 5,
interval_length = 5,
decimal_places = 2,
negative_transform_currents = "yes",
save_output_as_RDS = "no"
)Arguments
- filename
A filepath to a .csv file. See
add_new_cells()for the function that will merge raw data (a .csv with 4 columns:letter,ID,P1, andP2) and acell-characteristics.csvfile (with columns for factors likeanimal,age,sex,synapses). Please see the section on "Required columns" below.- current_type
A character describing the current type. Allowed values are
"eEPSC"or"sEPSC".- min_time_value
Minimum time value (numeric; in minutes), which defaults to
0.- max_time_value
Maximum recording length (numeric; in minutes). All data points will be filtered to time values less than or equal to this value. Defaults to
25.- baseline_length
Length of the baseline (numeric; in minutes). Refers to data collected before applying a hormone, antagonist, or a protocol like high frequency stimulation. Defaults to
5.- interval_length
Length of each interval (numeric; in minutes). Used to divide the dataset into broad ranges for statistical analysis. Important!
max_recording_lengthmust be evenly divisible byinterval_length. Defaults to5.- 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.
- negative_transform_currents
A character (
"yes"or"no") describing ifP1andP2should be negative transformed. If "yes", the values will be multiplied by (-1). This only applies whencurrent_type == "eEPSC"- It will be ignored for spontaneous current data.- 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 that can be viewed and used for further analyses in R. New or modified columns include:
P1(for evoked currents only) May be negative-transformed ifnegative_transform=="yes"P2(for evoked currents only) May be negative-transformed ifnegative_transform=="yes"PPR(for evoked currents only) A numeric value that represents the paired pulse ratio (PPR) of the evoked currents, generated usingdplyr::mutate(PPR = P2/P1).intervalA character value indicating the interval that the data point belongs to. For example,intervalwill be"t0to5"for any data points from 0 to 5 minutes. Example values:"t0to5","t5to10", etc.baseline_rangeA logical value required for the baseline transformation. It is set toTRUEwhen time is within the baseline period (e.g.Time <= 5) andFALSEat all other times.baseline_meanA numeric value representing the mean evoked current amplitude during the baseline period. There is a different baseline_mean for each letter.P1_transformed(for evoked currents only) A numeric value representing the first evoked current amplitude (pA) normalized relative to the mean amplitude during the recording's baseline.P2_transformed(for evoked currents only) A numeric value representing the second evoked current amplitude (pA) normalized relative to the mean amplitude during the recording's baseline.amplitude_transformed(for spontaneous currents only) A numeric value representing the spontaneous current amplitude (pA) normalized relative to the mean amplitude during the recording's baseline.
Required basic columns
It doesn't matter if the data are evoked or current type - these columns should be included in your data.
letterA character value that is a unique identifier for a single recording. Used to link data sets for evoked or spontaneous currents and cell-characteristics.synapsesA character value (e.g."Glutamate"or"GABA").sexA character value (e.g."Male"or"Female").treatmentA character value (e.g."Control","HNMPA").timeA numeric value that represents time in minutes. This column is autogenerated inadd_new_cells().IDA character value for the recording filename.XA numeric value representing the x-value of the cell's location in µm. Leave this blank if you don't have this data.YA numeric value representing the y-value of the cell's location in µm. Leave this blank if you don't have this data.ageA numeric value representing the animal's age. Can be any value as long as the time units are consistent throughout (e.g. don't mix up days and months when reporting animal ages).animalA numeric value representing the animal's ID or number.categoryA numeric value representing the experiment type. Used to assign top-level groups for further analyses, withtreatmentas subgroups.cellA character or numeric value representing the cell. For example, use3.1.1for animal #3, slice #1, cell #1.R_aA list of values for the access resistance, which would have been monitored at several timepoints throughout the recording. See the documentation for theR_acolumn in the documentation forsample_cell_characteristicswith?sample_cell_characteristics.notesAn optional character column with notes about any issues, sweeps that were removed during Clampfit processing, etc.days_aloneA numeric value describing the number of days that the animal was left alone in a cage. This typically ranges from 0 to 2. Fasted animals will have 1 day alone.animal_or_slicing_problemsA character value ("yes"or"no") describing if there were any issues with the animal (for example, the animal was unusually anxious) or slicing (there were delays during the process, the slices were crumpling, etc.).
Evoked current data:
If the data are evoked currents (current_type == "eEPSC"), the data must
contain the basic columns mentioned in Required basic columns plus these
columns:
P1A numeric value representing the amplitude of the first evoked current in pA.P2A numeric value representing the amplitude of the second evoked current in pA.
Spontaneous current data:
If the data are spontaneous currents (current_type == "sEPSC"), the data
must contain the basic columns mentioned in Required basic columns plus
these columns:
recording_numA numeric value representing the recording number. This was incorporated before we switched to concatenating all recordings into one, but it needs to remain here to prevent breaking previous projects. It should be set to1.traceA numeric value representing the trace (automatically generated in Clampfit) where the current occurred.time_of_peakA numeric value representing the time of the peak in milliseconds relative to trace number. This is automatically calculated in Clampfit.timeA numeric value representing the absolute time when the current happened, relative to the start of the recording. This is autogenerated. Seeadd_new_cells()for a description of how the true time value (time) is calculated from therecording_numandtrace.amplitudeA numeric value representing the amplitude of the evoked current in pA.
See also
add_new_cells() to add new recording data to your existing raw
csv. It will merge raw data (a .csv with 4 columns: letter, ID, P1,
and P2) and a cell-characteristics.csv file (with columns for factors
like animal, age, sex, synapses).
add_new_cells() and make_summary_EPSC_data() for
functions that further process the data.
Examples
make_normalized_EPSC_data(
filename = import_ext_data("sample_eEPSC_data.csv"),
current_type = "eEPSC",
min_time_value = 0,
max_time_value = 25,
interval_length = 5,
baseline_length = 5,
decimal_places = 2,
negative_transform_currents = "yes"
)
#> # A tibble: 2,107 × 25
#> # Groups: letter [7]
#> x.1 letter synapses sex treatment time ID P1 P2 X Y
#> <dbl> <fct> <fct> <fct> <fct> <dbl> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 1 AO Glutamate Male Control 0 23623002 17.4 78.4 NA NA
#> 2 2 AO Glutamate Male Control 0.08 23623002 24.1 58.9 NA NA
#> 3 3 AO Glutamate Male Control 0.17 23623002 35.6 60.0 NA NA
#> 4 4 AO Glutamate Male Control 0.25 23623002 15.8 32.3 NA NA
#> 5 5 AO Glutamate Male Control 0.33 23623002 53.9 26.4 NA NA
#> 6 6 AO Glutamate Male Control 0.42 23623002 45.5 74.8 NA NA
#> 7 7 AO Glutamate Male Control 0.5 23623002 28.1 69.6 NA NA
#> 8 8 AO Glutamate Male Control 0.58 23623002 27.8 62.0 NA NA
#> 9 9 AO Glutamate Male Control 0.67 23623002 60.0 52.7 NA NA
#> 10 10 AO Glutamate Male Control 0.75 23623002 46.9 60.3 NA NA
#> # ℹ 2,097 more rows
#> # ℹ 14 more variables: age <dbl>, animal <dbl>, category <fct>, cell <chr>,
#> # notes <lgl>, days_alone <fct>, animal_or_slicing_problems <fct>, R_a <chr>,
#> # PPR <dbl>, interval <fct>, baseline_range <lgl>, baseline_mean <dbl>,
#> # P1_transformed <dbl>, P2_transformed <dbl>
