Skip to content

Commit 5d36310

Browse files
committed
Fix demo and new features
* Merge for release v1.1.0-alpha * Fix so that demo script now runs more consistently
2 parents a85d002 + 2176040 commit 5d36310

213 files changed

Lines changed: 26978 additions & 10623 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

+nigeLab/+defaults/Animal.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@
2222

2323
%% Name parsing: see '~/+defaults/Block.m' for detailed documentation
2424
% This works the same way, but applies to Animal name
25-
pars.DynamicVarExp={'$SurgYear','$SurgNumber'};
26-
pars.NamingConvention={'SurgYear','SurgNumber'};
25+
% pars.DynamicVarExp={'$AnimalID'}; % (FB)
26+
pars.DynamicVarExp={'$SurgYear','$SurgNumber'}; % (MM)
27+
pars.NamingConvention={'AnimalID'}; % (FB,MM)
2728

2829
pars.SpecialMeta = struct;
29-
pars.SpecialMeta.SpecialVars = {'AnimalID'};
30+
% pars.SpecialMeta.SpecialVars = {}; % (FB)
31+
pars.SpecialMeta.SpecialVars = {'AnimalID'}; % (MM)
3032
pars.SpecialMeta.AnimalID.cat = '-'; % Concatenater (if used) for names
3133
pars.SpecialMeta.AnimalID.vars = {'SurgYear','SurgNumber'}; % KUMC "standard"
3234
% pars.SpecialMeta.AnimalID.vars = {'Project','SurgNumber'}; % KUMC "RC"
3335

3436
pars.Delimiter = '-'; % delimiter for variables in ANIMAL name
3537
pars.Concatenater = '-'; % concatenater for variables INCLUDED in ANIMAL name
36-
pars.VarExprDelimiter = {'-','_'}; % Delimiter for parsing "special" vars
38+
% pars.VarExprDelimiter = {'_'}; % Delimiter for parsing "special" vars (FB)
39+
pars.VarExprDelimiter = {'-','_'}; % (MM)
3740
pars.IncludeChar='$'; % Delimiter for INCLUDING vars in name
3841
pars.DiscardChar='~'; % Delimiter for excluding vars entirely (don't keep in meta either)
3942

+nigeLab/+defaults/Block.m

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@
7070
% pars.DynamicVarExp={'$Project' '$SurgNumber' '$Year' '$Month' '$Day'}; % KUMC "RC" proj (and MM stuff)
7171
% pars.DynamicVarExp={'$SurgYear' '$SurgNumber' '$RecDate' '$RecTime'}; % KUMC R03
7272
% pars.DynamicVarExp={'$SurgYear' '$SurgNumber' '$RecID' '&info'}; % iit chronics
73-
% pars.DynamicVarExp={'$AnimalID' '$Year' '$Month' '$Day' '$SessionID' '~RecDate' '$RecTime'}; % FB?
74-
pars.DynamicVarExp={'$SurgYear' '$SurgNumber' '$Year' '$Month' '$Day' '$SessionID' '~RecDate' '$RecTime'}; % KUMC
73+
% pars.DynamicVarExp={'$AnimalID' '$Year' '$Month' '$Day' '$RecID' '$RecDate' '$RecTime'}; % ???? (FB, for these just comment out the one if you are replacing it please)
74+
pars.DynamicVarExp={'$SurgYear','$SurgNumber','$Year','$Month','$Day','$RecID','$RecDate','$RecTime'};
7575

7676
%% Common NamingConvention values
7777
% pars.NamingConvention={'AnimalID','RecID'}; % IIT tdt
78-
% pars.NamingConvention={'AnimalID','Year','Month','Day','RecID','RecTime'}; % FB stuff
79-
pars.NamingConvention={'AnimalID','Year','Month','Day','SessionID'}; % MM stuff
80-
% pars.NamingConvention={'AnimalID','Year','Month','Day'}; % KUMC "RC" proj
78+
% pars.NamingConvention={'AnimalID','Year','Month','Day','RecID','RecDate','RecTime'}; % (FB/KUMC R03) Since these are different for different configs, please keep commented lines instead of changing directly
79+
pars.NamingConvention={'AnimalID','Year','Month','Day','RecID'}; % MM Audio stuff
80+
% pars.NamingConvention={'AnimalID','Year','Month','Day'}; % KUMC "RC" proj (and MM stuff)
8181
% pars.NamingConvention={'AnimalID','Year','Month','Day','RecID', 'RecDate' 'RecTime'}; % KUMC
8282
% pars.NamingConvention={'AnimalID','RecID','RecDate','RecTime'}; % IIT intan
8383

@@ -86,21 +86,29 @@
8686
% used). The same goes for "AnimalID"
8787

