Skip to contents

import_cell_characteristics_df() is a wrapper around read.csv() to import a .csv file with information about a cell (animal, age, sex, synapses, X- and Y-coordinates, etc.). It replaces NA values in the R_a column with 0 to remove errors caused by missing data. The resulting dataframe can be merged with raw data into a summary table and used in downstream statistical analyses.

Usage

import_cell_characteristics_df(filename)

Arguments

filename

A filepath to a .csv file containing information on cell characteristics. The function uses here::here() to locate the filepath. See the details below for information on required columns.

Value

A dataframe

Required columns

These columns are required in the raw .csv file:

  • 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. Example: "A"

  • cell A character or numeric value representing the cell. For example, use 3.1.1 for animal #3, slice #1, cell #1.

  • sex A character value such as "Male" or "Female".

  • X A numeric value representing the x-value of the cell's location in µm.

  • Y A numeric value representing the y-value of the cell's location in µm.

  • age A 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). Do not use characters (e.g. avoid "P31" and use 31 instead).

  • animal A numeric value representing the animal's ID or number.

  • synapses A character value such as "Glutamate" or "GABA".

  • treatment A character value such as "Control" or "HNMPA".

  • category A numeric value representing the experiment type. Used to assign top-level groups for further analyses, with treatment as subgroups.

  • R_a A list of values for the access resistance, which would have been monitored at several timepoints throughout the recording. See the section R_a formatting below.

R_a formatting

R_a is a mandatory column with information about the cell's access resistance. Each element of this column must be a sequence of numbers, separated by a comma and a single space. Although this will be read in as a character, do not add quotation marks around the values in this column. For example, 1.5, 1.5, 1.6, 1.7, 1.7, 1.8 is an acceptable R_a value for a single cell.

import_cell_characteristics_df() will convert the character value into a list of numeric values (using stringr::str_split()). It will also convert blanks and NA values to 0. This allows access to be visualized as a sparkline in the R_a column of the interactive summary table made with make_interactive_summary_table().

See also

make_interactive_summary_table() to generate an interactive table with cell characteristics and raw data as sparklines.

Examples

import_cell_characteristics_df(import_ext_data("sample_cell_characteristics.csv"))
#>    letter    cell    sex      X      Y age animal  synapses     treatment
#> 1      BN  25.1.2   Male 152.92 337.19  29   25.0 Glutamate       Control
#> 2      AZ  21.1.1 Female 352.62 331.74  32   21.0 Glutamate       Control
#> 3      AO  17.1.1   Male     NA     NA  39   17.0 Glutamate       Control
#> 4      BO  27.2.1   Male     NA     NA  32   27.0 Glutamate         HNMPA
#> 5      BT  30.2.1   Male 387.19 586.98  37   30.0 Glutamate         HNMPA
#> 6      CG  35.1.3 Female 164.18 366.52  36   35.0 Glutamate         HNMPA
#> 7       L 8.5.2.1   Male     NA     NA  38    8.5 Glutamate       Control
#> 8      CZ  41.2.2   Male 296.51 492.90  28   41.0 Glutamate         HNMPA
#> 9      FT  72.2.1 Female 153.33 337.18  39   72.0 Glutamate         HNMPA
#> 10     FX  74.1.2 Female 234.69 495.50  28   74.0 Glutamate           PPP
#> 11     GF  77.3.1 Female 217.23 323.55  36   77.0 Glutamate           PPP
#> 12     GI  81.1.1 Female 235.96 284.23  28   81.0 Glutamate           PPP
#> 13     GK  84.1.1   Male 248.74 574.44  35   84.0 Glutamate           PPP
#> 14     GR  90.3.1   Male 313.50 415.97  34   90.0 Glutamate           PPP
#> 15     GX  97.2.3   Male     NA     NA  33   97.0 Glutamate PPP_and_HNMPA
#> 16     HB 100.1.1   Male 133.20 590.25  39  100.0 Glutamate PPP_and_HNMPA
#> 17     HC 100.2.2   Male 172.54 576.26  39  100.0 Glutamate PPP_and_HNMPA
#> 18     HG 103.2.1 Female     NA     NA  34  103.0 Glutamate PPP_and_HNMPA
#> 19     HN 109.1.1   Male 288.97 400.18  38  109.0 Glutamate PPP_and_HNMPA
#> 20     AV  20.3.1 Female  55.10 248.80  31   20.0 Glutamate       Control
#>    category                                              R_a
#> 1         2                     1.6, 1.7, 1.7, 1.8, 1.8, 2.0
#> 2         2           2.5, 2.6, 2.6, 2.9, 2.6, 2.6, 2.6, 2.7
#> 3         2                     1.9, 1.9, 1.8, 1.9, 2.0, 3.0
#> 4         2                     1.7, 1.7, 1.7, 1.8, 1.7, 1.8
#> 5         2 1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.8, 1.5, 1.5, 1.5
#> 6         2                     2.0, 2.1, 2.1, 2.2, 2.2, 2.2
#> 7         2                     1.4, 1.5, 1.5, 1.6, 1.6, 1.5
#> 8         2                     2.0, 2.0, 2.1, 2.2, 2.1, 2.1
#> 9         2                     1.5, 1.5, 1.6, 1.7, 1.9, 2.0
#> 10        2                     1.9, 1.8, 1.9, 2.1, 2.0, 2.3
#> 11        2                     1.6, 1.6, 1.7, 1.7, 1.8, 1.7
#> 12        2                     1.3, 1.3, 1.3, 1.3, 1.4, 1.4
#> 13        2                          2.2, 2.2, 2.2, 2.3, 2.5
#> 14        2                     1.3, 1.4, 1.5, 1.5, 1.6, 1.8
#> 15        2                     1.6, 1.6, 1.7, 1.7, 1.8, 1.7
#> 16        2                     2.2, 2.5, 2.5, 2.6, 2.6, 2.6
#> 17        2                1.4, 1.5, 1.6, 1.9, 1.8, 2.3, 2.0
#> 18        2                                                0
#> 19        2                     1.7, 1.7, 1.7, 1.7, 1.7, 1.7
#> 20        2                     1.6, 1.8, 1.8, 2.0, 2.0, 2.0