This package provides tools for analyzing Microelectrode Array (MEA) data. It includes three main classes: MEAnalysis
, BatchMEAnalysis
, and ElectrodeBursts
.
For examples on how to use the package, see the scripts in the /main
directory.
To install the MEA Analysis package, you can use the devtools package in R. If you don't have devtools installed, you can install it first:
install.packages("devtools")
Then, you can install the MEA Analysis package directly from GitHub:
devtools::install_github("stevensusas/MEAnalysis")
After installation, load the package in your R session:
library(MEAnalysis)
The MEAnalysis
class is the core of the package, providing methods for processing and analyzing MEA data.
Key methods:
treatment_averages_t_test_plot(control, groups_to_plot, title = NULL)
- Parameters:
control
: character - The name of the control groupgroups_to_plot
: character vector - Names of groups to include in the plottitle
: character (optional) - The title of the plot
- Returns: ggplot object - A plot representing the t-test results for treatment averages
- Parameters:
The BatchMEAnalysis
class extends MEAnalysis
to handle batch processing of multiple MEA data files.
Key methods:
-
run_mea_analysis(conditions, metric, control_condition = NULL, title = NULL)
- Parameters:
conditions
: character vector - Conditions to analyzemetric
: character - The specific metric to analyzecontrol_condition
: character (optional) - The control condition to compare againsttitle
: character (optional) - The title of the plot
- Returns: ggplot object - A plot representing the MEA analysis results
- Parameters:
-
generate_significance_overview(control_group, groups_to_include = NULL, metrics_to_visualize = NULL, title)
- Parameters:
control_group
: character - The control group to compare againstgroups_to_include
: character vector (optional) - Specific groups to include in the analysismetrics_to_visualize
: character vector (optional) - Specific metrics to visualizetitle
: character - The title of the heatmap
- Returns: data.frame - A significance overview table
- Parameters:
The ElectrodeBursts
class focuses on processing and visualizing electrode burst data.
Key methods:
create_comparison_raster_plot(control_group, treatments_array, plot_title)
- Parameters:
control_group
: character - The control group to be included in the comparisontreatments_array
: character vector - An array of treatment names to compareplot_title
: character - The title of the plot
- Returns: ggpubr object - A combined raster plot comparing multiple treatments
- Parameters:
To use this package, start by initializing the appropriate class with your data file(s):
# For single file analysis
mea_analysis <- MEAnalysis$new("path/to/your/file.csv")
# For batch analysis
batch_analysis <- BatchMEAnalysis$new(list_of_file_paths)
# For electrode burst analysis
electrode_bursts <- ElectrodeBursts$new("path/to/your/file.csv")
Then, you can use the various methods provided by each class to analyze your data and generate plots. Here are some examples:
# Create a treatment averages t-test plot
plot <- mea_analysis$treatment_averages_t_test_plot(
"Control",
c("Treatment1", "Treatment2"),
"Treatment Averages T-Test Plot"
)
# plot is a ggplot object
# Run MEA analysis
plot <- batch_analysis$run_mea_analysis(
c("Control", "Treatment1", "Treatment2"),
"MeanFiringRate",
"Control",
"MEA Analysis Results"
)
# plot is a ggplot object
# Generate significance overview
overview <- batch_analysis$generate_significance_overview(
"Control",
c("Treatment1", "Treatment2"),
c("MeanFiringRate", "BurstFrequency"),
"Significance Overview"
)
# overview is a data.frame containing the significance overview
# Create a comparison raster plot
plot <- electrode_bursts$create_comparison_raster_plot(
"Control",
c("Treatment1", "Treatment2"),
"Comparison Raster Plot"
)
# plot is a ggpubr object
Contributions to improve the package are welcome. Please submit issues and pull requests on the project's GitHub repository.
[Insert your chosen license information here]