Two choice visual discrimination experiments conducted in the G4 tethered flight arena at HHMI Janelia.
This code works for experiments running a particular version of the protocol for this experiment: CL_2PatternDiscrim_Flip_2REPS_09-15-23_10-13-33.
You must first run the process_data function from the G4_Display_Tools repository to return the processedData.mat file. In order to run this function, you have to have a processing_settings.mat file and link to this settings file when calling the process_data function.
Once you have generated the 'ProcessedData.mat' file for the experiment, you can run peak_values = preprocess_twochoice_barfixation_data(date_path) using the path to the date folder containing the ProcessedData.mat file. This will return a structure peak_values, containing the peak values for each trial, which can be used for further analysis.
If you want to process the data from multiple dates and multiple experiments at the same time, you can run function process_all_2C_BF_data() which will process all of the data within the data folder.
First, generate a combined table using the following function
[all_rep_data_all_flies, fly_names] = generate_tbl_all_reps(orig_flip)
then run the plotting function:
plot_mean_sem_histogram_all_reps()
The plotting function requires a .mat file which contains a table with the names of the 17 conditions.
You can also run through a number of different plotting functions within this script: run_plotting_functions().