This function enables you to append new raw recording data onto an existing
datasheet. It makes it easy and convenient to merge the cell parameters (age,
sex, etc.) with new data and add it to your current raw data. This function
also formats the dataset so it is immediately ready for use in functions like
make_normalized_EPSC_data()
.
Usage
add_new_cells(
new_raw_data_csv,
cell_characteristics_csv,
old_raw_data_csv,
current_type,
write_new_csv = "yes",
new_file_name,
decimal_places = 2
)
Arguments
- new_raw_data_csv
A filepath to a csv containing the new raw data. If the data are evoked current data (
current_type == "eEPSC"
) then this must contain 4 columns:letter
,ID
,P1
andP2
. If the data are spontaneous current data, the columns must beletter
,ID
,recording_num
,trace
,peak_amplitude
andtime_of_peak
. Please see the section below on required columns for more details.- cell_characteristics_csv
A filepath to a csv containing information about the cells. Please see
import_cell_characteristics_df()
for a description of what columns should be included. Don't forget to update this to include the cell characteristics for the new letters innew_raw_data_csv
!- old_raw_data_csv
A filepath to a csv containing the current raw data. Since this function appends the new data to the old data, this must be of the same current_type as the new data (e.g. the columns must be the same). If this is the first time you are running this function, start with a blank .csv file containing just the column titles in the first row.
- current_type
A character describing the current type. Allowed values are "eEPSC" or "sEPSC".
- write_new_csv
A character ("yes" or "no") describing if the new data should be written to a csv file. Defaults to "yes". Please specify a filename for the new csv file in
new_file_name
.- new_file_name
A filename for the csv containing the new data appended to the old data. Must be a character representing a filepath to a csv file. Examples include "Data/20241118-Raw-eEPSC-data.csv".
- 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 consisting of the old raw data with information from the new cells appended to it.
Required Columns
If the data are evoked currents (current_type == "eEPSC"
), the data must
contain the following four columns:
letter
A character value that is a unique identifier for a single recording. Used to link data sets for evoked or spontaneous currents and cell-characteristics.ID
A character value for the recording filename.P1
A numeric value representing the amplitude of the first evoked current in pA.P2
A numeric value representing the amplitude of the second evoked current in pA.
If the data are spontaneous currents (current_type == "sEPSC"
), the data
must contain the following columns:
letter
A character value that is a unique identifier for a single recording. Used to link data sets for evoked or spontaneous currents and cell-characteristics.ID
A character value for the recording filename.recording_num
A 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 to 1.trace
A numeric value representing the trace (automatically generated in Clampfit) where the current occured.time_of_peak
A numeric value representing the time of the peak in milliseconds relative to trace number. This is automatically calculated in Clampfit.time
A 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_num
andtrace.
amplitude
A numeric value representing the amplitude of the evoked current in pA.
See also
import_cell_characteristics_df()
for a list of required columns in the cell_characteristics_csv
.
make_normalized_EPSC_data()
for the next step in the analysis process.
Examples
if (FALSE) { # \dontrun{
add_new_cells(
new_raw_data_csv = import_ext_data("sample_new_eEPSC_data.csv"),
cell_characteristics_csv = import_ext_data("sample_cell_characteristics.csv"),
old_raw_data_csv = import_ext_data("sample_eEPSC_data.csv"),
current_type = "eEPSC",
write_new_csv = "no",
new_file_name = "20241118-Raw-eEPSC-Data.csv",
decimal_places = 2
)
} # }