Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/ElectrodeBurstsClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
```

Expand All @@ -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
Expand All @@ -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"
)
Expand All @@ -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
```
Expand Down