Skip to contents

This function pulls information from multiple dataframes to display everything about a cell (cell characteristics, evoked current data, and spontaneous current data) in an interactive table. The table is made with reactable::reactable(), so it can be filtered, sorted, and rearranged.

Usage

make_interactive_summary_table(
  cell_characteristics_dataframe,
  pruned_eEPSC_dataframe = NULL,
  pruned_sEPSC_dataframe = NULL,
  treatment_colour_theme,
  include_all_treatments = "yes",
  list_of_treatments = NULL,
  include_all_categories = "yes",
  list_of_categories = NULL,
  save_output_as_RDS = "no",
  ggplot_theme = patchclampplotteR_theme()
)

Arguments

cell_characteristics_dataframe

A dataframe containing the cell characteristics, generated from import_cell_characteristics_df().

pruned_eEPSC_dataframe

A dataframe containing pruned evoked current data, generated from make_pruned_EPSC_data(), where current_type == "eEPSC". Defaults to NULL to enable flexibility if you only have spontaneous data.

pruned_sEPSC_dataframe

A dataframe containing pruned spontaneous current data, generated from make_pruned_EPSC_data(), where current_type == "sEPSC". Defaults to NULL to enable flexibility if you only have evoked current data.

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.

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.

include_all_categories

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

list_of_categories

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

save_output_as_RDS

A character ("yes" or "no") describing if the resulting object should be saved as an RDS file in the folder "Data/Output-Data-from-R". The function will automatically create this folder if it doesn't already exist. Note: This is not the interactive table, but it is the raw dataframe that is later inserted into reactable::reactable(). This is useful if you want to build your own table using a different package, or you want to generate a customized reactable table yourself.

ggplot_theme

The name of a ggplot theme or your custom theme. This will be added as a layer to a ggplot object. The default is patchclampplotteR_theme(), but other valid entries include theme_bw(), theme_classic() or the name of a custom ggplot theme stored as an object.

Value

A reactable HTML widget that can be viewed in RStudio or exported in RMarkdown HTML documents. If save_output_as_RDS == "yes", the raw dataframe used to create the reactable is also exported as an .rds file into Data/Output-Data-from-R/.

Details

The table contains sparklines of the evoked current and spontaneous current amplitudes over time, which allows you to visually compare the overall response of a group of cells.

The sparklines are colour-coded by treatment, allowing you to quickly identify trends in response to a hormone/protocol for all cells belonging to a particular treatment.

If you only have one type of current data you can omit one dataframe. For example, if you have evoked current data but not spontaneous current data, fill in pruned_eEPSC_dataframe, and delete the argument pruned_sEPSC_dataframe, or fill it in as NULL.

Examples


# Note, the number of treatments is limited to "Control" and "PPP" to reduce run-time

## Both evoked and spontaneous data

make_interactive_summary_table(
  cell_characteristics_dataframe = sample_cell_characteristics,
  pruned_eEPSC_dataframe = sample_pruned_eEPSC_df,
  pruned_sEPSC_dataframe = sample_pruned_sEPSC_df,
  treatment_colour_theme = sample_treatment_names_and_colours,
  include_all_treatments = "no",
  list_of_treatments = c("Control", "PPP"),
  include_all_categories = "yes",
  list_of_categories = NULL,
  save_output_as_RDS = "no"
)
## Evoked current data only make_interactive_summary_table( cell_characteristics_dataframe = sample_cell_characteristics, pruned_eEPSC_dataframe = sample_pruned_eEPSC_df, treatment_colour_theme = sample_treatment_names_and_colours, include_all_treatments = "no", list_of_treatments = c("Control", "PPP"), include_all_categories = "yes", list_of_categories = NULL, save_output_as_RDS = "no" )
## Spontaneous current data only make_interactive_summary_table( cell_characteristics_dataframe = sample_cell_characteristics, pruned_sEPSC_dataframe = sample_pruned_sEPSC_df, treatment_colour_theme = sample_treatment_names_and_colours, include_all_treatments = "no", list_of_treatments = c("Control", "PPP"), include_all_categories = "yes", list_of_categories = NULL, save_output_as_RDS = "no" )