%FLOWCYTO Load 4 flow-cytometry datasets.
%
%   A = FLOWCYTO(N)
%
% These datasets are based on 612 FL3-A DNA flowcytometer histograms
% from breast cancer tissues in 256 resolution. The initial data have been 
% acquired by M. Nap and N. van Rodijnen of the Atrium Medical Center in 
% Heerlen, The Netherlands, during 2000-2004, using tubes 3-6 of a DACO 
% Galaxy flowcytometer (N = 1-4). Histograms are labeled in 3 classes: 
% aneuploid (335 patients), diploid (131) and tetraploid (146). The first
% and the last bin (1 and 256) are set to 0, as they contsin noise. After
% that histograms are normalized (sum to one) resulting in a dataset with
% 254 features.
% 
% The four datasets are aligned for the same patients, but are based on
% different measurements.
%
% SEE ALSO
% PRTOOLS, DATASETS

% Copyright: R.P.W. Duin 


function a = flowcyto(n)

if nargin < 1 || isempty(n)
  n = 0;
end

if any(n<0) || any(n>4)
  error('Dataset number should be larger than 0 and smaller than 5')
end

a = pr_loadmatfile(['flowcyto_' num2str(n)]);
if isempty(a)
  d = pr_getdata('http://prtools.tudelft.nl/prdatasets/FlowCyto_sort.mat',5);
  matfile = fullfile(fullfile(fileparts(which(mfilename)),'data'),'flowcyto');
  b = [];
  for i=1:4
    a = setname(prdataset(d{i}),['Flow Cytometry Tube_' num2str(i+2)]);
    save([matfile '_' num2str(i)],'a');
    b = [b a];
  end
  a = setname(b,'Flow Cytometry');
  save([matfile '_0'],'a');
  a = pr_loadmatfile(['flowcyto_' num2str(n)]);
end