8888
pars.SpecialMeta = struct;
89-
pars.SpecialMeta.SpecialVars = {};
90-
pars.SpecialMeta.RecID.cat = '-'; % Concatenater (if used) for names
91-
pars.SpecialMeta.AnimalID.cat = '-'; % Concatenater (if used) for names
9289

93-
% pars.SpecialMeta.SpecialVars = {}; % Default case
90+
% Note that RecTag (if created) replaces 'RecID' in DashBoard
91+
% pars.SpecialMeta.SpecialVars = {'RecTag'}; % FB ~!!
92+
pars.SpecialMeta.SpecialVars = {'AnimalID','RecTag'}; % MM
93+
pars.SpecialMeta.RecTag.cat = '-';
94+
% pars.SpecialMeta.RecID.cat = '-'; % Concatenater (if used) for names
95+
pars.SpecialMeta.AnimalID.cat = '-'; % Concatenater (if used) for names
96+
97+
% pars.SpecialMeta.SpecialVars = {'AnimalID','RecID'}; % KUMC "RC"
9498

9599
% (All must be included in DynamicVarExp):
96-
pars.SpecialMeta.RecID.vars = {'Month','Day','SessionID'}; % KUMC "RC"
97-
% pars.SpecialMeta.RecID.vars = {'Year','Month','Day'}; % KUMC "RC"
98-
pars.SpecialMeta.AnimalID.vars = {'SurgYear','SurgNumber'}; % KUMC "standard"
100+
% pars.SpecialMeta.RecTag.vars = {'RecID'}; % FB
101+
% pars.SpecialMeta.RecID.vars = {}; % FB/KUMC-R03/MM
102+
% pars.SpecialMeta.RecTag.vars = {'Year','Month','Day'}; % KUMC "RC"
103+
pars.SpecialMeta.RecTag.vars = {'Year','Month','Day','RecID'}; % KUMC "MM"
104+
% pars.SpecialMeta.AnimalID.vars = {}; % FB/KUMC-R03 Keep commented
99105
% pars.SpecialMeta.AnimalID.vars = {'Project','SurgNumber'}; % KUMC "RC"
106+
pars.SpecialMeta.AnimalID.vars = {'SurgYear','SurgNumber'}; % MM Audio stuff
100107

101108
pars.Delimiter = '_'; % delimiter for variables in BLOCK name
102109
pars.Concatenater = '_'; % concatenater for variables INCLUDED in BLOCK name
103-
pars.VarExprDelimiter = {'-','_'}; % Delimiter for parsing "special" vars
110+
% pars.VarExprDelimiter = {'_'}; % Delimiter for parsing "special" vars -- (FB)
111+
pars.VarExprDelimiter = {'_','-'}; % Since these are different for different configs, please keep commented lines instead of changing directly
104112
pars.IncludeChar='$'; % Delimiter for INCLUDING vars in name
105113
pars.DiscardChar='~'; % Delimiter for excluding vars entirely (don't keep in meta either)
106114

@@ -136,7 +144,7 @@
136144
pars.Delimiter 'Stream.mat'];
137145
TAG.Videos = ... % Videos: behavioral videos
138146
[pars.Delimiter '%s', ...
139-
pars.Delimiter '%g.%s']; % "Video_Left-A_0.mp4" "Video_Left-A_1.mp4"
147+
pars.Delimiter '%s.%s']; % "Video_Left-A_0.mp4" "Video_Left-A_1.mp4"
140148

