forked from TASBE/TASBEFlowAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
directory_to_sample_set.m
32 lines (29 loc) · 1.06 KB
/
directory_to_sample_set.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
% Copyright (C) 2010-2017, Raytheon BBN Technologies and contributors listed
% in the AUTHORS file in TASBE analytics package distribution's top directory.
%
% This file is part of the TASBE analytics package, and is distributed
% under the terms of the GNU General Public License, with a linking
% exception, as described in the file LICENSE in the TASBE analytics
% package distribution's top directory.
function set = directory_to_sample_set(directory,exclusions,prefix)
if nargin<3,
prefix = '';
end
fileset = dir(directory);
set = cell(0);
for i=1:numel(fileset),
name = fileset(i).name;
% filter out unwanted
skip = false;
if(isempty(strmatch(fliplr('.fcs'),fliplr(name)))), skip = true; end;
for j=1:numel(exclusions),
if(~isempty(strfind(name,exclusions{j}))), skip = true; end;
end
if skip, continue; end;
% add to collection
set{end+1,1} = [prefix fileset(i).name(1:(end-4))];
set{end,2} = { [directory '/' fileset(i).name] };
end
if numel(set)==0,
warn('Warning: no FCS files found in directory: %s',directory);
end