-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoadCitPlate
39 lines (37 loc) · 1.42 KB
/
LoadCitPlate
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
function PL = LoadCitPlate(directorio, plato)
% DESCARGA LOS DATOS DE UN SOLO PLATO
currdir=pwd;
cd(directorio)
txt = strcat( '*PL',num2str(plato),'_*' );
platos = dir( txt ); %'*PL1*' ); %Nombre del plato que se quiera extraer
length(platos)
for i=1:length(platos)
x=tic; i %para saber cuanto lleva
cd (platos(i).name);
wells=dir;
if i==1 %selecciona los campos de la info que no son utiles
j=1;
[datos info] = fca_readfcs(wells(j+2).name); %aunque datosEscalados no se guarda porque no sabemos ni qu'e con ellos todav'ia
campos = fieldnames(info);
FieldsToDelete = campos([1 3 4 5 6 9 10 11 12 13 14 15 16 17:end]);
FieldsToPL = campos(setdiff(1:size(campos,1), [1 3 4 5 6 9 10 11 12 13 14 15 16 17] ));
info=rmfield(info, FieldsToPL);
PL.Info = info;
end
for j=1:length(wells)-2
[datos info ] = fca_readfcs(wells(j+2).name); %aunque datosEscalados no se guarda porque no sabemos ni qu'e con ellos todav'ia
if ~isempty(datos)%porque salio un archivo que "no es de tipo fcs soportado" whatever that means
info=rmfield(info, FieldsToDelete);
well = str2num(str2mat(info.filename(end-6:end-4)));
PL(i).WELL(well).dat = datos;
PL(i).WELL(well).info = info;
else
PL(i).WELL(well+1).info.filename=0;
end
end
PL(i).Info.PlateName = platos(i).name;
cd ..
toc(x)
end
cd(currdir)
end