Changeset 151
- Timestamp:
- 01/11/20 00:14:42 (5 years ago)
- Location:
- prdatasets
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
prdatasets/flowcyto.m
r150 r151 25 25 26 26 if nargin < 1 || isempty(n) 27 n = 1;27 n = 0; 28 28 end 29 29 30 if any(n< 1) || any(n>4)30 if any(n<0) || any(n>4) 31 31 error('Dataset number should be larger than 0 and smaller than 5') 32 32 end 33 33 34 d = pr_getdata('http://prtools.tudelft.nl/prdatasets/FlowCyto_sort.mat',5); 35 36 a = cell(1,numel(n)); 37 for j=1:numel(n) 38 x = prdataset(d{n(j)}); 39 x = setname(x(:,2:255),['Flow Cytometry ' num2str(n(j))]); 40 desc = ['These datasets are based on 612 FL3-A DNA flowcytometer histograms' ... 41 'from breast cancer tissues in 256 resolution. The initial data have been' ... 42 'acquired by M. Nap and N. van Rodijnen of the Atrium Medical Center in' ... 43 'Heerlen, The Netherlands, during 2000-2004, using tubes 3-6 of a DACO' ... 44 'Galaxy flowcytometer (N = 1-4). Histograms are labeled in 3 classes:' ... 45 'aneuploid (335 patients), diploid (131) and tetraploid (146). The first' ... 46 'and the last bin (1 and 256) are set to 0, as they contsin noise. After' ... 47 'that histograms are normalized (sum to one) resulting in a dataset with' ... 48 '254 features.']; 49 ref = {['']}; 50 x = setprior(x,getprior(x,0)); 51 x = setuser(x,desc,'desc'); 52 x = setuser(x,ref,'ref'); 53 a{j} = x; 34 a = pr_loadmatfile(['flowcyto_' num2str(n)]); 35 if isempty(a) 36 d = pr_getdata('http://prtools.tudelft.nl/prdatasets/FlowCyto_sort.mat',5); 37 matfile = fullfile(fullfile(fileparts(which(mfilename)),'data'),'flowcyto'); 38 b = []; 39 for i=1:4 40 a = setname(prdataset(d{i}),['Flow Cytometry Tube_' num2str(i+2)]); 41 save([matfile '_' num2str(i)],'a'); 42 b = [b a]; 43 end 44 a = setname(b,'Flow Cytometry'); 45 save([matfile '_0'],'a'); 46 a = pr_loadmatfile(['flowcyto_' num2str(n)]); 54 47 end 55 56 if numel(a) == 157 a = a{1};58 end59 60 -
prdatasets/pr_download_uci.m
r150 r151 172 172 if exist([filenames{j} '.mat'],'file') == 2 173 173 % if mat-file is available, use it 174 s = load([filenames{j} '.mat']); 175 f = fieldnames(s); 176 a = getfield(s,f{1}); 174 % s = load([filenames{j} '.mat']); 175 % f = fieldnames(s); 176 % a = getfield(s,f{1}); 177 a = file2dset([filenames{j} '.mat']); 177 178 else 178 179 if ~exist('data','var') -
prdatasets/pr_getdata.m
r150 r151 11 11 % 12 12 % A mat-file returns a structure with fields pointing to stored variables. 13 % If available, the dataset DSET stored in FIELD (default 1) is returned in 14 % OUT. In case of a datafile DFILE, it is created, if necessary, with given 13 % If available, the dataset DSET stored in FIELD is returned in OUT. If 14 % FIELD is not set all fields are returned in a cell array. 15 % 16 % In case of a datafile DFILE, it is created, if necessary, with given 15 17 % TYPE and returned in OUT. In case the download was successful but no 16 18 % dataset or datfile could be created (e.g. because of empty TYPE) OUT is … … 127 129 if exist([dsetmat],'file') == 2 128 130 try 129 s = prload(dsetmat);131 out = file2dset(dsetmat); 130 132 catch ME 131 out = 'error'; 132 return 133 end 134 if isstruct(s) 135 if isempty(field) 136 f = fieldnames(s); 137 out = getfield(s,f{1}); 133 s = load(dsetmat); 134 if isstruct(s) 135 if isempty(field) 136 s = struct2cell(s); 137 out = s{1}; 138 else 139 out = getfield(s,field); 140 end 138 141 else 139 out = getfield(s,field);142 out = s; 140 143 end 141 else142 out = s;143 144 end 144 145 elseif exist(dset,'dir') == 7 -
prdatasets/pr_loadmatfile.m
r137 r151 24 24 name = pr_callername; 25 25 end 26 matfile = fullfile(fullfile(fileparts(which(name)),'data'),name); 26 matfile = fullfile(fullfile(fileparts(which(mfilename)),'data'),name); 27 if exist([matfile '.mat'],'file') ~= 2, 28 return 29 end 27 30 28 31 if nargout == 1 29 varargout{1} = loadmatf([matfile '.mat']); 32 % varargout{1} = loadmatf([matfile '.mat']); 33 varargout{1} = file2dset([matfile '.mat']); 30 34 else 31 35 for i=1:nargout 32 varargout{i} = loadmatf([matfile '_' num2str(i) '.mat']); 36 % varargout{i} = loadmatf([matfile '_' num2str(i) '.mat']); 37 varargout{i} = file2dset([matfile '_' num2str(i) '.mat']); 33 38 end 34 39 end -
prdatasets/pr_showdsets.m
r142 r151 2 2 3 3 forget = {'Contents','mfeat_all','check_','pr_'}; 4 commands = struct2cell(dir('*.m')); 4 dirr = fileparts(which(mfilename)); 5 commands = struct2cell(dir(fullfile(dirr,'*.m'))); 5 6 commands = commands(1,:); 6 7 L = strmatch('pr_',commands);
Note: See TracChangeset
for help on using the changeset viewer.