-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAnalysisReport.m
More file actions
554 lines (496 loc) · 20 KB
/
Copy pathAnalysisReport.m
File metadata and controls
554 lines (496 loc) · 20 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
function varargout = AnalysisReport(varargin)
% ANALYSISREPORT M-file for AnalysisReport.fig
% ANALYSISREPORT, by itself, creates a new ANALYSISREPORT or raises the existing
% singleton*.
%
% H = ANALYSISREPORT returns the handle to a new ANALYSISREPORT or the handle to
% the existing singleton*.
%
% ANALYSISREPORT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ANALYSISREPORT.M with the given input arguments.
%
% ANALYSISREPORT('Property','Value',...) creates a new ANALYSISREPORT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before AnalysisReport_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to AnalysisReport_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help AnalysisReport
% Last Modified by GUIDE v2.5 29-Aug-2008 13:01:23
% Begin initialization code - DO NOT EDIT
gui_Singleton = 0;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @AnalysisReport_OpeningFcn, ...
'gui_OutputFcn', @AnalysisReport_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before AnalysisReport is made visible.
function AnalysisReport_OpeningFcn(hObject, eventdata, handles, varargin)
% Set Window size and Position
screensize=get(0,'screensize');
winsize=get(handles.AnalysisReport,'Position');
winwidth=winsize(3);
winheight=winsize(4);
screenwidth=screensize(3);
screenheight=screensize(4);
winpos=[0.5*(screenwidth-winwidth),0.5*(screenheight-winheight),winwidth,winheight];
set(handles.AnalysisReport,'Position',winpos);
% Get inputs
handles.ind=varargin{1};
analysis=varargin{2};
project=varargin{3};
soft=varargin{4};
% Correct title
set(handles.titleStatic,'String',['Report for Analysis ',num2str(handles.ind)])
% Start filling textbox
if ~isempty(analysis)
% Find number of slides
count=0;
index=0;
for i=1:analysis.numberOfConditions
maxes{i}=[];
for j=1:length(analysis.exprp{i})
maxes{i}=[maxes{i},length(analysis.exprp{i}{j})];
end
maxesall{i}=max(maxes{i});
end
for i=1:analysis.numberOfConditions
count=count+size(analysis.exprp{i},2);
datatable{1,i}=analysis.conditionNames{i};
for j=1:max(size(analysis.exprp{i}))
index=index+1;
arrays{index}=analysis.exprp{i}{j};
%datatable{2+j,i}=analysis.exprp{i}{j};
datatable{2+j,i}=[analysis.exprp{i}{j},repmat(' ',[1 maxesall{i}-length(analysis.exprp{i}{j})]),'|'];
end
end
maintext={'General Information';'----------------------------------------';' ';...
['Number of Conditions : ',num2str(analysis.numberOfConditions)];' ';...
'Condition Names : ';char(analysis.conditionNames);' ';...
['Number of Arrays : ',num2str(count)];' ';...
'Array Names : ';char(arrays);' ';...
'Structure summary (1st row contains the condition names, the rest the slides of each condition)';
' ';'------------------------------------------------------------';...
matfromcell(datatable,0);...
'------------------------------------------------------------';' ';' '};
else
maintext='';
end
if ~isempty(project)
% Preprocessing information
if isfield(project,'Preprocess')
if soft~=99 && soft~=98 % cDNAs
if isfield(project.Preprocess,'BackgroundCorrection')
pl1=['Background Correction Method : ',project.Preprocess.BackgroundCorrection];
else
pl1='';
end
if isfield(project.Preprocess,'UseEstimate')
pl2=['Signal Estimation using : ',project.Preprocess.UseEstimate];
else
pl2='';
end
if isfield(project.Preprocess,'FilterMethod')
pl3=['Filtering Method used : ',project.Preprocess.FilterMethod];
else
pl3='';
end
if isfield(project.Preprocess,'FilterParameter')
pl4=['Filtering Parameter for filtering method : ',project.Preprocess.FilterParameter];
else
pl4='';
end
if isfield(project.Preprocess,'FinalPoorSpots')
pl5=['Final Number of Poor Spots : ',project.Preprocess.FinalPoorSpots];
else
pl5='';
end
if isfield(project.Preprocess,'OutlierTest')
pl6=['Outlier Test performed : ',project.Preprocess.OutlierTest];
else
pl6='';
end
if isfield(project.Preprocess,'Normalization')
pl7=['Normalization Method : ',project.Preprocess.Normalization];
else
pl7='';
end
if isfield(project.Preprocess,'Span')
if ~isempty(project.Preprocess.Span)
pl8=['Span (if LOWESS/LOESS methods chosen : ',project.Preprocess.Span];
else
pl8='';
end
else
pl8='';
end
if isfield(project.Preprocess,'Subgrid')
pl9=['Subgrid Normalization (if subgrid present) performed : ',project.Preprocess.Subgrid];
else
pl9='';
end
if isfield(project.Preprocess,'ChannelInfo')
pl10=['Channel - Dye correspondence : ',project.Preprocess.ChannelInfo];
else
pl10='';
end
if isfield(project.Preprocess,'SummarizeProbes')
if isfield(project.Preprocess.SummarizeProbes,'Summarize')
pl11=['Summarize same probes : ',project.Preprocess.SummarizeProbes.Summarize];
end
if isfield(project.Preprocess.SummarizeProbes,'Method')
pl12=['Summarize same probes with : ',project.Preprocess.SummarizeProbes.Method];
end
if isfield(project.Preprocess.SummarizeProbes,'When')
pl13=['Summarize same probes when : ',project.Preprocess.SummarizeProbes.When];
end
else
pl11='';pl12='';pl13='';
end
elseif soft==99 % Affy
if isfield(project.Preprocess,'BackgroundAdjustment')
pl1=['Background Adjustment method : ',project.Preprocess.BackgroundAdjustment];
else
pl1='';
end
if isfield(project.Preprocess,'BackgroundOptions')
pl2=['Background Adjustment Options : ',project.Preprocess.BackgroundOptions];
else
pl2='';
end
if isfield(project.Preprocess,'Normalization')
pl3=['Normalization method : ',project.Preprocess.Normalization];
else
pl3='';
end
if isfield(project.Preprocess,'NormalizationOptions')
pl4=['Normalization Options : ',project.Preprocess.NormalizationOptions];
else
pl4='';
end
if isfield(project.Preprocess,'Summarization')
pl5=['Summarization method : ',project.Preprocess.Summarization];
else
pl5='';
end
if isfield(project.Preprocess,'SummarizationOptions')
pl6=['Summarization Options : ',project.Preprocess.SummarizationOptions];
else
pl6='';
end
if isfield(project.Preprocess,'MAS5Filter')
pl7=['MAS5 Filter : ',project.Preprocess.MAS5Filter];
else
pl7='';
end
if isfield(project.Preprocess,'IQRFilter')
pl8=['IQR Filter : ',project.Preprocess.IQRFilter];
else
pl8='';
end
if isfield(project.Preprocess,'VarianceFilter')
pl9=['Variance Filter : ',project.Preprocess.VarianceFilter];
else
pl9='';
end
if isfield(project.Preprocess,'IntensityFilter')
pl10=['Intensity Filter : ',project.Preprocess.IntensityFilter];
else
pl10='';
end
if isfield(project.Preprocess,'CustomFilter')
pl11=['Custom Filter : ',project.Preprocess.CustomFilter];
else
pl11='';
end
if isfield(project.Preprocess,'OutlierTest')
pl12=['Outlier Detection test performed : ',project.Preprocess.OutlierTest];
else
pl12='';
end
pl13='';
elseif soft==98 % Illumina
pl1=''; pl2='';
if isfield(project.Preprocess,'Normalization')
pl3=['Normalization method : ',project.Preprocess.Normalization];
else
pl3='';
end
if isfield(project.Preprocess,'NormalizationOptions')
pl4=['Normalization Options : ',project.Preprocess.NormalizationOptions];
else
pl4='';
end
if isfield(project.Preprocess,'Summarization')
pl5=['Summarization method : ',project.Preprocess.Summarization];
else
pl5='';
end
if isfield(project.Preprocess,'SummarizationOptions')
pl6=['Summarization Options : ',project.Preprocess.SummarizationOptions];
else
pl6='';
end
if isfield(project.Preprocess,'DetFilter')
pl7=['Detection Filter : ',project.Preprocess.DetFilter];
else
pl7='';
end
if isfield(project.Preprocess,'IQRFilter')
pl8=['IQR Filter : ',project.Preprocess.IQRFilter];
else
pl8='';
end
if isfield(project.Preprocess,'VarianceFilter')
pl9=['Variance Filter : ',project.Preprocess.VarianceFilter];
else
pl9='';
end
if isfield(project.Preprocess,'IntensityFilter')
pl10=['Intensity Filter : ',project.Preprocess.IntensityFilter];
else
pl10='';
end
if isfield(project.Preprocess,'CustomFilter')
pl11=['Custom Filter : ',project.Preprocess.CustomFilter];
else
pl11='';
end
if isfield(project.Preprocess,'OutlierTest')
pl12=['Outlier Detection test performed : ',project.Preprocess.OutlierTest];
else
pl12='';
end
pl13='';
end
if isfield(analysis,'TotalBadpoints') && ~isempty(analysis.TotalBadpoints)
pl14='Number of poor spots for each slide of the Analysis : ';
index=0;
for i=1:analysis.numberOfConditions
for j=1:max(size(analysis.TotalBadpoints{i}))
index=index+1;
leg{index}=[analysis.exprp{i}{j},' : ',...
num2str(length(analysis.TotalBadpoints{i}{j}))];
end
end
else
pl14='';
leg='';
end
else
pl1='No Information on Preprocessing';
pl2='';pl3='';pl4='';pl5='';pl6='';pl7='';pl8='';pl9='';pl10='';pl11='';pl12='';pl13='';pl14='';leg='';
end
if isfield(project,'Preprocess') && isempty(project.Preprocess)
disp('5')
pl1='No Information on Preprocessing';
pl2='';pl3='';pl4='';pl5='';pl6='';pl7='';pl8='';pl9='';pl10='';pl11='';pl12='';pl13='';pl14='';leg='';
end
maintext=[maintext;'Preprocessing Information';'----------------------------------------';...
' ';pl1;pl2;pl3;pl4;pl5;pl6;pl7;pl8;pl9;pl10;pl11;pl12;pl13;' ';pl14;' ';...
char(leg);' ';' '];
% Statistical selection information
if isfield(project,'StatisticalSelection')
if isfield(project.StatisticalSelection,'BSN')
sl1=['Between Slide Normalization performed : ',project.StatisticalSelection.BSN];
else
sl1='';
end
if isfield(project.StatisticalSelection,'TF')
sl2=['Trust Factor threshold : ',project.StatisticalSelection.TF];
else
sl2='';
end
if isfield(project.StatisticalSelection,'ImputeMethod')
if str2double(project.StatisticalSelection.TF)~=1
sl3=['Missing Value Imputation method (if needed) : ',...
project.StatisticalSelection.ImputeMethod];
else
sl3='Missing Value Imputation method : Not required (TF=1)';
end
else
sl3='';
end
if isfield(project.StatisticalSelection,'Impute')
sl4=['Missing Value Imputation relative to BSN (if performed) : ',...
project.StatisticalSelection.Impute];
else
sl4='';
end
if isfield(project.StatisticalSelection,'Test')
sl5=['Statistical Test : ',project.StatisticalSelection.Test];
else
sl5='';
end
if isfield(project.StatisticalSelection,'Correction')
sl6=['Multiple Testing Correction procedure : ',project.StatisticalSelection.Correction];
else
sl6='';
end
if isfield(project.StatisticalSelection,'Cut')
sl7=['p-value or FDR threshold : ',num2str(project.StatisticalSelection.Cut)];
else
sl7='';
end
if isfield(project.StatisticalSelection,'DEGenes')
sl8=['Number of DE Genes : ',num2str(project.StatisticalSelection.DEGenes)];
else
sl8='';
end
else
sl1='No Information on Statistical Selection';
sl2='';sl3='';sl4='';sl5='';sl6='';sl7='';sl8='';
end
if isfield(project,'StatisticalSelection') && isempty(project.StatisticalSelection)
sl1='No Information on Statistical Selection';
sl2='';sl3='';sl4='';sl5='';sl6='';sl7='';sl8='';
end
maintext=[maintext;'Statistical Selection Information';...
'----------------------------------------';' ';...
sl1;sl2;sl3;sl4;sl5;sl6;sl7;sl8;' ';' '];
% Information on Clustering
if isfield(project,'Clustering')
if isfield(project.Clustering,'Algorithm')
cl1=['Clustering Algorithm used : ',project.Clustering.Algorithm];
else
cl1='';
end
if isfield(project.Clustering,'Linkage')
if ~isempty(project.Clustering.Linkage)
cl2=['Linkage method used : ',project.Clustering.Linkage];
else
cl2='';
end
else
cl2='';
end
if isfield(project.Clustering,'Distance')
cl3=['Distance metric used : ',project.Clustering.Distance];
else
cl3='';
end
if isfield(project.Clustering,'Limit')
cl4=['Cluster limit criterion : ',num2str(project.Clustering.Limit)];
else
cl4='';
end
if isfield(project.Clustering,'Seed')
cl5=['Initial seeds estimation : ',project.Clustering.Seed];
else
cl5='';
end
if isfield(project.Clustering,'PValue')
cl6=['DE Genes p-value cutoff for clustering : ',num2str(project.Clustering.PValue)];
else
cl6='';
end
if isfield(project.Clustering,'Limit')
cl7=['Number of Clusters formed : ',num2str(project.Clustering.Clusters)];
else
cl7='';
end
else
cl1='No Information on Clustering';
cl2='';cl3='';cl4='';cl5='';cl6='';cl7='';
end
if isfield(project,'Clustering') && isempty(project.Clustering)
cl1='No Information on Clustering';
cl2='';cl3='';cl4='';cl5='';cl6='';cl7='';
end
maintext=[maintext;'Clustering Information';...
'----------------------------------------';' ';...
cl1;cl2;cl3;cl4;cl5;cl6;cl7;' ';' '];
end
set(handles.reportMainEdit,'String',maintext,'Max',length(maintext))
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes AnalysisReport wait for user response (see UIRESUME)
uiwait(handles.AnalysisReport);
% --- Outputs from this function are returned to the command line.
function varargout = AnalysisReport_OutputFcn(hObject, eventdata, handles)
function reportMainEdit_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
function reportMainEdit_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --------------------------------------------------------------------
function rightClick_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function rightExport_Callback(hObject, eventdata, handles)
str=char(get(handles.reportMainEdit,'String'));
[filename,pathname]=uiputfile('*.txt','Export report');
if filename==0
return
else
line1='ARMADA v.2.0 Analysis Report';
line2=repmat('-',[1 50]);
line3=['INFORMATION ON ANALYSIS RUN ',num2str(handles.ind)];
line4=line2;
line5=['Created on ',datestr(now)];
line6=repmat('=',[1 50]);
fid=fopen(strcat(pathname,filename),'wt');
fprintf(fid,'%s\n',line1);
fprintf(fid,'%s\n',line2);
fprintf(fid,'%s\n',line3);
fprintf(fid,'%s\n',line4);
fprintf(fid,'%s\n',line5);
fprintf(fid,'%s\n',line6);
fprintf(fid,'\n\n');
for i=1:size(str,1)
fprintf(fid,'%s\n',str(i,:));
end
fclose(fid);
end
% --------------------------------------------------------------------
function rightClear_Callback(hObject, eventdata, handles)
set(handles.reportMainEdit,'String','')
% --- Executes on button press in okButton.
function okButton_Callback(hObject, eventdata, handles)
uiresume(handles.AnalysisReport);
delete(handles.AnalysisReport);
% HELP FUNCTIONS
function out = matfromcell(datab,tablen)
if nargin<2
tablen=4;
end
[m n]=size(datab);
len=zeros(m,n);
for i=1:m
for j=1:n
len(i,j)=length(datab{i,j});
end
end
maxlen=max(max(len));
% Preallocate and initialize out
out=char(m,n*(maxlen+tablen));
for i=1:size(out,1)
for j=1:size(out,2)
out(i,j)=' ';
end
end
% Fill out
for i=1:m
for j=1:n
temp=[datab{i,j} repmat(' ',[1 maxlen-length(datab{i,j})])];
for k=(j-1)*(maxlen+tablen)+1:(j-1)*(maxlen+tablen)+maxlen
out(i,k)=temp(k-(j-1)*(maxlen+tablen));
end
end
end
% Remove trailing spaces from the end of out
out=strtrim(out);