141149
Fields = { ...
142150
'Raw'; % 1 - hard-coded for extraction

+nigeLab/+defaults/Event.m

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@
3232
% 'Support'; % 15)
3333
% 'Complete'; % 16)
3434
% };
35-
pars.Name = {... % Example B (RHD)
36-
'trialrunning'; % 1) Trial running "HIGH" events
37-
'beambreak'; % 2) Beam break events
38-
'nosepoke'; % 3) Nose-poke beam break
39-
'Reach'; % 4) Reach scored onset
40-
'Grasp'; % 5) Grasp scored onset
41-
'Support'; % 6) Support scored onset
42-
'Complete'; % 7) Complete scored onset
35+
pars.Name = {... % Example B (RHD)
36+
'trial-running'; % 1) Trial running "HIGH" events
37+
'beam-break'; % 2) Beam break events
38+
'nose-poke'; % 3) Nose-poke beam break
39+
'Init'; % 4) "Initialize" trial (e.g. tone cue or whatever)
40+
'Nose'; % 5) Nose poke through reach slot scored onset
41+
'Reach'; % 6) Reach scored onset
42+
'Grasp'; % 7) Grasp scored onset
43+
'Support'; % 8) Support scored onset
44+
'Complete'; % 9) Complete scored onset
4345
};
4446
% pars.Name = {... % Example B (KUMC: "RC" project -- MM) Note: each 'Event' with different timestamps needs its own 'Events' element
4547
% 'Reach'; % 1)
@@ -76,6 +78,8 @@
7678
'ScoredEvents'; % 5)
7779
'ScoredEvents'; % 6)
7880
'ScoredEvents'; % 7)
81+
'ScoredEvents'; % 8)
82+
'ScoredEvents'; % 9)
7983
};
8084

8185
% pars.Fields = {... % KUMC: "RC" project (MM)
@@ -138,18 +142,42 @@
138142
% 'Falling'; % 11)
139143
% 'Level'; % 12) (skip 13-16 because not 'auto' field)
140144
% };
145+
% pars.EventSource = {... % Example A (RHS)
146+
% 'Channels'; % 1) 'Stim' is associated with channels
147+
% 'Streams'; % 2)
148+
% 'Streams'; % 3)
149+
% 'Streams'; % 4)
150+
% 'Streams'; % 5)
151+
% 'Streams'; % 6)
152+
% 'Streams'; % 7)
153+
% 'Streams'; % 8)
154+
% 'Streams'; % 9)
155+
% 'Streams'; % 10)
156+
% 'Streams'; % 11)
157+
% 'Streams'; % 12) (skip 13-16 because not 'auto' field)
158+
% };
141159
pars.TrialDetectionInfo = struct(... % For sync using LED (Example B)
142160
'Field','DigIO',...
143-
'Name','trialrunning',...
161+
'Name','trial-running',...
144162
'Source',[],...
145-
'Debounce',0.250,...
146-
'Threshold',0.5,...
163+
'Debounce',0.100,...% Used in parsing other 'auto' events as well
164+
'Threshold',0.5,... % Used in parsing other 'auto' events as well
147165
'Type','Rising');
148166
pars.EventDetectionType = {... % Example B (RHD)
149-
'Rising'; % 1)
150-
'Rising'; % 2)
151-
'Rising'; % 3) (skip 4-7 because not 'auto' fields)
167+
'Falling'; % 1)
168+
'Rising'; % 2)
169+
'Rising'; % 3) (skip 4-7 because not 'auto' fields)
170+
};
171+
pars.EventSource = {...
172+
'Streams'; % 1)
173+
'Streams'; % 2)
174+
'Streams'; % 3) (skip 4-7 because not 'auto' fields)
152175
};
176+
pars.UseAutoAsDefaultScoredEvent = {... % Example B (RHD)
177+
'Complete'; ... % 1) trial-running already related to special "Trial" field
178+
'Reach'; ... % 2) beam-break
179+
'Init' % 3) nose-poke: should be essentially same as trial-running
180+
};
153181

154182
%% Error parsing (do not change)
155183
% Check that number of elements of Name matches that of Fields

+nigeLab/+defaults/Experiment.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
pars.StandardPortNames = {'A','B','C','D'};
2323
pars.DefaultAcquisitionSystem = 'RHD'; % Important if things go wrong
2424
pars.SupportedFormats = {'.rhs','.rhd','tdt'};
25-
pars.User = 'MM'; % Default user
25+
pars.User = ''; % Default user is now parsed from local machine
2626

2727
%% Parse output
2828
if nargin < 1
2929
varargout = {pars};
30+
if strcmpi(pars.User,'demo')
31+
nigeLab.utils.cprintf('Errors*','\n\t[+defaults/Experiment.m]: ');
32+
nigeLab.utils.cprintf('[0.5 0.5 0.5]',...
33+
'Running using `''demo''` "User"\n');
34+
end
3035
else
3136
varargout = cell(1,nargin);
3237
f = fieldnames(pars);

+nigeLab/+defaults/Queue.m

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
% Only specify this field if you want to force use of a single cluster
1313
% pars.Cluster = 'CPLMJS';
1414
pars.UseParallel = true; % set to false to switch to serial processing mode
15-
pars.UseRemote = true;
16-
% pars.UseParallel = false;
1715
% pars.UseRemote = false;
16+
% pars.UseParallel = false;
17+
pars.UseRemote = true;
1818

