load_experiment: Load firing data for an experiment

View source: R/load_experiment.R

load_experimentR Documentation

Load firing data for an experiment

Description

units_fname: a file should be a .mat file exported from the Margolis lab multi-electrod expirmental matlab processing pipeline containing the following information for each neuron that was detected

Usage

load_experiment(
  units_fname,
  treatments,
  experiment_tag = NULL,
  save_path = "intermediate_data/experiment_datasets",
  verbose = TRUE
)

Details

1) the time steps (in seconds) when it fired during the experiment 2) the waveform of the cluster center across all firings

treatments: Either a data.frame: with columns [treatment, begin, end] for each treatment in the experiment or: a .csv file with columns [treatment, begin, end] for each treatment in the experiment

to help detect problems, an warning is given if the treatments are not disjoint and given chronologically

experiment_tag: identifier for the experiment, set in the return data structure and path to save to disk if null (default), then use treatments |> basename |> str_replace(".mat$", "")

save_path: save dataset to <save_path>/<experiment_tag> Default value: intermediate_data/experiment_datasets

returns: a mema_experiment S3 class with the following elements tag: <experiment_tag> treatments: tibble::tibble with columns [treatment, begin, end] firings: tibble::tibble with columns [nuron_index, time_step, treatment, begin, end] and a row for each detected firing waveform: tibble::tibble with columns [neuron_index, time_step, voltage] for each neuron class attribute: mema_experiment


momeara/mema documentation built on Nov. 4, 2022, noon