-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathget_data.m
49 lines (42 loc) · 1.62 KB
/
get_data.m
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
%% get_data
% gets data from mydata_my_pet.m
%%
function [data, auxData, metaData, txtData, weights] = get_data(my_pet)
% created 2019/12/26 by Bas Kooijman, modified 2023/03/05
%% Syntax
% [data, auxData, metaData, txtData, weights] = <get_data *get_data*>(my_pet)
%% Description
% Gets all data set by mydata for any entry
%
% Input:
%
% * my_pet: character string with name of entry
%
% Output:
%
% * data: cell array with empirical data
% * auxdata: cell array with auxiliary data
% * metaData: cell array with meta-data
% * txtData: cell array with text labels for data
% * weights: cell array with weight coefficient used for parameter estimation
%% Remarks
% This function first tries to find mydata_my_pet in local directory entries (typically only for curators);
% in failure, it downloads it from the web via powershell function wget.
% Make sure the your current directory does not have mydata_my_pet.m, since this file will be overwritten and deleted.
get_mydata_my_pet(my_pet); % write mydata_my_pet
[data, auxData, metaData, txtData, weights] = mydata_my_pet;
delete('mydata_my_pet.m')
end
function get_mydata_my_pet(my_pet)
fnm= 'mydata_my_pet.m';
try % locally present in dir entries (mostly for curators)
copyfile(['../../add_my_pet/entries/', my_pet, '/mydata_', my_pet, '.m'], fnm)
catch % get results_my_pet.mat from web
path = 'https://www.bio.vu.nl/thb/deb/deblab/add_my_pet/entries/';
if ismac || isunix
system(['wget ', path, my_pet, '/mydata_', my_pet, ' -O ', fnm]);
else
system(['powershell wget ', path, my_pet, '/mydata_', my_pet, ' -O ', fnm]);
end
end
end