|
@@ -1,43 +0,0 @@
|
|
|
-% The script plots the neural and behavioural data contained in a .h5 file of the Diomedi et al., 2023 dataset
|
|
|
-% in the form of a raster plot
|
|
|
-% authors: Francesco E. Vaccari
|
|
|
-% date: 10/2022
|
|
|
-
|
|
|
-
|
|
|
-clear all; clc; close all;
|
|
|
-addpath('supportFunctions')
|
|
|
-currentFolder = pwd;
|
|
|
-parentFolder = fileparts(fileparts(currentFolder));
|
|
|
-[filename,path_folder_data] = uigetfile('*.h5','Select a h5 dataset',[parentFolder '\data']);
|
|
|
-
|
|
|
-str = '/DATA/unit_01'; %it can be either unitXX, unitXX/conditionYY or unitXX/conditionYY/trialZZ
|
|
|
-
|
|
|
-[spikes, markers, all_strings] = get_all_data_from_level_h5([path_folder_data filename],str); %extract data
|
|
|
-
|
|
|
-str2readmk = ['/DATA/unit_01/condition_01/trial_01/event_markers'];
|
|
|
-
|
|
|
-marker_labels = h5readatt([path_folder_data filename],str2readmk,'Marker labels'); %extract names of event markers
|
|
|
-
|
|
|
-figure
|
|
|
-hold on
|
|
|
-for count = 1:length(spikes)
|
|
|
- clmap = jet(length(markers{count}));
|
|
|
- scatter(spikes{count},count,'|','k')
|
|
|
- sz = 30;
|
|
|
- c = linspace(1,10,length(markers{count}));
|
|
|
- if count == length(spikes)
|
|
|
- for mk = 1:size(markers{count},2)
|
|
|
- tmp = scatter(markers{count}(mk),1*count,sz,clmap(mk,:),'filled','DisplayName',marker_labels{mk});
|
|
|
- dots(mk) = tmp;
|
|
|
- end
|
|
|
- end
|
|
|
- scatter(markers{count},ones(size(markers{count}))*count,sz,clmap,'filled')
|
|
|
-end
|
|
|
-hold off
|
|
|
-ylim([0 count+1])
|
|
|
-xlabel('Time (ms)')
|
|
|
-ylabel('Trial #')
|
|
|
-legend(dots,marker_labels)
|
|
|
-colormap(jet)
|
|
|
-title('Raster Plot')
|
|
|
-
|