-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathecotaxa_tools.m
More file actions
191 lines (146 loc) · 6.07 KB
/
Copy pathecotaxa_tools.m
File metadata and controls
191 lines (146 loc) · 6.07 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
%% Ecotaxa tool (F. Lombard 2019 lombard@obs-vlfr.fr)
% ecotaxa tool helps you to process raw results originating from quantitative
% imaging devices and originating from Ecotaxa (https://ecotaxa.obs-vlfr.fr/)
% ecotaxa tool includes the initial process of raw *.tsv files available from
% the export function in ecotaxa (Warning, please use the option "one file/sample")
%
% In the future ecotaxa tool will also includes several functions allowing
% the raw visialisation and raw analysis of your data. Those analysis are only
% of indicational value and don't dispense to further analyse some more
% specific features by building/refining the analysis yourself
%
% Zooscan analysis is supporting several scans per samples (and assembling
% them accordingly to the fractionation)
%
% the resulting structured base includes the following variables as final
% results
% Ab abundance per groups (ind.m-3)
% Bv biovolume per groups (mm3.m-3)
% Ybv_Plain_Area_BV_spectra NBSSbiovolume per groups per size class (mm3.mm-3.m-3)
% Ybv_Riddled_Area_BV_spectra NBSSbiovolume per groups per size class (mm3.mm-3.m-3)
% Ybv_Ellipsoid_BV_spectra NBSSbiovolume per groups per size class (mm3.mm-3.m-3)
% X is the Middle of each biovolume size class (caution it is in log here) (log(mm3)
% X1 is the amplitude of each biovolume size class - used for de-normalizing NBSS (mm3)
% ESD vector is the conversion of X in ESD (µm this time)
% ESDquartilesmoyenne are the 5 25 50 75 95 % quartiles of ESD (+ mean and std) of each groups
%% Fabien Lombard February 2019
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
close all
clear all
directoryoftoolbox='/Users/fabienlombard/Documents/travail/projets/ecotaxatoolbox';
list = {'process bases (classic-quantitative)','process bases for images features analysis (qualitative) - not yet available','analyse base - not yet available'};
% to be added in future: gross analysis of images properties
[indx,tf] = listdlg('ListString',list,'SelectionMode','single','ListSize',[300,150]);
%% classic process
if indx==1
f = msgbox('Please select the folder containing the *.tsv files or allready processed bases');
uiwait(f)
folder=uigetdir;
% in the future, make communication with the API here (if/when available) to extract tsv directly from ecotaxa
cd(folder)
A=dir('*.tsv');
a=length(A);
if a==0
warning('The folder does not contain any *.tsv files from ecotaxa, please extract your data before from the Ecotaxa software')
return
end
list2 = {'Zooscan','Flowcam','IFCB','UVP step 1-from "ecopart-detailed export" (no size)','UVP step 2-add ecotaxa export (size and other features)','Accuri flowcytometry','eHFCM_H5','eHFCM_H20 initial big file','eHFCM_H20 by sample update','Planktoscope trial 2020'};
[indx2,tf] = listdlg('PromptString','What instrument was used?','ListString',list2,'SelectionMode','single','ListSize',[300,150]);
if indx2==5
B=dir('*.mat');
b=length(B);
if b==0
warning('The folder does not contain any processed bases, please process your "detailled particles" bases first and save it to the same folder as your raw files')
return
end
end
if indx2==1
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_zooscan;
process_spectra_and_save
elseif indx2==2
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_flowcam;
process_spectra_and_save
elseif indx2==3
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_IFCB;
process_spectra_and_saveIFCB
elseif indx2==4
ecotaxa_particles_base
elseif indx2==5
UVPread_persample
elseif indx2==6
[base_Zooscan,m,zoo_groups]=process_accuri;
elseif indx2==7
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_H5;
process_spectra_and_saveH5
elseif indx2==8
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_H20;
process_spectra_and_saveH20
elseif indx2==9
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_H20_bysample;
process_spectra_and_saveH20
elseif indx2==10
%return
[base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_planktoscope;
process_spectra_and_save
end
end
%%
%% process images (not yet integrated)
if indx==2
warning('feature not yet integrated, may be prone to bugs')
% to be done:
%to test the presence of images
%to migrate all images to one single folder
% to select the object properties to analyse / excluse
%
return
end
%% analyze bases
if indx==3
B=dir('*.mat');
b=length(B);
if b==0
warning('The folder does not contain any processed bases, please process your bases first')
return
end
%% start the app here
%
%%
end
% %% starting from here this should become a function latter (activated
%
%
% %% reading the tsv files and starting to create the bases
% if indx==1
%
% list = {'Zooscan','Flowcam','IFCB','UVP-from "ecopart-detailed export" (no size)','UVP detailled export +ecotaxa export (size and other features)','Accuri flowcytometry'};
%
%
% [indx2,tf] = listdlg('PromptString','What instrument was used?','ListString',list,'SelectionMode','single','ListSize',[300,150]);
%
%
% if indx2==5 && b==0
% warning('The folder does not contain any processed bases, please process your "detailled particles" bases first and save it to the same folder as your raw files')
% return
% end
%
%
% if indx2==1
% [base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_zooscan;
% process_spectra_and_save
% elseif indx2==2
% [base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_flowcam;
% process_spectra_and_save
% elseif indx2==3
% [base_Zooscan,m,zoo_groups,Idlistshort]=process_tsv_IFCB;
% process_spectra_and_saveIFCB
% elseif indx2==4
% ecotaxa_particles_base
% elseif indx2==5
% UVPread_persample
% elseif indx2==6
% %[base_Zooscan,m,zoo_groups]=process_accuri;
% end
%
% end