% Daytime, April 11, 2014: Spiking Sorting on all CNQX+stim cultures
% -------------------------------------------------------------------------
%% Haruki, CNQX

spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898C_13-16DIV_waveforms.mat');
fid = 'haruki17898C_13-16DIV';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;

spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898E_13-16DIV_waveforms.mat');
fid = 'haruki17898E_13-16DIV';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;

%% Haruki, control

spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898A_13-16DIV_waveforms.mat');
fid = 'haruki17898A_13-16DIV';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;

spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898D_13-16DIV_waveforms.mat');
fid = 'haruki17898D_13-16DIV';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;


%% Herb, CNQX+stim

spkdat = load('C:\Users\USER\Documents\mingfaifong\2012-10-03_herbI5374_12-14DIV_MEA_CNQX-ChR2-stim-CL\herbI5374_12-14DIV_waveforms.mat');
fid = 'herbI5374_12-14DIV';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;


%% Usain, CNQX+stim

spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-24_usain22471_12-14DIV_MEA_CNQX-ChR2-stim-CL\usain22471_waveforms.mat');
fid = 'usain22471_waveforms';
SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
SS.Save;
clear SS;
SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
SS.WaveClus(5,200,'wav',0,0);
SS.Save;
clear all;

% %% Xinhai, CNQX+stim
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-08_xinhai22471_11-13DIV_MEA_CNQX-ChR2-stim-CL\xinhai22471_11-13DIV_waveforms.mat');
% fid = 'xinhai22471_11-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Wingnut, CNQX+stim
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-03_wingnut21332_10-13DIV_MEA_CNQX-ChR2-stim-CL\wingnut21332_10-13DIV_waveforms.mat');
% fid = 'wingnut21332_10-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Trouble, CNQX+stim
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-21_trouble22468_12-14DIV_MEA_CNQX-ChR2-stim-CL\trouble22468_12-14DIV_waveforms.mat');
% fid = 'trouble22468_12-14DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 



% Overnight, April 10-11, 2014: Spiking Sorting on some CNQX + control cultures
% -------------------------------------------------------------------------
% 
% 
% %% Haruki, CNQX
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898C_13-16DIV_waveforms.mat');
% fid = 'haruki17898C_13-16DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898E_13-16DIV_waveforms.mat');
% fid = 'haruki17898E_13-16DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Haruki, control
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898A_13-16DIV_waveforms.mat');
% fid = 'haruki17898A_13-16DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2011-11-02_haruki17898_13-16DIV_MEA_TTX-CNQX-vehicle\haruki17898D_13-16DIV_waveforms.mat');
% fid = 'haruki17898D_13-16DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Vivy, CNQX
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-26_vivy21369_10-13DIV_MEA_6well\vivy21369F_10-12DIV_waveform.mat');
% fid = 'vivy21369F_10-12DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-26_vivy21367_10-13DIV_MEA_6well\vivy21367F_10-12DIV_waveform.mat');
% fid = 'vivy21367F_10-12DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Vivy, control
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-26_vivy21369_10-13DIV_MEA_6well\vivy21369C_10-12DIV_waveform.mat');
% fid = 'vivy21369C_10-12DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-01-26_vivy21367_10-13DIV_MEA_6well\vivy21367A_10-12DIV_waveform.mat');
% fid = 'vivy21367A_10-12DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Yam, CNQX
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-10_yam21367_10-13DIV_MEA_6well\yam21367D_10-13DIV_waveforms.mat');
% fid = 'yam21367D_10-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-10_yam21367_10-13DIV_MEA_6well\yam21367F_10-13DIV_waveforms.mat');
% fid = 'yam21367F_10-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Yam, control
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-10_yam21367_10-13DIV_MEA_6well\yam21367B_10-13DIV_waveforms.mat');
% fid = 'yam21367B_10-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\2013-02-10_yam21367_10-13DIV_MEA_6well\yam21367E_10-13DIV_waveforms.mat');
% fid = 'yam21367E_10-13DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% clear all;
% 
% %% Milkdud, control
% 
% spkdat = load('C:\Users\USER\Documents\mingfaifong\pre-2012 (need to sort)\2012-01-19_milkdud19309_13-17DIV_MEA_vehicle\milkdud19309_13-16DIV_waveforms.mat');
% fid = 'milkdud19309_13-16DIV';
% SS = SqueakySpk([fid '_DoublePeakSortNR'],25000,1,spkdat);
% SS.Save;
% clear SS;
% SS = SqueakySpk([fid '_WaveletSort'],25000,1,spkdat);
% SS.WaveClus(5,200,'wav',0,0);
% SS.Save;
% % clear all;