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

2017b #265

Draft
wants to merge 596 commits into
base: dev
Choose a base branch
from
Draft

2017b #265

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
596 commits
Select commit Hold shift + click to select a range
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
d50918d
hotfix for activating AlyxPanel in MC
May 30, 2019
cfe2e40
now requires 2017b or later
May 30, 2019
a891b80
now requires 2017b or later
May 30, 2019
f43146f
hotfix to SignalsExp for ending experiments
Jun 3, 2019
c98a247
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
0f97e58
updated alyx-matlab submodule ('getFile' and 'offlineListSubs' branch…
Jun 27, 2019
2f242e5
Rebased 'AutoAlyxPanel' onto 'dev' at 0f97e58
Jun 27, 2019
263b133
Merge branch 'autoAlyxPanel' into dev
Jul 3, 2019
79fd960
Rebased 'splitPaths' onto 'dev' at 263b133
Jul 3, 2019
4a96d95
Merge branch 'splitPaths' into dev
Jul 3, 2019
59be59e
added '+dat/paths.m' to .gitignore
Jul 3, 2019
f137179
typo fix in '.gitignore'
Jul 5, 2019
c6ceef3
Small fix to AlyxPael test
k1o0 Jul 5, 2019
265589d
added coveralls coverage badge back to readme
Jul 8, 2019
004d6bd
Fixes for test conflicts
k1o0 Jul 15, 2019
20cb546
Ensure path is reset
k1o0 Jul 16, 2019
629ec27
Issue #180
k1o0 Jul 16, 2019
539e77c
a fix to AlyxPanel_test/setupPanel, but still failing
ahcf Jul 17, 2019
eba128c
Added custom badge (#181)
k1o0 Jul 17, 2019
d6b7def
Reverted some changes and added fix for activeFlag test
k1o0 Jul 17, 2019
829cac5
Bug fixes and updates for update to test db
k1o0 Jul 18, 2019
3725fe9
Changes to alyx-matlab
k1o0 Jul 18, 2019
7b9aa72
Fix to recordWeight test
k1o0 Jul 18, 2019
f0a19d5
Fix for db bug cause submodule test fail
k1o0 Jul 18, 2019
2b6b45c
Fixes for test conflicts (#178)
k1o0 Jul 19, 2019
247060a
Fix for incorrectly used TestClassSetup params
k1o0 Jul 19, 2019
eb5e9b9
Merge branch 'dev' into tests-update
k1o0 Jul 19, 2019
3437b6c
Merge pull request #183 from cortex-lab/tests-update
k1o0 Jul 19, 2019
6d64e01
Duplicate subject removed on db
k1o0 Jul 19, 2019
35fc5b1
Merge branch 'dev'
Jul 19, 2019
993d906
updated badges for README; updated submodules
Jul 19, 2019
27cc602
updated signals submodule
Jul 19, 2019
c1a2e42
added CHANGELOG (#185)
Jul 24, 2019
5ccf2be
HOTFIX Update to alyx-matlab v.2.2.2
k1o0 Jul 24, 2019
e52f99d
updated signals submodule (eb71b1f)
Jul 25, 2019
c13a91e
fixed up git.update + doc, have to test
Jul 26, 2019
8a4f78b
created outline for git.update tests
Jul 26, 2019
763d2f8
Added test for ensureCell
k1o0 Jul 29, 2019
bfaf31f
Fix'd typo in ensureCell_test
k1o0 Jul 29, 2019
dd23037
Future-proofing runall to ignore tests with specific hardware require…
k1o0 Jul 29, 2019
80ac368
finished test for git.update
Jul 30, 2019
15a1f24
finished tests
Jul 30, 2019
0e078f1
added appropriate tests for using old and new mock FETCH_HEAD files
Jul 30, 2019
6824c6c
bug fix for empty input arg for git.update
Jul 30, 2019
ebdec17
all tests pass
Jul 30, 2019
4d00e56
Added tests for nop, iff and emptyElems
k1o0 Jul 31, 2019
5b3b963
updated CHANGELOG
Jul 31, 2019
bb5c3f7
Added tests for cellsprintf and num2cellstr; bug fix in num2cellstr
k1o0 Jul 31, 2019
e56f847
small style changes
Jul 31, 2019
c725f69
Merge from master
k1o0 Jul 31, 2019
d01b06d
Submodule update
k1o0 Jul 31, 2019
463310a
Update CONTRIBUTING.md
Jul 31, 2019
23eb2cb
Update CONTRIBUTING.md
Jul 31, 2019
b78f3f6
more small style updates
Jul 31, 2019
5b11a8f
mapToCell test
k1o0 Aug 1, 2019
4076450
Removed complete todos
k1o0 Aug 1, 2019
bb6144d
Added test for dat.expExists
k1o0 Aug 1, 2019
2932a3c
Restore changes made in commit
k1o0 Aug 1, 2019
ff938a2
Expanded test for dispWaterReq
k1o0 Aug 1, 2019
d9a9768
assert -> verifyMatches
k1o0 Aug 1, 2019
325f95f
Added catStructs test
k1o0 Aug 5, 2019
82ad7af
Added tabulateArgs test
k1o0 Aug 5, 2019
1fe7039
superSave test added
k1o0 Aug 6, 2019
a492bd2
added an informative error message in the case that dat.paths is missing
kevin-j-miller Aug 6, 2019
c3e863a
Attempting to construct a branch that doesn't differ from dev in its …
kevin-j-miller Aug 6, 2019
a7f86fd
Revert "Attempting to construct a branch that doesn't differ from dev…
kevin-j-miller Aug 6, 2019
046cb82
Revert "added an informative error message in the case that dat.paths…
kevin-j-miller Aug 6, 2019
cf3c384
Added file package test
k1o0 Aug 7, 2019
9be0796
Added test for pick
k1o0 Aug 8, 2019
efa7414
Added test for namedArg
k1o0 Aug 8, 2019
abd24c1
Added varName test
k1o0 Aug 8, 2019
4ced800
updated CONTRIBUTING
Aug 8, 2019
6206e9e
Added back tolerance change
k1o0 Aug 8, 2019
8409f63
Update CHANGELOG.md
Aug 8, 2019
3263b85
Dev kevin (#192)
kevin-j-miller Aug 8, 2019
18021cb
Bug fix in namedArg test
k1o0 Aug 8, 2019
3eff565
Merge branch 'master' into dev
Aug 8, 2019
4d501ed
Removed old function -> now a method of Alyx
k1o0 Aug 8, 2019
3690b5a
Update CONTRIBUTING.md
Aug 8, 2019
c6c8e06
Started +fun package test; added fileFunction test
k1o0 Aug 9, 2019
c4022dc
No longer using 'which' to assert function existence
k1o0 Aug 9, 2019
c85ba50
Bug fixes for tests
k1o0 Aug 9, 2019
e575f5b
Update CONTRIBUTING.md
Aug 9, 2019
fdfe728
Bug fix for wiringInfo method
k1o0 Aug 11, 2019
de0dc92
Added KeyedSeq test
k1o0 Aug 11, 2019
6614508
Added docs for apply and applyForce
k1o0 Aug 11, 2019
1dfdc74
Added loadVar test
k1o0 Aug 12, 2019
0580014
Issue #168
k1o0 Aug 12, 2019
c7b9d60
some bug fixes
Aug 12, 2019
2228c19
more bug fixes
Aug 12, 2019
cc26bf9
more bug fixes
Aug 12, 2019
2982722
Added mergeStructs test
k1o0 Aug 12, 2019
4b107ff
more bug fixes
Aug 12, 2019
a2918d9
Added performance tests; reorganized tests; updated changelog
k1o0 Aug 13, 2019
af88623
Added parameters walkthrough
k1o0 Aug 13, 2019
405f0ed
Merge branch 'dev' into tests
k1o0 Aug 13, 2019
4b7def2
Added timeline walkthrough; bug fix for wiringInfo in Timeline
k1o0 Aug 14, 2019
dd0adb7
added informative error messages to calibration code
kevin-j-miller Aug 14, 2019
aa71984
Added documentation for setting up Window; documentation for Window c…
k1o0 Aug 14, 2019
b3526ba
Added a few examples to hardware docs
k1o0 Aug 15, 2019
bd3b472
Added Viewing model walkthrough and expanded FAQ
k1o0 Aug 15, 2019
81c9b1d
Updated changelog
k1o0 Aug 15, 2019
0356894
Merge pull request #197 from cortex-lab/dev_errormessages
k1o0 Aug 15, 2019
0aba8bc
update CONTRIBUTING to mention "squash, rebase, merge" workflow
Aug 15, 2019
6b37aa9
Updates to docs
k1o0 Aug 15, 2019
c32995d
Merge from dev
k1o0 Aug 15, 2019
0f1311e
Added test for +hw/calibrate.m
k1o0 Aug 16, 2019
a9b3d4c
deleted exp.construct
Jul 8, 2019
f509afe
Added documentation for calibration test
k1o0 Aug 16, 2019
9b2fe32
commit to re-run CI
Aug 19, 2019
72a39b1
Updated docs; added services guide
k1o0 Aug 20, 2019
9d750fd
Updates docs
k1o0 Aug 21, 2019
9b07dfe
Fix for Communicator WTF mode; increased test coverage for iff
k1o0 Aug 21, 2019
7c04e15
Update to changelog and signals
k1o0 Sep 4, 2019
31538f9
Merge pull request #188 from cortex-lab/tests
k1o0 Sep 4, 2019
d26aabc
HOTFIX changed Alyx Panel login timer to 90 mins
Sep 10, 2019
0c9f2fb
HOTFIX changed Alyx Panel login timer to 90 mins
Sep 10, 2019
0227fea
Various bugfixes and imporvements to +git tests
k1o0 Sep 16, 2019
b7071c5
Merge from dev
k1o0 Sep 16, 2019
3852a4f
Removed readthedocs, updated submodules
k1o0 Sep 16, 2019
4898beb
2.3 <- 2.2.1 (#198)
k1o0 Sep 16, 2019
9ff87fc
Update Shields
k1o0 Sep 16, 2019
4ff1a21
HOTFIX: Correct location of docs in README; Stronger wording in insta…
k1o0 Sep 16, 2019
d1f6f0b
Fix for runCmd & test; runall now includes subfolders
k1o0 Sep 16, 2019
1cc8841
Updated changelog, submodules, etc.
k1o0 Sep 24, 2019
5841dd6
Merge branch 'gitUpdateFix' into dev
k1o0 Sep 24, 2019
c0672df
Updated submodules
k1o0 Sep 24, 2019
c5d0561
Fix gamma calibration (#164)
nsteinme Oct 1, 2019
4fa283a
Exp server test (#203)
k1o0 Oct 21, 2019
3d29c7e
added files. (#201)
Oct 30, 2019
2404e97
Revert "added files. (#201)"; all tests failed plus no review
k1o0 Nov 2, 2019
79f7db7
Merge branch 'dev'
k1o0 Nov 2, 2019
a457708
HOTFIX updated alyx-matlab submodule
Nov 12, 2019
7d6b601
Update Window.m
petersaj Nov 15, 2019
a1a6664
Develop (#236)
k1o0 Feb 14, 2020
ff60a5d
Support for test Signals class for older MATLAB versions
k1o0 Feb 16, 2020
0511800
removed mock dependency for older MATLAB support
k1o0 Feb 16, 2020
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/constructExpRef.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function ref = constructExpRef(subjectRef, expDate, expSequence)
%DAT.CONSTRUCTEXPREF Constructs an experiment reference string
% ref = DAT.CONSTRUCTEXPREF(subject, dat, seq) constructs and returns a
% ref = DAT.CONSTRUCTEXPREF(subject, date, seq) constructs and returns a
% standard format string reference, for the experiment using the 'subject',
% the 'date' of the experiment (a MATLAB datenum), and the daily sequence
% number of the experiment, 'seq' (must be an integer).
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
9 changes: 7 additions & 2 deletions +dat/expExists.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
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. For an
% experiment to exist the correct folder structure must be present in the
% main repository's master location.
%
% See Also DAT.LISTEXPS, DAT.PATHS
%
% Part of Rigbox

Expand All @@ -14,7 +19,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
122 changes: 72 additions & 50 deletions +dat/expFilePath.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,105 +7,128 @@
% 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'
% Options for reposlocation are: 'all' (default), 'local', 'master' and 'remote'
% 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, 'Rigbox:dat:expFilePath:NotEnoughInputs',...
'Not enough input arguments.')

parsed = catStructs(regexp(varargin{1}, dat.expRefRegExp, 'names'));
if isempty(parsed) % Subject, not ref
if nargin < 3
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
['Not enough input arguments; check expRef formatted correcly ' ...
'or enter subject, date and sequence as separate arguments'])
elseif nargin == 3
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
'Not enough input arguments; missing file type')
elseif nargin > 4
location = varargin{5};
varargin(5) = [];
else
location = {};
end
typeIdx = 4;
else % Ref, not subject
if nargin < 2
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
'Not enough input arguments; missing file type')
elseif nargin > 2
location = varargin{3};
varargin(3) = [];
else
location = {};
end
typeIdx = 2;
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 +143,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
20 changes: 12 additions & 8 deletions +dat/expParams.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@
% each experiment. Any experiments without saved parameters will return
% empty, [].
%
% If there are multiple remote 'main' repositories, all are searched
% precedence is given to experiments on the master repository.
%
% See also DAT.LOADBLOCK, DAT.EXPFILEPATH
%
% Part of Rigbox

% 2013-03 CB created

%If ref is not an array, wrap it so code below works generally
[ref, singleArg] = ensureCell(ref);
%Get the paths where parameters for each experiment will be, if any
files = dat.expFilePath(ref, 'parameters', 'master');
files = dat.expFilePath(ref, 'parameters', 'remote');
%Check which param files exist and load those into results array
p = cell(size(ref));
present = file.exists(files);
p(present) = loadVar(files(present), 'parameters');
matching = @(p) file.exists(ensureCell(p));
seq = cellfun(@(f)sequence(ensureCell(f)),files);
p = mapToCell(@(p)iff(isempty(p), [], @() loadVar(p,'parameters')), ...
fun.map(@(p)p.filter(matching).first, seq)); %mu = 0.0490; std = 0.0075
% p = mapToCell(@loadFun, files); %mu = 0.0443; std = 0.0035

if singleArg
%If single arg was passed in (i.e. not a cell array, but just a ref,
%make sure we return a single result (i.e. a single parameter variable,
%not a cell array of them.
p = p{1};
end

end

end
7 changes: 5 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 All @@ -23,6 +23,9 @@
reposArgs = varargin(end);
varargin = varargin(1:end - 1);
else
% Check for minimum inputs
assert(nargin > 2, ...
'Rigbox:dat:expPath:NotEnoughInputs', 'Must provide repo location')
reposArgs = varargin((end - 1):end);
varargin = varargin(1:end - 2);
end
Expand Down
17 changes: 10 additions & 7 deletions +dat/listExps.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,36 @@

% 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 = ensureCell(dat.reposPath('main', 'remote'));

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);
subjectDirs = file.list(subjectPath, 'dirs');
subjectPath = fullfile(mainPath, subject);
subjectDirs = cellflat(rmEmpty(file.list(subjectPath, 'dirs')));
dateRegExp = '^(?<year>\d\d\d\d)\-?(?<month>\d\d)\-?(?<day>\d\d)$';
dateMatch = regexp(subjectDirs, dateRegExp, 'names');
dateStrs = subjectDirs(~emptyElems(dateMatch));
dateStrs = unique(subjectDirs(~emptyElems(dateMatch)));
[expDate, expSeq] = mapToCell(@(d) expsForDate(subjectPath, d), dateStrs);
expDate = cat(1, expDate{:});
expSeq = cat(1, expSeq{:});
expRef = dat.constructExpRef(repmat({subject}, size(expDate)), expDate, expSeq);
%sort them by date first then sequence number
[~, isorted] = sort(cellsprintf('%.0d-%03i', expDate, expSeq));
%remove duplicates that may exist in alternate repos
[~,ia] = unique(expRef);
isorted = intersect(isorted,ia,'stable');
expRef = expRef(isorted);
expDate = expDate(isorted);
expSeq = expSeq(isorted);
end

function [dates, seqs] = expsForDate(subjectPath, dateStr)
dateDirs = file.list(fullfile(subjectPath, dateStr), 'dirs');
seqMatch = cell2mat(regexp(dateDirs, '(?<seq>\d+)', 'names'));
dateDirs = rmEmpty(file.list(fullfile(subjectPath, dateStr), 'dirs'));
seqMatch = cell2mat(regexp(cellflat(dateDirs), '(?<seq>\d+)', 'names'));
if numel(seqMatch) > 0
seqs = str2double({seqMatch.seq}');
else
Expand Down
14 changes: 7 additions & 7 deletions +dat/listSubjects.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
function subjects = listSubjects()
%DAT.LISTSUBJECTS Lists recorded subjects
% subjects = DAT.LISTSUBJECTS() Lists the experimental subjects present
% in experiment info repository ('expInfo').
% in main experiment repository ('mainRepository').
%
% See also ALYX.LISTSUBJECTS
%
% Part of Rigbox

% 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');

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

end
dirs = unique(cellflat(rmEmpty(file.list(mainPath, 'dirs'))));
subjects = dirs(~cellfun(@(d)startsWith(d, '@'), dirs)); % exclude misc directories
Loading