-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfcsparseplate.m
More file actions
45 lines (37 loc) · 1.18 KB
/
fcsparseplate.m
File metadata and controls
45 lines (37 loc) · 1.18 KB
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
function [platedata, platemeta] = fcsparseplate(datadir, platename, varargin)
% FCSPARSEPLATE loads flow cytometry data from a 8x12 plate and returns a
% struct array (matrix) containing the results. After this you can call
% FCSSEGPLATE to automatically segment the entire plates' data.
%
% Created 20141021 by JW
tic
% if LSRII, data is in a subfolder called PLATENAME
path = dir([datadir platename]);
if ~isempty(path) && path(1).isdir
datadir = [datadir platename '/'];
end
% make a new filename cache in case there is an outdated existing cache
makewellfilenameindex(datadir);
% load a 96-well plate of data
fprintf(['Loading plate "' platename '": well \n']);
platedata = [];
platemeta = [];
for r = 1:8
for c = 1:12
fprintf([ '\b\b\b\b' coord2well(r,c) '\n']); % gives "scrolling" feedback
[data meta] = fcsparsewell(datadir, platename, [r c]);
if isempty(data) || fcsisempty(data)
continue;
end
if r==1 && c == 1
platedata = data;
platemeta = meta;
else
platedata(r,c) = data;
platemeta(r,c) = meta;
end
end
end
fprintf('Finished loading. ');
toc
end