Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calibrations #177

Open
wants to merge 467 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
467 commits
Select commit Hold shift + click to select a range
8cc73a5
Echo in code update and fix to warning in ExpPanel
k1o0 Oct 23, 2018
9a1e015
Scheduled updating in +git/update
k1o0 Oct 25, 2018
1cccfc1
Changed .gitmodules to point back to cortex-lab subrepos for pull req…
Oct 25, 2018
39caab5
Merge pull request #69 from jaib1/dev
k1o0 Oct 25, 2018
13c85a8
Reset lick counter NB: May ditch this method in future in favour of f…
k1o0 Oct 25, 2018
ad3b8da
Lick detector zero'd + git.update uses 'where git'
k1o0 Oct 25, 2018
6ceb4e6
Removed premature commit. Wheel now zero'd + where git in update func
k1o0 Oct 25, 2018
cd23b73
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Oct 25, 2018
af0738b
rm unfinished code
k1o0 Oct 25, 2018
9ee295f
added future training flag to AlyxPanel
Oct 26, 2018
150a61c
Updated Output to log when giving water in AlyxPanel
Oct 26, 2018
64677be
Merge pull request #73 from jaib1/dev
k1o0 Oct 26, 2018
53bce3b
Future water bug fix, better error handling is dispWtrReq and consist…
k1o0 Oct 29, 2018
633416a
Merge from dev, auto update of code every monday
k1o0 Oct 29, 2018
f943f48
Returns index of named arg
k1o0 Oct 31, 2018
e4cdf24
Bug fix and SPX222 support
k1o0 Oct 31, 2018
1c05914
Updates to signals & wheelAnalysis modules
k1o0 Oct 31, 2018
7148e9e
commentings on SignalsExp plus last signals subrepo commit
Oct 31, 2018
9bba914
repoint submodules back at Jai's forks
Oct 31, 2018
66f8d8f
last changes made to signals subrepo
Oct 31, 2018
9b27d06
pulling Miles' Rigbox dev commits from past 2 weeks
Oct 31, 2018
00af989
typo fixes for readme
Oct 31, 2018
814cfde
View all subjects window is now a better size
k1o0 Oct 31, 2018
4fd00a4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Oct 31, 2018
4ec10e6
Wheel signal availiable in degrees and mm
k1o0 Nov 15, 2018
3d23d11
Moved useRig to be before expDef run
k1o0 Nov 15, 2018
7d222c1
Skip repeats on wheel trace and zero offset now accessable
k1o0 Nov 15, 2018
385d6ba
Moved wheel out of useRig method: conflict with setting output
k1o0 Nov 16, 2018
81d7e8d
Fix to paths; npy-matlab added properly
k1o0 Nov 16, 2018
8982b19
Update from master
k1o0 Nov 16, 2018
b53653c
Docstring fix
k1o0 Nov 16, 2018
64aa3ca
Fix log for when no future train dates
k1o0 Nov 16, 2018
9b7a815
Alyx changes in subject endpoint
Nov 19, 2018
a8c895c
eui.AlyxPanel: water restriction management endpoint refactoring
Nov 19, 2018
e960a1a
Water type set in hardware
k1o0 Nov 20, 2018
34a4b7a
field name change for trials numbers
k1o0 Nov 20, 2018
86b4ce0
Bug fix for post water
k1o0 Nov 20, 2018
8b45502
Ugly but functional drop-down for water type
k1o0 Nov 20, 2018
3994da9
eui.AlyxPanel: water restriction management endpoint refactoring
Nov 19, 2018
770ef43
Alyx changes in subject endpoint
Nov 19, 2018
3cb5851
Initial DaqController changes for clock output + tidying other files
Nov 26, 2018
a94ab94
working RewardAsClock in DaqController
Nov 27, 2018
b0dd22d
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
Nov 27, 2018
7526eee
manual changes to resolve remote conflicts
Nov 27, 2018
53273c6
Session water posted by rig instead of mc. Allows rig specific water …
k1o0 Nov 27, 2018
f6a1ff5
Simplified ChoiceWorld water post
k1o0 Nov 27, 2018
e63525a
Merge from dev
k1o0 Nov 27, 2018
779a9f8
Scheduled update day set in paths file
k1o0 Nov 27, 2018
318cae0
Launch Webpage for session fix
k1o0 Nov 28, 2018
a60e93a
Small delay for correct behaviour of reward on stim
k1o0 Nov 30, 2018
952ac29
Merge remote-tracking branch 'origin' into wheelDeg
k1o0 Nov 30, 2018
b3a0f2f
Update tp submodules
k1o0 Nov 30, 2018
0908e33
Removed star and end dates in water-restriction GET for view subject …
k1o0 Dec 3, 2018
dcf2bae
Merge pull request #76 from jaib1/dev
Dec 4, 2018
c5cccc1
commit for updated submodules
Dec 4, 2018
6f667d1
Fix'd weight plot; no longer ploting unweighed days
k1o0 Dec 5, 2018
1462af7
Typo fix in signals repo
k1o0 Dec 5, 2018
066ec03
Updates to modules and update fun
k1o0 Dec 5, 2018
8397dae
Merge remote branch 'dev' of https://github.com/cortex-lab/Rigbox int…
Dec 6, 2018
ddc5045
stash and pull strategy changes to git.update
Dec 6, 2018
2a3b473
hw-info ext bugfix; new commits to alyx-matlab; added test paths
k1o0 Dec 7, 2018
df3caf4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 7, 2018
3f764de
Removed questioning directory comments
Dec 7, 2018
25b5f2f
Merge pull request #78 from cortex-lab/devGitUpdate
Dec 7, 2018
6e8e9de
Give different water types in the future. Today's recorded weigth no…
k1o0 Dec 7, 2018
1c88311
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 7, 2018
5d31c5a
Update to alyx-matlab submodule
k1o0 Dec 7, 2018
05f723e
Update readme.md
Dec 7, 2018
ad6571b
Update to signals
k1o0 Dec 10, 2018
8978915
Update to signals
k1o0 Dec 10, 2018
89ce3fb
Update git.update
Dec 10, 2018
329bd47
corresponding 'git.update' update to 'mc'
Dec 10, 2018
5facbea
corresponding 'git.update' update to 'srv.expServer'
Dec 10, 2018
71c4ade
Scheduled update day taken from paths file
k1o0 Nov 27, 2018
fc5fc5f
Merge pull request #84 from cortex-lab/gitUpdate
Dec 12, 2018
4409066
Update to submodules
k1o0 Dec 14, 2018
d23f6fb
Fixed bug with hw-info saved as '.jjson' file
k1o0 Dec 14, 2018
c6fceb2
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 14, 2018
8135874
Reverting changes; .mat hw-nfo still used by tlvs. Using strrep to d…
k1o0 Dec 14, 2018
c9d7a00
Wheel assignment back in useRig
k1o0 Dec 17, 2018
388f317
Merge from wheelDeg
k1o0 Dec 17, 2018
77a3c2c
Rolled back DaqController due to issues with DigitalTTL output
k1o0 Dec 18, 2018
0e5e400
Logs no longer subtract reference time: already done by obj.Clock.now…
k1o0 Dec 18, 2018
b55ea8e
Releasing hardware and ports properly after experiment end
k1o0 Dec 18, 2018
e5ed26f
Removed fieldOrDefault; same functionality as getOr
k1o0 Dec 19, 2018
3b6a322
Added ext input to expFilePath
k1o0 Dec 19, 2018
f984ce4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 19, 2018
3169f66
bug fix: variable required transpose
k1o0 Dec 19, 2018
fcd6dcb
Checks for local folder rather than remote when creating new dir for …
k1o0 Jan 9, 2019
ddd772b
Auto cleanup of WeekendWater profile; changes to comments
k1o0 Jan 10, 2019
24ce0fd
Clearer plots and tables in view subject history
k1o0 Jan 11, 2019
b64f90b
Update to submodule; can't post zero weights
k1o0 Jan 11, 2019
77febac
Clearer plots and tables in view subject history
k1o0 Jan 11, 2019
c7e758a
Update to submodules: added params to subsession JSON field
k1o0 Jan 11, 2019
c193c60
updated submodule signals
ArminLak Jan 15, 2019
206f656
Merge from dev
k1o0 Jan 20, 2019
56dd8b9
Moved Signals vis functions from cortexlab directory
k1o0 Jan 20, 2019
770499b
cellFlat now works with arrays of Signals objects
k1o0 Jan 22, 2019
72acc90
Comments still saved loaclly upon failure to post to Alyx
k1o0 Jan 24, 2019
9ad2c06
Updates to session done with PATCH
k1o0 Jan 24, 2019
eb4cb39
Updates to session done with PATCH
k1o0 Jan 24, 2019
d54582b
Added change to patch cached put files to Alyx
k1o0 Jan 24, 2019
e4a0325
Added change to patch cached put files to Alyx
k1o0 Jan 24, 2019
7ad3bab
Fix bug for when code never fetched
k1o0 Jan 26, 2019
7ae8813
Bug fix for timeplot
k1o0 Jan 27, 2019
5dcb828
add signals 'tutorials' folder to paths
Jan 28, 2019
fec3ac2
Merge remote branch 'dev' into local
Jan 28, 2019
808d565
Revert "add signals 'tutorials' folder to paths"
Jan 28, 2019
3d90407
Update only occurs once on scheduled day
k1o0 Jan 28, 2019
0ff7427
additional comments for git.update
Jan 28, 2019
2a5185d
updated git.update from commit 0ff742 in 'dev'
Jan 28, 2019
c9c27a2
Fix'd incorrect brackets
k1o0 Jan 28, 2019
cbb1313
Fix'd incorrect brackets
k1o0 Jan 28, 2019
b36cadb
Attempt to integrate new Parameter Editor into mc
k1o0 Jan 30, 2019
04a8a3d
Updates for GUILT compatibility
k1o0 Feb 5, 2019
e47f462
New infer params
k1o0 Feb 8, 2019
0f4bff2
Check for reserved params
k1o0 Feb 8, 2019
c5a2e98
No more multiple default aud dev names
k1o0 Feb 8, 2019
571ee18
Bug fix for numRepeats when there's signal char param
k1o0 Feb 8, 2019
6e19d61
Subjects list disabled during login
k1o0 Feb 8, 2019
8522c13
Field change to water-requirement endpoint
k1o0 Feb 10, 2019
210c848
Pagination support
k1o0 Feb 10, 2019
6ae6b1e
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Feb 10, 2019
4ff9735
Field change to water-requirement endpoint
k1o0 Feb 10, 2019
1845292
Pagination support
k1o0 Feb 11, 2019
b5ea66e
Modify Alyx login to use newid instead of inputdlg. This makes the 'e…
kevin-j-miller Feb 15, 2019
e9c2f5e
Modify Alyx login to use newid instead of inputdlg. This makes the 'e…
kevin-j-miller Feb 15, 2019
5f2fb58
Expose the AlyxPanel property of the MControl object, so that the log…
kevin-j-miller Feb 15, 2019
9b56e4f
modified alyx-matlab with more convenient textboxes and desktop short…
kevin-j-miller Feb 18, 2019
64416dd
Bug fix for turning empty objects into struct
k1o0 Feb 19, 2019
4fda5c0
Added error msgID and tests
k1o0 Feb 19, 2019
de7c0c2
modify alyx_matlab
kevin-j-miller Feb 20, 2019
fde8177
move alyxpanel property to private setaccess
kevin-j-miller Feb 20, 2019
ce9c36d
Merge pull request #105 from cortex-lab/dev_kevin
Feb 20, 2019
53bbb8c
Merge pull request #106 from cortex-lab/obj2json_fix
Feb 21, 2019
6f07fc8
Bugfix for registering hw info
k1o0 Feb 21, 2019
0e4ed52
Merge branch 'hwInfo_bug' into dev
Feb 21, 2019
6bceeea
bugfix for registering hw.info
Feb 21, 2019
7d04c62
Merge pull request #112 from cortex-lab/hwInfo_bug
Feb 21, 2019
9298f12
Merge pull request #113 from cortex-lab/hwInfo_bugMaster
Feb 21, 2019
c3b0f78
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into local
Feb 22, 2019
9b5cb2a
added test for 'vis.sinusoidLayer' and updated 'alyx' (dev) and 'sign…
Feb 22, 2019
5f1a10e
Update readme
k1o0 Feb 25, 2019
aa123db
Started AlyxPanel tests
k1o0 Feb 26, 2019
cf9a2c2
Change to validation params
k1o0 Feb 27, 2019
199a894
Merge branch 'inferParams' into dev
ahcf Feb 27, 2019
6d78c2c
Fix for xlim when single water restricted weight
k1o0 Feb 28, 2019
4f0cf69
Bug fix for differing def fun paths
k1o0 Mar 5, 2019
35a3870
Rebased 'TestPanelClasses' onto 'dev' at diverge point c9c27a2 after …
Feb 15, 2019
86fcbbb
updated signals (dev) submodule
Mar 7, 2019
ccd828c
Merge branch 'inferParams' into dev
Mar 7, 2019
b6b47db
updated signals (TestPanelClasses) submodule
Mar 7, 2019
6238fda
updated signals (dev, merged into from TestPanelClasses) submodule
Mar 7, 2019
d4968cc
Merge branch 'TestPanelClasses' into dev
Mar 7, 2019
5be5059
Added tests and bug fix for timer deletion
k1o0 Mar 8, 2019
447eb42
Last weight used in calculation for subject history plots
k1o0 Mar 8, 2019
df607ec
Revert irrelevent commits
k1o0 Mar 10, 2019
67e3de3
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into paramUI
k1o0 Mar 11, 2019
f93f73b
Updates to signals
k1o0 Mar 11, 2019
9babd51
Added config file for todo bot
k1o0 Mar 11, 2019
09deaf1
Hack for resize issue and fix for makeConditional()
k1o0 Mar 11, 2019
29266f0
Added some tests and minor modifications
k1o0 Mar 12, 2019
ad16e6f
Complete Parameters test; parameters deals with strings better; added…
k1o0 Mar 12, 2019
57ba45c
Bug fixes for numRepeats behaviour, more tests
k1o0 Mar 13, 2019
335642a
Better coverage of Changed event
k1o0 Mar 13, 2019
d9fc48d
Added full documentation
k1o0 Mar 13, 2019
8272c01
Added performance test and tooltip strings
k1o0 Mar 13, 2019
cb4f2ff
Added test for login; bug fix for round
k1o0 Mar 14, 2019
618c79c
Protected some methods
k1o0 Mar 14, 2019
53e23fe
Removed some comments and command promt output, renamed tests
k1o0 Mar 14, 2019
7162d92
Update readme.md
k1o0 Mar 14, 2019
c8f7eb6
Changed RearrangeableColumns from true to 'on'
k1o0 Mar 15, 2019
d1ded06
reorganized test folder structure, plus added some comments
Mar 15, 2019
4c9b67f
renamed folder 'helpers' to 'fixtures'; added 'SharedTestFixtures' to…
Mar 19, 2019
ef551b9
Documentation for launchSubjectURL
k1o0 Mar 19, 2019
5d28fb1
HOTFIX: double-check experiment isn't already running before starting…
k1o0 Mar 19, 2019
e0eca9e
HOTFIX: 'ExpRunnning' changed to 'ExpRunning'
Mar 19, 2019
c5ac87a
HOTFIX: updated 'eui.MControl/beginExp' to not run exp on rig already…
Mar 19, 2019
866cd9d
HOTFIX: double-check experiment isn't already running before starting…
k1o0 Mar 19, 2019
177b442
Added mocking framework for input dialogs, reorganized
k1o0 Mar 19, 2019
228a016
HOTFIX Update to ALF extraction
k1o0 Mar 20, 2019
b85f8f8
Merge pull request #119 from cortex-lab/paramUI
Mar 20, 2019
9f20d25
Added config YAML for todo bot
k1o0 Mar 20, 2019
8820651
Added config YAML for todo bot
k1o0 Mar 20, 2019
73a8494
Added config YAML for todo bot
k1o0 Mar 20, 2019
7483cdb
Started documenting expServer and Communicator
k1o0 Mar 21, 2019
7ed3427
Added test for cellflat
k1o0 Mar 21, 2019
45e1a62
Bonus cellflat test
k1o0 Mar 21, 2019
a83c437
Added docs folder for package demos
k1o0 Mar 23, 2019
da69e8f
Tests for posting weight and launching subject url; bug fix for <70% …
k1o0 Mar 23, 2019
d0fb53b
Tests for weight button
k1o0 Mar 23, 2019
1176532
Finished all AlyxPanel tests
k1o0 Mar 24, 2019
83ae2b6
Bug fixes for round and launchSessionUrl
k1o0 Mar 24, 2019
3b81095
Added contributing guidlines
k1o0 Mar 25, 2019
cb6f91e
Moved UML to doc folder
k1o0 Mar 25, 2019
ff248c9
added images branch from signals
k1o0 Mar 27, 2019
f3bdf55
corrected submodule update to only change signals, not alyx-matlab
kevin-j-miller Mar 27, 2019
b7c406b
trying again to get the submodules right
kevin-j-miller Mar 27, 2019
b319789
Hack-fixed a bug that caused string parameters to not be editable
kevin-j-miller Mar 27, 2019
7259eef
updated signals submodule (merged 'images' and 'voidsignal_fix' into …
peterzh Mar 27, 2019
64b81ab
bug fix for uicontextmenu in Condition and Field Panels
Mar 29, 2019
5795d47
updated 'signals' (hotfix updates) and 'alyx-matlab' (merged 'Tests' …
Apr 1, 2019
2f91915
Merge branch 'dev_kevin' into dev
Apr 12, 2019
6ec0de1
Merge pull request #131 from cortex-lab/documentation
Apr 12, 2019
4cf439b
updated signals (merged 'cleanup' into 'dev') submodule
Apr 17, 2019
9521b66
updated signals submodule
Apr 24, 2019
816b2ff
Fix for expStop error and bug where event updates twice
k1o0 Apr 29, 2019
f442efa
Storing/referencing figure now more efficient
k1o0 Apr 29, 2019
0206c4d
Added full string support in ParamEditor
k1o0 Apr 29, 2019
2bbd932
Merge pull request #146 from cortex-lab/ParamStrings
May 2, 2019
6c52421
merge 'devUpdateContributing' into 'dev'
May 6, 2019
d8d691e
add 'contributing.md' link and author emails to 'readme'
May 6, 2019
3c48d57
Merge pull request #149 from cortex-lab/expStop
May 7, 2019
89f1854
updated submodule signals (merged 'tutorialsForPaper' into 'dev')
May 7, 2019
c7dd26c
Revert "Merge pull request #149 from cortex-lab/expStop"
May 7, 2019
bc3f9c0
updated 'expStop' issue after testing
May 8, 2019
e5683cd
Update README.md
May 8, 2019
781d366
merged 'documentation' into dev
k1o0 Apr 12, 2019
7cc8fd4
updated signals and alyx-matlab submodules (just documentation)
May 10, 2019
a0478f1
Update to submodule
k1o0 May 13, 2019
a1947e3
Update to submodule
k1o0 May 13, 2019
b6fd9a2
Weight changed for test; may be an Alyx bug
k1o0 May 14, 2019
6b727d3
Merged 'paramUI' into 'dev' after adding 'sortByColumn' and
k1o0 May 3, 2019
19018b4
Updated submodules
k1o0 May 21, 2019
221a872
Merge into dev
k1o0 May 21, 2019
d6fc065
HOTFIX: Revert mistaken changes
k1o0 May 22, 2019
ad95aad
added readthedocs files
May 24, 2019
5f5eac7
Create index.rst
k1o0 May 24, 2019
8904582
AlyxPanel automatically actived when databaseURL field is defined in …
k1o0 May 28, 2019
5cf2270
updated signals submodule (added '+audstream' source code)
May 28, 2019
0ab61b1
added java websocket source code
May 28, 2019
06c9846
started 'paths_config' and updated 'readme'
May 28, 2019
279192a
AlyxPanel automatically actived when databaseURL field is defined in …
k1o0 May 28, 2019
b82ab11
Merge branch 'autoAlyxPanel' into dev
May 28, 2019
963f64e
updated submodules (merged dev -> master for alyx-matlab and signals)
May 28, 2019
0c799d6
Merge branch 'dev'
May 28, 2019
dfae06d
Update README.md
May 28, 2019
02de05f
Changed name to "LICENSE.md"
May 29, 2019
eecf01f
re-initialized and re-built readTheDocs files
May 29, 2019
63bfdd0
hotfix for activating AlyxPanel in MC
May 30, 2019
cfe2e40
now requires 2017b or later
May 30, 2019
f43146f
hotfix to SignalsExp for ending experiments
Jun 3, 2019
92d5ec6
Added script for testing entire repo
k1o0 Jun 19, 2019
c2d3ab5
setValuesTest (#162) squash and rebase onto dev
k1o0 Jun 26, 2019
f27cc6f
add Nick's changes from #164
Jun 26, 2019
2a473d2
updated doc for 'Window'
Jul 1, 2019
4abd394
changes to daq channels for gamma cal
Jul 5, 2019
090af94
quit exp server after gamma cal
Jul 5, 2019
94183e8
#4, #128, #164
Jul 8, 2019
b707bcf
WIP on updating 'hw.Window' and 'hw.ptb.Window'
Aug 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions +dat/addLogEntry.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
%% create and store entry
e = entry(nextidx);
log(nextidx) = e;
% Store an instance of Alyx for narrative registration
if nargin > 5; e.AlyxInstance = AlyxInstance; end

%% store updated log to *all* repos locations
Expand Down
2 changes: 1 addition & 1 deletion +dat/delParamProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function delParamProfile(expType, profileName)

%path to repositories
fn = 'parameterProfiles.mat';
repos = fullfile(dat.reposPath('expInfo'), fn);
repos = fullfile(dat.reposPath('main'), fn);

%load existing profiles for specified expType
profiles = dat.loadParamProfiles(expType);
Expand Down
7 changes: 5 additions & 2 deletions +dat/expExists.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
function b = expExists(expRef)
%DAT.EXPEXISTS Confirm existence of experiment(s) with reference
% b = DAT.EXPEXISTS(expRef) TODO
% b = DAT.EXPEXISTS(expRef) Returns true is expRef exists, where expRef
% is an experiment reference string or cell array thereof.
%
% See Also DAT.LISTEXPS, DAT.PATHS
%
% Part of Rigbox

Expand All @@ -14,7 +17,7 @@

function b = check(expRef)
% ensure the standard folder given the reference exists
b = file.exists(dat.expPath(expRef, 'expInfo', 'master'));
b = file.exists(dat.expPath(expRef, 'main', 'master'));
end

end
109 changes: 60 additions & 49 deletions +dat/expFilePath.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,105 +7,117 @@
% e.g. to get the paths for an experiments 2 photon TIFF movie:
% DAT.EXPFILEPATH('mouse1', datenum(2013, 01, 01), 1, '2p-raw');
%
% [full, filename] = expFilePath(ref, type, [reposlocation])
% [full, filename] = expFilePath(ref, type, [reposlocation, ext])
%
% [full, filename] = expFilePath(subject, date, seq, type, [reposlocation])
% [full, filename] = expFilePath(subject, date, seq, type, [reposlocation, ext])
%
% Options for reposlocation are: 'local' or 'master'
% Many options for type, e.g. 'block', '2p-raw', 'eyetracking', etc
% If ext is specified, the path returned has the extention ext, otherwise
% the default for that type is used.
%
% Part of Rigbox

% 2013-03 CB created

if nargin == 3 || nargin == 5
% repos argument was passed, save the value and remove from varargin
location = varargin(end);
varargin(end) = [];
elseif nargin < 2
error('Not enough arguments supplied.');
else
% repos argument not passed
location = {};
assert(length(varargin) > 1, 'Error: Not enough arguments supplied.')

parsed = catStructs(regexp(varargin{1}, dat.expRefRegExp, 'names'));
if isempty(parsed) % Subject, not ref
if nargin > 4
location = varargin{5};
varargin(5) = [];
else
location = {};
end
typeIdx = 4;
else % Ref, not subject
typeIdx = 2;
if nargin > 2
location = varargin{3};
varargin(3) = [];
else
location = {};
end
end

% tabulate the args to get complete rows
[varargin{1:end}, singleArgs] = tabulateArgs(varargin{:});

% last argument is the file type
fileType = varargin{end};
fileType = varargin{typeIdx};
extention = iff(any(numel(varargin) == [3,5]), varargin{end},...
cell(1,length(varargin{1})));
if any(numel(varargin) == [3,5]); varargin(end) = []; end

% convert file types to file suffixes
[repos, suffix, dateLevel] = mapToCell(@typeInfo, fileType);
[repos, suffix, dateLevel] = mapToCell(@typeInfo, fileType(:), extention(:));

reposArgs = cat(2, {repos}, location);

% and the rest are for the experiment reference
[expPath, expRef] = dat.expPath(varargin{1:end - 1}, reposArgs{:});

function [repos, suff, dateLevel] = typeInfo(type)
function [repos, suff, dateLevel] = typeInfo(type, newExt)
% whether this repository is at the date level or otherwise deeper at the sequence
% level (default)
% level (default). FIXME: Date level doesn't work, perhaps this should
% be modified to work with deeper sequences also? E.g.
% default\2018-05-04\1\2
dateLevel = false;
repos = 'main';
ext = '.mat';
switch lower(type)
case 'block' % MAT-file with info about each set of trials
repos = 'expInfo';
suff = '_Block.mat';
suff = '_Block';
case 'hw-info' % MAT-file with info about the hardware used for an experiment
repos = 'expInfo';
suff = '_hardwareInfo.mat';
suff = '_hardwareInfo';
case '2p-raw' % TIFF with 2-photon raw fluorescence movies
repos = 'twoPhoton';
suff = '_2P.tif';
ext = '.tif';
case 'calcium-preview'
repos = 'twoPhoton';
suff = '_2P_CalciumPreview.tif';
suff = '_2P_CalciumPreview';
ext = '.tif';
case 'calcium-reg'
repos = 'twoPhoton';
suff = '_2P_CalciumReg';
ext = '';
case 'calcium-regframe'
repos = 'twoPhoton';
suff = '_2P_CalciumRegFrame.tif';
suff = '_2P_CalciumRegFrame';
ext = '.tif';
case 'timeline' % MAT-file with acquired timing information
repos = 'expInfo';
suff = '_Timeline.mat';
suff = '_Timeline';
case 'calcium-roi'
repos = 'twoPhoton';
suff = '_ROI.mat';
suff = '_ROI';
case 'calcium-fc' % minimally filtered fractional change frames
repos = 'twoPhoton';
suff = '_2P_CalciumFC';
ext = '';
case 'calcium-ffc' % ROI filtered fractional change frames
repos = 'twoPhoton';
suff = '_2P_CalciumFFC';
ext = '';
case 'calcium-widefield-svd'
repos = 'widefield';
suff = '_SVD';
ext = '';
case 'eyetracking'
repos = 'eyeTracking';
suff = '_eye';
ext = '';
case 'parameters' % MAT-file with parameters used for experiment
repos = 'expInfo';
suff = '_parameters.mat';
suff = '_parameters';
case 'lasermanip'
repos = 'expInfo';
suff = '_laserManip.mat';
suff = '_laserManip';
case 'img-info'
repos = 'twoPhoton';
suff = '_imgInfo.mat';
suff = '_imgInfo';
case 'tmaze'
repos = 'expInfo';
suff = '_TMaze.mat';
suff = '_TMaze';
case 'expdeffun'
repos = 'expInfo';
suff = '_expDef.m';
suff = '_expDef';
ext = '.m';
case 'svdspatialcomps'
dateLevel = true;
% expPath = mapToCell(@fileparts, expPath);
% repos = 'expInfo';
% suff = '_expDef.m';
otherwise
error('"%s" is not a valid file type', type);
end
% Append extention to suffix
ext = iff(isempty(newExt)&&~ischar(newExt), ext, newExt);
suff = iff((isempty(ext)&&ischar(ext))||(~isempty(ext)&&ext(1)=='.'),...
[suff, ext], [suff, '.', ext]);
end

% generate a filename for each experiment
Expand All @@ -120,5 +132,4 @@
filename = filename{1};
end

end

end
2 changes: 1 addition & 1 deletion +dat/expLogRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if nargin < 2
args = struct;
elseif nargin == 2 && isstruct(varargin{1});
elseif nargin == 2 && isstruct(varargin{1})
else
args = varargin2struct(varargin{:});
end
Expand Down
4 changes: 2 additions & 2 deletions +dat/expPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
% sames as the above, but returns paths for an experiment with a
% specified 'subject', on a particular 'date', and numbered 'seq'.
%
% e.g. to get the paths for the 'expInfo' repository, for the first
% e.g. to get the paths for the 'main' repository, for the first
% experiment of the day for 'SUBJECTA':
%
% paths = DAT.EXPPATH('SUBJECTA', now, 1, 'expInfo');
% paths = DAT.EXPPATH('SUBJECTA', now, 1, 'main');
%
% Part of Rigbox

Expand Down
6 changes: 3 additions & 3 deletions +dat/listExps.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

% 2013-03 CB created

% The master 'expInfo' repository is the reference for the existence of
% The master 'main' repository is the reference for the existence of
% experiments, as given by the folder structure
expInfoPath = dat.reposPath('expInfo', 'master');
mainPath = dat.reposPath('main', 'master');

function [expRef, expDate, expSeq] = subjectExps(subject)
% finds experiments for individual subjects
% experiment dates correpsond to date formated folders in subject's
% folder
subjectPath = fullfile(expInfoPath, subject);
subjectPath = fullfile(mainPath, subject);
subjectDirs = file.list(subjectPath, 'dirs');
dateRegExp = '^(?<year>\d\d\d\d)\-?(?<month>\d\d)\-?(?<day>\d\d)$';
dateMatch = regexp(subjectDirs, dateRegExp, 'names');
Expand Down
46 changes: 36 additions & 10 deletions +dat/listSubjects.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
function subjects = listSubjects()
function subjects = listSubjects(varargin)
%DAT.LISTSUBJECTS Lists recorded subjects
% subjects = DAT.LISTSUBJECTS() Lists the experimental subjects present
% in experiment info repository ('expInfo').
% subjects = DAT.LISTSUBJECTS([alyxInstance]) Lists the experimental subjects present
% in experiment info repository ('main').
%
% Optional input argument of an alyx instance will enable generating this
% list from alyx rather than from the directory structure on zserver
%
% Part of Rigbox

% 2013-03 CB created
% 2018-01 NS added Alyx compatibility

% The master 'expInfo' repository is the reference for the existence of
% experiments, as given by the folder structure
expInfoPath = dat.reposPath('expInfo', 'master');

dirs = file.list(expInfoPath, 'dirs');
subjects = setdiff(dirs, {'misc'}); %exclude the misc directory

if nargin>0 && ~isempty(varargin{1}) % user provided an alyx instance
ai = varargin{1}; % an alyx instance

% get list of all living, non-stock mice from alyx
s = alyx.getData(ai, 'subjects?stock=False&alive=True');

% determine the user for each mouse
respUser = cellfun(@(x)x.responsible_user, s, 'uni', false);

% get cell array of subject names
subjNames = cellfun(@(x)x.nickname, s, 'uni', false);

% determine which subjects belong to this user
thisUserSubs = sort(subjNames(strcmp(respUser, ai.username)));

% all the subjects
otherUserSubs = sort(subjNames(~strcmp(respUser, ai.username)));

% the full, ordered list
subjects = [{'default'}, thisUserSubs, otherUserSubs]';
else

% The master 'main' repository is the reference for the existence of
% experiments, as given by the folder structure
mainPath = dat.reposPath('main', 'master');

dirs = file.list(mainPath, 'dirs');
subjects = dirs(~cellfun(@(d)startsWith(d, '@'), dirs)); % exclude misc directories
end
end
5 changes: 3 additions & 2 deletions +dat/loadParamProfiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% 2017-02 MW Param struct now sorted in ASCII dictionary order

fn = 'parameterProfiles.mat';
masterPath = fullfile(dat.reposPath('expInfo', 'master'), fn);
masterPath = fullfile(dat.reposPath('main', 'master'), fn);

p = struct; %default is to return an empty struct

Expand All @@ -18,7 +18,8 @@
loaded = load(masterPath, expType); %load profiles for specific experiment type
warning(origState);
if isfield(loaded, expType)
p = orderfields(loaded.(expType)); %extract those profiles to return
[~, I] = sort(lower(fieldnames(loaded.(expType))));
p = orderfields(loaded.(expType), I); %extract those profiles to return
end
end

Expand Down
4 changes: 2 additions & 2 deletions +dat/logPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

%ensure the subject exists
assert(dat.subjectExists(subject), 'Subject "%s" does not exist', subject);
% get path(s) to expInfo repository
reposPath = dat.reposPath('expInfo', varargin{:});
% get path(s) to main repository
reposPath = dat.reposPath('main', varargin{:});

filename = sprintf('%s_log.mat', subject);
subjectPath = file.mkPath(reposPath, subject);
Expand Down
Loading