1919
% Local path equivalents for remote; these will be replaced if
2020
% .OnRemote flag is true (if the job is run via "qWrapper" generated by
@@ -25,14 +25,20 @@
2525
pars.Remote.RecRoot = 'P:/Recorded_Data';
2626
pars.Remote.SaveRoot = 'P:/Processed_Data';
2727

28-
pars.ClusterList = {'CPLMJS'; 'CPLMJS2'; 'CPLMJS3'};
28+
% pars.ClusterList = {'CPLMJS';'CPLMJS2';'CPLMJS3'};
29+
pars.ClusterList = {'CPLMJS';'CPLMJS2'};
2930
pars.NWorkerMinMax = [1,1]; % Min & Max # workers to assign to a job
3031
pars.WaitTimeSec = 1; % Time to wait between checking for new cluster
3132
pars.InitTimeSec = 5; % Time to wait when initializing cluster
3233

3334
% pars.RemoteRepoPath = '';
35+
% pars.RemoteRepoPath = ...
36+
% {'C:\Users\fbarban\Documents\MATLAB\ePhys_packages'}; % FB
3437
pars.RemoteRepoPath = ...
35-
{'//kumc.edu/data/research/SOM RSCH/NUDOLAB/Scripts_Circuits/Communal_Code/nigeLab/'};
38+
{'T:\Communal_Code\nigeLab'}; % MM (KUMC Isilon)
39+
% Note: if using older versions (such as v1.1.0-alpha), you will need to
40+
% install the package on the remote repository as well, and set that path
41+
% here (in pars.RemoteRepoPath)
3642

3743
%% Parse output
3844
if nargin < 1
@@ -49,5 +55,6 @@
4955
end
5056

5157

58+
5259
end
5360

+nigeLab/+defaults/SD.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
pars.ARTIFACT_SPACE = 4; % Window to ignore around artifact (suggest: 4 ms MIN for stim rebound)
4242
pars.MULTCOEFF = 4.5; % Multiplication coefficient for noise
4343
pars.PKDURATION = 1.0; % Pulse lifetime period (suggest: 2 ms MAX)
44-
pars.REFRTIME = 2.0; % Refractory period (suggest: 2 ms MAX).
44+
pars.REFRTIME = 0.5; % Refractory period (suggest: 2 ms MAX).
4545
pars.PKDETECT = 'sneo';% 'both' or 'pos' or 'neg' or 'adapt' or 'sneo' for peak type
4646
pars.ADPT_N = 60; % Number of ms to use for adaptive filter
4747
pars.SNEO_N = 5; % Number of samples to use for smoothed nonlinear energy operator window

+nigeLab/+defaults/Shortcuts.m

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,29 @@
1818
};
1919
else
2020
pars = struct;
21-
pars.raw = 'Channels(%d).Raw.data';
22-
pars.filt = 'Channels(%d).Filt.data';
23-
pars.car = 'Channels(%d).CAR.data';
24-
pars.lfp = 'Channels(%d).LFP.data';
25-
pars.spk = 'Channels(%d).Spikes';
26-
pars.srt = 'Channels(%d).Sorted';
27-
pars.clst = 'Channels(%d).Clusters';
21+
pars.raw.subfields = {'Channels', 'Raw'};
22+
pars.raw.indexable = [true , true];
23+
24+
pars.filt.subfields = {'Channels', 'Filt'};
25+
pars.filt.indexable = [true , true];
26+
27+
pars.car.subfields = {'Channels', 'CAR'};
28+
pars.car.indexable = [true , true];
29+
30+
pars.lfp.subfields = {'Channels', 'LFP'};
31+
pars.lfp.indexable = [true , true];
32+
33+
pars.spk.subfields = {'Channels', 'Spikes'};
34+
pars.spk.indexable = [true , true];
35+
36+
pars.srt.subfields = {'Channels', 'Sorted'};
37+
pars.srt.indexable = [true , true];
38+
39+
pars.clst.subfields = {'Channels', 'Clusters'};
40+
pars.clst.indexable = [true , true];
41+
42+
pars.digIO.subsfield = {'Streams', 'DigIO', 'data'};
43+
pars.digIO.indexable = [false , true , true];
2844
end
2945

3046
end

0 commit comments

Comments
 (0)