diff --git a/R/ElectrodeBurstsClass.R b/R/ElectrodeBurstsClass.R index 5f51923..93b8ab4 100644 --- a/R/ElectrodeBurstsClass.R +++ b/R/ElectrodeBurstsClass.R @@ -202,7 +202,7 @@ ElectrodeBursts <- R6Class( #' @param plot_title The title of the plot. #' @return A ggpubr object representing the combined raster plots. #' - create_comparison_raster_plot = function(control_group, treatments_array, plot_title) { + create_comparison_raster_plot = function(control_group, treatments_array, plot_title, well.num) { create_raster <- function(well, x_lim) { plot_data <- self$data %>% dplyr::mutate( @@ -296,7 +296,7 @@ ElectrodeBursts <- R6Class( # Combine the two well plots side by side combined_plot <- ggpubr::ggarrange( plotlist = well_plots, - ncol = 2, + ncol = well.num, nrow = 1, common.legend = TRUE, legend = "none" diff --git a/README.md b/README.md index cc3d96f..139a9f3 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Key methods: - `control_group`: character - The control group to be included in the comparison - `treatments_array`: character vector - An array of treatment names to compare - `plot_title`: character - The title of the plot + - `num.well`: number - Highest number of well replicates amongst chosen conditions - Returns: ggpubr object - A combined raster plot comparing multiple treatments ## Usage @@ -86,12 +87,14 @@ To use this package, start by initializing the appropriate class with your data ```R # For single file analysis +# file is the average value .csv, the one with no subtitles mea_analysis <- MEAnalysis$new("path/to/your/file.csv") # For batch analysis batch_analysis <- BatchMEAnalysis$new(list_of_file_paths) # For electrode burst analysis +# file is the electrode_burst_list electrode_bursts <- ElectrodeBursts$new("path/to/your/file.csv") ``` @@ -104,7 +107,7 @@ Then, you can use the various methods provided by each class to analyze your dat # Create a treatment averages t-test plot plot <- mea_analysis$treatment_averages_t_test_plot( "Control", - c("Treatment1", "Treatment2"), + c("Control", "Treatment1", "Treatment2"), "Treatment Averages T-Test Plot" ) # plot is a ggplot object @@ -126,7 +129,7 @@ plot <- batch_analysis$run_mea_analysis( # Generate significance overview overview <- batch_analysis$generate_significance_overview( "Control", - c("Treatment1", "Treatment2"), + c("Control", "Treatment1", "Treatment2"), c("MeanFiringRate", "BurstFrequency"), "Significance Overview" ) @@ -139,8 +142,9 @@ overview <- batch_analysis$generate_significance_overview( # Create a comparison raster plot plot <- electrode_bursts$create_comparison_raster_plot( "Control", - c("Treatment1", "Treatment2"), - "Comparison Raster Plot" + c("Control", "Treatment1", "Treatment2"), + "Comparison Raster Plot", + 3 ) # plot is a ggpubr object ```