-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMasterPreProcessing_Intan.m
More file actions
71 lines (55 loc) · 2.44 KB
/
MasterPreProcessing_Intan.m
File metadata and controls
71 lines (55 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% How to use it:
% create a folder whose name is typically Animal-YYMMDD
% This folder should contain the successive Intan recordings of the day.
% Make sure sure the first recording of the day (at least) contains a
% proper xml file.
% Launch MasterPreProcessing_Intan
% You should get data ready to be manually spike sorted soon!
%
% USAGE: MasterPreProcessing_Intan(fbasename)
% where fbasename is the base name of the Intan recording (everything until
% the last '_', e.g. 'MouseXXX_YYMMDD')
%Adrien Peyrache, 2017
function MasterPreProcessing_Intan(fbasename,varargin)
%% Message for slack
%msg_starting = MakeSlackAttachment('New open task [urgent]: <link.to.website>', '', '', '#ff0000', {'KiloSort starting', ['doing animal ' fbasename]});
%SendSlackNotification('https://hooks.slack.com/services/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', '', '#kilosort', 'Kilosort', 'http://www.icon.com/url/to/icon/image.png', [], msg_starting);
mergename = Process_Intan2ConcatenateDat(fbasename);
%Now we can cd to the new 'mergename' folder
if ~exist(mergename,'dir')
warning(['Folder ' mergename ' has not been created!! Type ''dbquit'' to exit debugging mode'])
keyboard
end
cd(mergename)
datName = [mergename '.dat'];
disp('Renaming files DONE! Now KiloSort')
if ~exist(datName,'file')
error('No dat file!')
end
%% TODO INSERT DOWNSAMPLING DAT FILE
%% Comment these two lines to get rid of new processing
eval(['!cp ' datName ' ' datName '_backup']);
if exist([mergename '.xml'],'file')
par = LoadXml([mergename '.xml']);
else
error('No xml file!')
end
Process_RemoveMedianHighFq(mergename,par.nChannels);
UpdateXml_SpkGrps([mergename '.xml']);
%%% Uncomment this to rverse to old processing
%if ~isempty(varargin)
% Process_KiloSortGrp(mergename,varargin{1})
%else
%Process_KiloSortGrp(mergename)
%end
%% Comment these two lines to get rid of new processing
KiloSortWrapper;
eval(['!mv ' datName '_backup ' datName ])
cd('..')
%% Message for slack
msg_finished = MakeSlackAttachment('New open task [urgent]: <link.to.website>', '', '', '#0000ff', {'KiloSort finished', ['done animal ' fbasename]});
SendSlackNotification('https://hooks.slack.com/services/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', '', '#kilosort', 'Kilosort', 'http://www.icon.com/url/to/icon/image.png', [], msg_finished);
%Give writing access to all members of the 'datausers' group
%cmd = ['chown -R adrien.adrien ' mergename];
%system(cmd)
%Add stuff relative to video here...