Title: | An Experiment Interface for 'DeepSqueak' Bioacoustics Research |
---|---|
Description: | Data processing and visualizations for rodent vocalizations exported from 'DeepSqueak'. These functions are compatible with the 'SqueakR' Shiny Dashboard, which can be used to visualize experimental results and analyses. |
Authors: | Simon Ogundare [aut, cre] |
Maintainer: | Simon Ogundare <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.3.0 |
Built: | 2025-02-24 03:49:46 UTC |
Source: | https://github.com/osimon81/squeakr |
Loads in a specific Excel File, and (optional) selects a time subset of data.
add_timepoint_data(data_path, t1 = "", t2 = "")
add_timepoint_data(data_path, t1 = "", t2 = "")
data_path |
The full path to the Excel file exported from DeepSqueak |
t1 |
The start time in the recording (in seconds) to start extracting calls |
t2 |
The end time in the recording (in seconds) to stop extracting calls |
An object containing the call data (under time constraints if specified)
## Not run: add_timepoint_data( data_path = "~/inst/extdata/Example_Mouse_Data.xlsx", t1 = 3, t2 = 12 ) ## End(Not run)
## Not run: add_timepoint_data( data_path = "~/inst/extdata/Example_Mouse_Data.xlsx", t1 = 3, t2 = 12 ) ## End(Not run)
Adds summarized timepoint data (acquired by running 'add_timepoint_data()', followed by 'score_timepoint_data()') to the created experiment object.
add_to_experiment(experiment, added_data)
add_to_experiment(experiment, added_data)
experiment |
The experiment object |
added_data |
The scored data object to be added to the experiment |
A list object containing statistics and metadata for the entire experiment. The 'groups' and 'experimenters' field will auto-populate based on added data using the 'update_experiment()' function.
## Not run: add_to_experiment(experiment = experiment, added_data = my_data)
## Not run: add_to_experiment(experiment = experiment, added_data = my_data)
Compares data across experimental groups, plotting the data as a bar graph with error bars.
analyze_factor(experiment, analysis_factor)
analyze_factor(experiment, analysis_factor)
experiment |
The experiment object |
analysis_factor |
A string representing the factor to analyze between groups |
A bar graph comparing the analysis_factor between groups
## Not run: analyze_factor(experiment = experiment, analysis_factor = "tonality")
## Not run: analyze_factor(experiment = experiment, analysis_factor = "tonality")
A pipeline function which creates a new experiment object, and adds data and metadata referenced from an external Google Sheets document.
autosqueakRpipeline()
autosqueakRpipeline()
An object containing the full experiment with all data added.
## Not run: expt <- autosqueakRpipeline()
## Not run: expt <- autosqueakRpipeline()
Creates an experiment object which will contain all data and metadata. This object will be saved and timestamped by date, so if working with this file over different dates, the object will not be overwritten as a new object will be created (to preserve backups).
create_experiment(experiment_name)
create_experiment(experiment_name)
experiment_name |
The name of the experiment |
A list object containing statistics and metadata for the entire experiment. The 'groups' and 'experimenters' field will auto-populate based on added data using the 'update_experiment()' function.
create_experiment(experiment_name = "My-Project")
create_experiment(experiment_name = "My-Project")
Data exported from DeepSqueak after processing 'Example Mouse Recording.flac'
data(deepsqueak_data)
data(deepsqueak_data)
A "data.frame"
with 714 rows and 17 columns. The definitions of
these parameters are sourced from the link in the references section.
The number of the call
The label extracted from DeepSqueak
Whether the call was accepted (as a call)
The call score, from DeepSqueak
The time when the call started
The time when the call ended
The length of the call
The median frequency of the call
The minimum frequency of the call
The maximum frequency of the call
The difference between the maximum and minimum call frequencies
The standard deviation of the call
The slope of the call
The call contour path length divided by the distance between start and end of the call
The signal/noise ratio
The frequency at the highest power
(DeepSqueak Wiki: Export to Excel Page)
data(deepsqueak_data)
data(deepsqueak_data)
Lists a condensed summary of data stored in the experiment object.
describe_experiment(experiment)
describe_experiment(experiment)
experiment |
The experiment object to be saved |
A list of information about the experiment
## Not run: describe_experiment(experiment = experiment_object)
## Not run: describe_experiment(experiment = experiment_object)
Plots call clusters within a data-point in a 3D Plotly graph, with principal frequency on the x-axis, mean power on the y-axis, and call length on the z-axis.
plotClusters(data_path)
plotClusters(data_path)
data_path |
The path to the raw data |
3D scatterplot
## Not run: plotClusters(data_path = "path")
## Not run: plotClusters(data_path = "path")
Plots call density against principal frequency and call length as a contoured heatmap. Histograms for these variables are displayed across their respective axes.
plotContours(data_path)
plotContours(data_path)
data_path |
The path to the raw data |
2D contour plot
## Not run: plotContours(data_path = "path")
## Not run: plotContours(data_path = "path")
Plots a box-plot based on principal frequency, grouped by custom labels designated in DeepSqueak.
plotCorrelations( data_path, graph_title = "Correlation Matrix", graph_subtitle = "Correlation coefficients labeled." )
plotCorrelations( data_path, graph_title = "Correlation Matrix", graph_subtitle = "Correlation coefficients labeled." )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
A ggplot2 visualization of the box-plot shown in the viewer window, which can be manually exported.
## Not run: plotCorrelations( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotCorrelations( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a distribution of delta frequencies as a histogram.
plotDeltaHistogram( data_path, graph_title = "Delta Frequency-Labeled Histogram", graph_subtitle = "Delta Frequency measures the kHz range of each detected call." )
plotDeltaHistogram( data_path, graph_title = "Delta Frequency-Labeled Histogram", graph_subtitle = "Delta Frequency measures the kHz range of each detected call." )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
A ggplot2 visualization of the histogram shown in the viewer window, which can be manually exported.
## Not run: plotDeltaHistogram( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDeltaHistogram( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, separating each custom label group into a separate plot in the figure.
plotDensitySplitByCustom( data_path, graph_title = "Call Distribution, Split by Custom Category Labels", graph_subtitle = "Calls are split by custom labels designated in DeepSqueak.", chosen_group = c() )
plotDensitySplitByCustom( data_path, graph_title = "Call Distribution, Split by Custom Category Labels", graph_subtitle = "Calls are split by custom labels designated in DeepSqueak.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensitySplitByCustom( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensitySplitByCustom( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, separating each duration group into a separate plot in the figure.
plotDensitySplitByDuration( data_path, graph_title = "Call Distribution Grouped by Duration (s)", graph_subtitle = "Duration groups are rounded to the nearest 0.01 second.", chosen_group = c() )
plotDensitySplitByDuration( data_path, graph_title = "Call Distribution Grouped by Duration (s)", graph_subtitle = "Duration groups are rounded to the nearest 0.01 second.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensitySplitByDuration( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensitySplitByDuration( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, separating each frequency group into a separate plot in the figure.
plotDensitySplitByFrequency( data_path, graph_title = "Call Distribution, Split by Frequency Range (kHz)", graph_subtitle = "Calls are split by frequency ranges of 10 kHz.", chosen_group = c() )
plotDensitySplitByFrequency( data_path, graph_title = "Call Distribution, Split by Frequency Range (kHz)", graph_subtitle = "Calls are split by frequency ranges of 10 kHz.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensitySplitByFrequency( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensitySplitByFrequency( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, grouped by custom labels set in DeepSqueak, collapsed into a single graph.
plotDensityStackedByCustom( data_path, graph_title = "Call Distribution Grouped by Custom Category Labels", graph_subtitle = "Calls are grouped by custom categories designated in DeepSqueak.", chosen_group = c() )
plotDensityStackedByCustom( data_path, graph_title = "Call Distribution Grouped by Custom Category Labels", graph_subtitle = "Calls are grouped by custom categories designated in DeepSqueak.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensityStackedByCustom( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensityStackedByCustom( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, grouped by duration of each call (rounded to the nearest 0.01 second), collapsed into a single graph.
plotDensityStackedByDuration( data_path, graph_title = "Call Distribution Grouped by Duration (s)", graph_subtitle = "Duration groups are rounded to the nearest 0.01 second.", chosen_group = c() )
plotDensityStackedByDuration( data_path, graph_title = "Call Distribution Grouped by Duration (s)", graph_subtitle = "Duration groups are rounded to the nearest 0.01 second.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensityStackedByDuration( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensityStackedByDuration( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, grouped by frequency group collapsed into a single graph.
plotDensityStackedByFrequency( data_path, graph_title = "Call Distribution Grouped by Frequency Range (kHz)", graph_subtitle = "Calls are grouped by frequency ranges of 10 kHz.", chosen_group = c() )
plotDensityStackedByFrequency( data_path, graph_title = "Call Distribution Grouped by Frequency Range (kHz)", graph_subtitle = "Calls are grouped by frequency ranges of 10 kHz.", chosen_group = c() )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
chosen_group |
Specifying a particular group to be highlighted in the graph |
A ggplot2 visualization of the density graph shown in the viewer window, which can be manually exported.
## Not run: plotDensityStackedByFrequency( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotDensityStackedByFrequency( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots an ethnogram, representing when detected calls occur through the length of the recording.
plotEthnogram( data_path, graph_title = "Call Ethnogram", graph_subtitle = "Calls are indicated by a vertical line." )
plotEthnogram( data_path, graph_title = "Call Ethnogram", graph_subtitle = "Calls are indicated by a vertical line." )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
A ggplot2 visualization of the ethnogram shown in the viewer window, which can be manually exported.
## Not run: plotEthnogram( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotEthnogram( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a tonality ethnogram, representing tonality (clarity) of calls throughout the recording.
plotEthnogramSplitByTonality( data_path, graph_title = "Ethnogram Split By Tonality", graph_subtitle = "Tonality: Signal/noise" )
plotEthnogramSplitByTonality( data_path, graph_title = "Ethnogram Split By Tonality", graph_subtitle = "Tonality: Signal/noise" )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
A ggplot2 visualization of the ethnogram shown in the viewer window, which can be manually exported.
## Not run: plotEthnogramSplitByTonality( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotEthnogramSplitByTonality( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a box-plot based on principal frequency, grouped by custom labels designated in DeepSqueak.
plotPrincipalBoxplot( data_path, graph_title = "Principal Frequency-Labeled Box-Plot", graph_subtitle = "Main frequencies where calls labeled in DeepSqueak predominate." )
plotPrincipalBoxplot( data_path, graph_title = "Principal Frequency-Labeled Box-Plot", graph_subtitle = "Main frequencies where calls labeled in DeepSqueak predominate." )
data_path |
The full path to the Excel file exported from DeepSqueak |
graph_title |
The title for the graph (there is a default title if not specified) |
graph_subtitle |
The subtitle for the graph (there is a default subtitle if not specified) |
A ggplot2 visualization of the box-plot shown in the viewer window, which can be manually exported.
## Not run: plotPrincipalBoxplot( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
## Not run: plotPrincipalBoxplot( data_path = "inst/extdata/Example_Mouse_Data.xlsx", graph_title = "myTitle", graph_subtitle = "myDescription" ) ## End(Not run)
Plots a density graph, separating each frequency group into a separate plot in the figure.
plotSummaryPDF(data_path, save_path = tempdir(), experimenter = "Anon")
plotSummaryPDF(data_path, save_path = tempdir(), experimenter = "Anon")
data_path |
The full path to the Excel file exported from DeepSqueak |
save_path |
The full path to the directory where the PDF will be saved (default is the current working directory) |
experimenter |
The name of the experimenter for naming the save file (default is "Anon") |
A PDF containing a series of relevant ethnograms and density graphs assessing the recording.
## Not run: plotSummaryPDF( data_path = "inst/extdata/Example_Mouse_Data.xlsx", save_path = tempdir(), experimenter = "experimenter_name" ) ## End(Not run)
## Not run: plotSummaryPDF( data_path = "inst/extdata/Example_Mouse_Data.xlsx", save_path = tempdir(), experimenter = "experimenter_name" ) ## End(Not run)
Plots interactive sunburst plot for animal distribution across experimental groups. Currently only valid for between-groups studies.
plotSunburstAnimals(experiment)
plotSunburstAnimals(experiment)
experiment |
The experiment object |
Sunburst distribution plotting animal distribution
## Not run: plotSunburstAnimals(experiment = experiment)
## Not run: plotSunburstAnimals(experiment = experiment)
Plots interactive sunburst plot for experimenter distribution across experimental groups. Currently only valid for between-groups studies.
plotSunburstExperimenters(experiment)
plotSunburstExperimenters(experiment)
experiment |
The experiment object |
Sunburst distribution plotting experimenter contribution
## Not run: plotSunburstExperimenters(experiment = experiment)
## Not run: plotSunburstExperimenters(experiment = experiment)
Plots interactive 3D plot for density of detected calls against call length (s) and principal frequency (kHz), using bivariate kernel density estimation provided via the MASS package
plotSurface(data_path, res = 60)
plotSurface(data_path, res = 60)
data_path |
The path to the call data |
res |
The resolution to render surface plot (default is 60) |
3D surface plot for the selected call dataset
## Not run: plotSurface(data_path = "path")
## Not run: plotSurface(data_path = "path")
Removes the data object of interest from the experiment according to a data_id. Removing the data with data_id = 12 removes the 12th dataset added to the experiment.
remove_experiment_data(experiment, data_id)
remove_experiment_data(experiment, data_id)
experiment |
The experiment object |
data_id |
The number of the data file to be removed |
The experiment file, with the rejected call data removed.
## Not run: experiment <- remove_experiment_data(experiment = experiment_object, data_id = 12)
## Not run: experiment <- remove_experiment_data(experiment = experiment_object, data_id = 12)
Saves the experiment as an .RData file in a specified location.
save_experiment(experiment, save_path)
save_experiment(experiment, save_path)
experiment |
The experiment object to be saved |
save_path |
The full path where the experiment object will be saved locally |
The experiment object, saved as "[NAME_OF_EXPERIMENT] ([SAVE_DATE]).RData" to the specified location.
## Not run: save_experiment(experiment = experiment_object, save_path = tempdir())
## Not run: save_experiment(experiment = experiment_object, save_path = tempdir())
Transforms data into a list of mean, standard deviation, and range of several call metrics.
score_timepoint_data(data_subset, group, animal, id, experimenter)
score_timepoint_data(data_subset, group, animal, id, experimenter)
data_subset |
The object created in 'add_timepoint_data()' which will be scored |
group |
The experimental group (i.e. "Control") these data correspond to |
animal |
The animal or animal group ID for these data |
id |
The full name of the experiment, including the extension. |
experimenter |
The experimenter who recorded these results |
A list object containing statistics and metadata for each file.
## Not run: score_timepoint_data( data_subset = my_subsetted_data, group = "Control", experimenter = "Experimenter 1", animal = "4207", id = "Data_sheet.xlsx" ) ## End(Not run)
## Not run: score_timepoint_data( data_subset = my_subsetted_data, group = "Control", experimenter = "Experimenter 1", animal = "4207", id = "Data_sheet.xlsx" ) ## End(Not run)
A pipeline function which creates a new experiment object and adds data by prompting the user for metadata (for every file that is added).
semisqueakRpipeline()
semisqueakRpipeline()
An object containing the full experiment with all data added.
## Not run: expt <- semisqueakRpipeline()
## Not run: expt <- semisqueakRpipeline()
Aggregates raw data tables for all data added to experiment object, and calculates and displays ANOVA statistics.
squeakrANOVA(experiment, analysis_factor)
squeakrANOVA(experiment, analysis_factor)
experiment |
The experiment object |
analysis_factor |
A string representing the factor to analyze between groups |
A table comparing the analysis_factor between groups
## Not run: squeakrANOVA(experiment = experiment, analysis_factor = "Delta_Freq")
## Not run: squeakrANOVA(experiment = experiment, analysis_factor = "Delta_Freq")
Run the SqueakR Shiny Dashboard locally to interface with experimental data.
squeakRDashboard()
squeakRDashboard()
A Shiny Dashboard
## Not run: squeakRDashboard()
## Not run: squeakRDashboard()
Aggregates raw data for experiment and summarizes descriptive statistics of the current results, grouped by experimental groups.
squeakrSummary(experiment)
squeakrSummary(experiment)
experiment |
The experiment object |
Text which summarizes experiment data split by group
## Not run: squeakrSTATS(experiment = experiment)
## Not run: squeakrSTATS(experiment = experiment)
Creates a vector of the original call file names, indexed by the order they are listed in the experiment. This allows experimenters to unblind themselves to the data they collect
unblind_all_ids(experiment)
unblind_all_ids(experiment)
experiment |
The experiment object |
A vector representing the original call file names
## Not run: decode_experiment_ids(experiment)
## Not run: decode_experiment_ids(experiment)
Finds the index of a dataset matching a supplied file name in the experiment.
unblind_data_id(experiment, filename)
unblind_data_id(experiment, filename)
experiment |
The experiment object |
filename |
The full name of the file, including the extension |
A number or numbers representing index or indices where that file appears in the experiment
## Not run: unblind_data_id(experiment, "my_data1.xlsx")
## Not run: unblind_data_id(experiment, "my_data1.xlsx")
Finds the name of a dataset matching a supplied index in the set of data
unblind_data_name(experiment, id)
unblind_data_name(experiment, id)
experiment |
The experiment object |
id |
The dataset number to be unblinded |
The name of the original file, corresponding to the data at the requested index
## Not run: unblind_data_name(experiment, 2)
## Not run: unblind_data_name(experiment, 2)
Auto-populates 'groups', 'experimenters', and 'animals' fields in experiment object by checking experimental data (within the experiment object) for new data.
update_experiment(experiment)
update_experiment(experiment)
experiment |
The experiment object |
A list object containing statistics and metadata for the entire experiment. The 'groups', 'experimenters', and 'animals' fields will auto-populate based on added data using the 'update_experiment()' function.
## Not run: update_experiment(experiment)
## Not run: update_experiment(experiment)