genevalidator 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.travis.yml +2 -0
  4. data/README.md +78 -30
  5. data/Rakefile +11 -8
  6. data/aux/app_template_footer.erb +1 -6
  7. data/aux/app_template_header.erb +12 -32
  8. data/aux/files/css/style.css +2 -8
  9. data/aux/files/js/plots.js +564 -576
  10. data/aux/files/js/script.js +10 -0
  11. data/aux/json_footer.erb +8 -0
  12. data/aux/json_header.erb +19 -0
  13. data/aux/json_query.erb +14 -0
  14. data/aux/template_footer.erb +9 -58
  15. data/aux/template_header.erb +18 -58
  16. data/aux/template_query.erb +8 -36
  17. data/bin/genevalidator +45 -32
  18. data/genevalidator.gemspec +11 -7
  19. data/lib/genevalidator.rb +75 -455
  20. data/lib/genevalidator/arg_validation.rb +78 -107
  21. data/lib/genevalidator/blast.rb +57 -60
  22. data/lib/genevalidator/clusterization.rb +15 -15
  23. data/lib/genevalidator/exceptions.rb +32 -5
  24. data/lib/genevalidator/get_raw_sequences.rb +70 -33
  25. data/lib/genevalidator/hsp.rb +1 -4
  26. data/lib/genevalidator/json_to_gv_results.rb +109 -0
  27. data/lib/genevalidator/output.rb +177 -185
  28. data/lib/genevalidator/pool.rb +2 -1
  29. data/lib/genevalidator/sequences.rb +3 -3
  30. data/lib/genevalidator/tabular_parser.rb +24 -18
  31. data/lib/genevalidator/validation.rb +279 -0
  32. data/lib/genevalidator/validation_alignment.rb +31 -47
  33. data/lib/genevalidator/validation_blast_reading_frame.rb +19 -18
  34. data/lib/genevalidator/validation_duplication.rb +23 -19
  35. data/lib/genevalidator/validation_gene_merge.rb +30 -65
  36. data/lib/genevalidator/validation_length_cluster.rb +14 -53
  37. data/lib/genevalidator/validation_length_rank.rb +10 -11
  38. data/lib/genevalidator/validation_open_reading_frame.rb +18 -19
  39. data/lib/genevalidator/validation_report.rb +2 -5
  40. data/lib/genevalidator/validation_test.rb +8 -4
  41. data/lib/genevalidator/version.rb +1 -1
  42. data/test/test_all_validations.rb +51 -66
  43. data/test/test_blast.rb +68 -51
  44. data/test/test_clusterization.rb +1 -1
  45. data/test/test_clusterization_2d.rb +19 -13
  46. data/test/test_extended_array_methods.rb +1 -1
  47. data/test/test_files/all_validations_mrna/mrna.blast_tab6 +1806 -0
  48. data/test/test_files/all_validations_mrna/mrna.blast_tab7 +1865 -0
  49. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml → mrna.blast_xml} +18642 -1
  50. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.index → mrna.blast_xml.index} +300 -0
  51. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta → mrna.fa} +0 -0
  52. data/test/test_files/all_validations_mrna/mrna.raw_seq +3970 -0
  53. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.raw_seq.idx → mrna.raw_seq.idx} +901 -1
  54. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_tab → prot.blast_tab6} +416 -0
  55. data/test/test_files/all_validations_prot/prot.blast_tab7 +2400 -0
  56. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml → prot.blast_xml} +18299 -6723
  57. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.index → prot.blast_xml.index} +408 -0
  58. data/test/test_files/all_validations_prot/{all_validations_prot.fasta → prot.fa} +0 -0
  59. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq → prot.raw_seq} +2735 -0
  60. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq.idx → prot.raw_seq.idx} +3032 -1808
  61. data/test/test_sequences.rb +46 -41
  62. data/test/test_validation_open_reading_frame.rb +318 -202
  63. data/test/test_validations.rb +48 -32
  64. metadata +76 -102
  65. data/doc/AliasDuplicationError.html +0 -134
  66. data/doc/AlignmentValidation.html +0 -1687
  67. data/doc/AlignmentValidationOutput.html +0 -659
  68. data/doc/Blast.html +0 -1905
  69. data/doc/BlastRFValidationOutput.html +0 -545
  70. data/doc/BlastReadingFrameValidation.html +0 -370
  71. data/doc/BlastUtils.html +0 -875
  72. data/doc/ClasspathError.html +0 -134
  73. data/doc/Cluster.html +0 -1316
  74. data/doc/DuplciationValidationOutput.html +0 -564
  75. data/doc/DuplicationValidation.html +0 -920
  76. data/doc/DuplicationValidationOutput.html +0 -564
  77. data/doc/FileNotFoundException.html +0 -134
  78. data/doc/GeneMergeValidation.html +0 -935
  79. data/doc/GeneMergeValidationOutput.html +0 -652
  80. data/doc/HierarchicalClusterization.html +0 -994
  81. data/doc/Hsp.html +0 -1485
  82. data/doc/InconsistentTabularFormat.html +0 -135
  83. data/doc/LengthClusterValidation.html +0 -982
  84. data/doc/LengthClusterValidationOutput.html +0 -515
  85. data/doc/LengthRankValidation.html +0 -496
  86. data/doc/LengthRankValidationOutput.html +0 -517
  87. data/doc/NoInternetError.html +0 -135
  88. data/doc/NoMafftInstallationError.html +0 -134
  89. data/doc/NoPIdentError.html +0 -134
  90. data/doc/NoValidationError.html +0 -134
  91. data/doc/NotEnoughHitsError.html +0 -135
  92. data/doc/ORFValidationOutput.html +0 -593
  93. data/doc/OpenReadingFrameValidation.html +0 -1107
  94. data/doc/OtherError.html +0 -123
  95. data/doc/Output.html +0 -1540
  96. data/doc/Pair.html +0 -309
  97. data/doc/PairCluster.html +0 -767
  98. data/doc/Plot.html +0 -837
  99. data/doc/QueryError.html +0 -134
  100. data/doc/ReportClassError.html +0 -135
  101. data/doc/Sequence.html +0 -1299
  102. data/doc/SequenceTypeError.html +0 -135
  103. data/doc/TabularEntry.html +0 -837
  104. data/doc/TabularParser.html +0 -1104
  105. data/doc/Validation.html +0 -2147
  106. data/doc/ValidationClassError.html +0 -134
  107. data/doc/ValidationOutput.html +0 -460
  108. data/doc/ValidationReport.html +0 -940
  109. data/doc/ValidationTest.html +0 -939
  110. data/doc/_index.html +0 -449
  111. data/doc/class_list.html +0 -54
  112. data/doc/css/common.css +0 -1
  113. data/doc/css/full_list.css +0 -57
  114. data/doc/css/style.css +0 -338
  115. data/doc/file.README.html +0 -151
  116. data/doc/file_list.html +0 -56
  117. data/doc/frames.html +0 -26
  118. data/doc/index.html +0 -151
  119. data/doc/js/app.js +0 -214
  120. data/doc/js/full_list.js +0 -178
  121. data/doc/js/jquery.js +0 -4
  122. data/doc/method_list.html +0 -1505
  123. data/doc/top-level-namespace.html +0 -112
  124. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab +0 -967
  125. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.index +0 -967
  126. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq +0 -4929
  127. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq.idx +0 -1006
  128. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_xml.raw_seq +0 -2075
  129. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.index +0 -1864
  130. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq +0 -42411
  131. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq.idx +0 -3751
@@ -1,123 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Exception: OtherError
8
-
9
- &mdash; Documentation by YARD 0.8.7.2
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="_index.html">Index (O)</a> &raquo;
35
-
36
-
37
- <span class="title">OtherError</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Exception: OtherError
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Exception</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">Exception</li>
82
-
83
- <li class="next">OtherError</li>
84
-
85
- </ul>
86
- <a href="#" class="inheritanceTree">show all</a>
87
-
88
- </dd>
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- <dt class="r2 last">Defined in:</dt>
99
- <dd class="r2 last">lib/genevalidator/exceptions.rb</dd>
100
-
101
- </dl>
102
- <div class="clear"></div>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- </div>
115
-
116
- <div id="footer">
117
- Generated on Sat Sep 28 07:01:32 2013 by
118
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
- 0.8.7.2 (ruby-1.9.3).
120
- </div>
121
-
122
- </body>
123
- </html>
@@ -1,1540 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Class: Output
8
-
9
- &mdash; Documentation by YARD 0.8.7.2
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="_index.html">Index (O)</a> &raquo;
35
-
36
-
37
- <span class="title">Output</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Class: Output
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Object</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">Output</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/genevalidator/output.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
-
103
-
104
-
105
-
106
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
- <ul class="summary">
108
-
109
- <li class="public ">
110
- <span class="summary_signature">
111
-
112
- <a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- <span class="summary_desc"><div class='inline'>
130
- <p>Returns the value of attribute filename.</p>
131
- </div></span>
132
-
133
- </li>
134
-
135
-
136
- <li class="public ">
137
- <span class="summary_signature">
138
-
139
- <a href="#html_path-instance_method" title="#html_path (instance method)">- (Object) <strong>html_path</strong> </a>
140
-
141
-
142
-
143
- </span>
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
- <span class="summary_desc"><div class='inline'>
157
- <p>Returns the value of attribute html_path.</p>
158
- </div></span>
159
-
160
- </li>
161
-
162
-
163
- <li class="public ">
164
- <span class="summary_signature">
165
-
166
- <a href="#idx-instance_method" title="#idx (instance method)">- (Object) <strong>idx</strong> </a>
167
-
168
-
169
-
170
- </span>
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
- <span class="summary_desc"><div class='inline'>
184
- <p>Returns the value of attribute idx.</p>
185
- </div></span>
186
-
187
- </li>
188
-
189
-
190
- <li class="public ">
191
- <span class="summary_signature">
192
-
193
- <a href="#nr_hits-instance_method" title="#nr_hits (instance method)">- (Object) <strong>nr_hits</strong> </a>
194
-
195
-
196
-
197
- </span>
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
- <span class="summary_desc"><div class='inline'>
211
- <p>Returns the value of attribute nr_hits.</p>
212
- </div></span>
213
-
214
- </li>
215
-
216
-
217
- <li class="public ">
218
- <span class="summary_signature">
219
-
220
- <a href="#prediction_def-instance_method" title="#prediction_def (instance method)">- (Object) <strong>prediction_def</strong> </a>
221
-
222
-
223
-
224
- </span>
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
- <span class="summary_desc"><div class='inline'>
238
- <p>Returns the value of attribute prediction_def.</p>
239
- </div></span>
240
-
241
- </li>
242
-
243
-
244
- <li class="public ">
245
- <span class="summary_signature">
246
-
247
- <a href="#prediction_len-instance_method" title="#prediction_len (instance method)">- (Object) <strong>prediction_len</strong> </a>
248
-
249
-
250
-
251
- </span>
252
-
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
- <span class="summary_desc"><div class='inline'>
265
- <p>Returns the value of attribute prediction_len.</p>
266
- </div></span>
267
-
268
- </li>
269
-
270
-
271
- <li class="public ">
272
- <span class="summary_signature">
273
-
274
- <a href="#start_idx-instance_method" title="#start_idx (instance method)">- (Object) <strong>start_idx</strong> </a>
275
-
276
-
277
-
278
- </span>
279
-
280
-
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
- <span class="summary_desc"><div class='inline'>
292
- <p>Returns the value of attribute start_idx.</p>
293
- </div></span>
294
-
295
- </li>
296
-
297
-
298
- <li class="public ">
299
- <span class="summary_signature">
300
-
301
- <a href="#validations-instance_method" title="#validations (instance method)">- (Object) <strong>validations</strong> </a>
302
-
303
-
304
-
305
- </span>
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
- <span class="summary_desc"><div class='inline'>
319
- <p>list of <tt>ValidationReport</tt> objects.</p>
320
- </div></span>
321
-
322
- </li>
323
-
324
-
325
- <li class="public ">
326
- <span class="summary_signature">
327
-
328
- <a href="#yaml_path-instance_method" title="#yaml_path (instance method)">- (Object) <strong>yaml_path</strong> </a>
329
-
330
-
331
-
332
- </span>
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
- <span class="summary_desc"><div class='inline'>
346
- <p>Returns the value of attribute yaml_path.</p>
347
- </div></span>
348
-
349
- </li>
350
-
351
-
352
- </ul>
353
-
354
-
355
-
356
-
357
-
358
- <h2>
359
- Class Method Summary
360
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
361
- </h2>
362
-
363
- <ul class="summary">
364
-
365
- <li class="public ">
366
- <span class="summary_signature">
367
-
368
- <a href="#overall_evaluation-class_method" title="overall_evaluation (class method)">+ (Object) <strong>overall_evaluation</strong>(all_query_outputs) </a>
369
-
370
-
371
-
372
- </span>
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
- <span class="summary_desc"><div class='inline'>
383
- <p>Calculates an overall evaluation of the output Params:
384
- <tt>all_query_outputs</tt>: Array of <tt>ValidationTest</tt> objects Output
385
- Array of Strigs with the reports.</p>
386
- </div></span>
387
-
388
- </li>
389
-
390
-
391
- <li class="public ">
392
- <span class="summary_signature">
393
-
394
- <a href="#print_footer-class_method" title="print_footer (class method)">+ (Object) <strong>print_footer</strong>(all_query_outputs, html_path) </a>
395
-
396
-
397
-
398
- </span>
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
- <span class="summary_desc"><div class='inline'>
409
- <p>Class that closes the gas in the html file and writes the overall
410
- evaluation Param: <tt>all_query_outputs</tt>: array with
411
- <tt>ValidationTest</tt> objects <tt>html_path</tt>: path of the html
412
- folder.</p>
413
- </div></span>
414
-
415
- </li>
416
-
417
-
418
- </ul>
419
-
420
- <h2>
421
- Instance Method Summary
422
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
423
- </h2>
424
-
425
- <ul class="summary">
426
-
427
- <li class="public ">
428
- <span class="summary_signature">
429
-
430
- <a href="#generate_html-instance_method" title="#generate_html (instance method)">- (Object) <strong>generate_html</strong> </a>
431
-
432
-
433
-
434
- </span>
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
- <span class="summary_desc"><div class='inline'></div></span>
445
-
446
- </li>
447
-
448
-
449
- <li class="public ">
450
- <span class="summary_signature">
451
-
452
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Output) <strong>initialize</strong>(filename, html_path, yaml_path, idx = 0, start_idx = 0) </a>
453
-
454
-
455
-
456
- </span>
457
-
458
-
459
- <span class="note title constructor">constructor</span>
460
-
461
-
462
-
463
-
464
-
465
-
466
-
467
-
468
- <span class="summary_desc"><div class='inline'>
469
- <p>Initilizes the object Params: <tt>filename</tt>: name of the fasta input
470
- file <tt>html_path</tt>: path of the html folder <tt>yaml_path</tt>: path
471
- where the yaml output wil be saved <tt>idx</tt>: idnex of the current query
472
- <tt>start_idx</tt>: number of the sequence from the file to start with.</p>
473
- </div></span>
474
-
475
- </li>
476
-
477
-
478
- <li class="public ">
479
- <span class="summary_signature">
480
-
481
- <a href="#print_output_console-instance_method" title="#print_output_console (instance method)">- (Object) <strong>print_output_console</strong> </a>
482
-
483
-
484
-
485
- </span>
486
-
487
-
488
-
489
-
490
-
491
-
492
-
493
-
494
-
495
- <span class="summary_desc"><div class='inline'></div></span>
496
-
497
- </li>
498
-
499
-
500
- <li class="public ">
501
- <span class="summary_signature">
502
-
503
- <a href="#print_output_file_yaml-instance_method" title="#print_output_file_yaml (instance method)">- (Object) <strong>print_output_file_yaml</strong> </a>
504
-
505
-
506
-
507
- </span>
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
-
516
-
517
- <span class="summary_desc"><div class='inline'></div></span>
518
-
519
- </li>
520
-
521
-
522
- </ul>
523
-
524
-
525
- <div id="constructor_details" class="method_details_list">
526
- <h2>Constructor Details</h2>
527
-
528
- <div class="method_details first">
529
- <h3 class="signature first" id="initialize-instance_method">
530
-
531
- - (<tt><span class='object_link'><a href="" title="Output (class)">Output</a></span></tt>) <strong>initialize</strong>(filename, html_path, yaml_path, idx = 0, start_idx = 0)
532
-
533
-
534
-
535
-
536
-
537
- </h3><div class="docstring">
538
- <div class="discussion">
539
-
540
- <p>Initilizes the object Params: <tt>filename</tt>: name of the fasta input
541
- file <tt>html_path</tt>: path of the html folder <tt>yaml_path</tt>: path
542
- where the yaml output wil be saved <tt>idx</tt>: idnex of the current query
543
- <tt>start_idx</tt>: number of the sequence from the file to start with</p>
544
-
545
-
546
- </div>
547
- </div>
548
- <div class="tags">
549
-
550
-
551
- </div><table class="source_code">
552
- <tr>
553
- <td>
554
- <pre class="lines">
555
-
556
-
557
- 28
558
- 29
559
- 30
560
- 31
561
- 32
562
- 33
563
- 34
564
- 35
565
- 36
566
- 37
567
- 38
568
- 39
569
- 40</pre>
570
- </td>
571
- <td>
572
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 28</span>
573
-
574
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_html_path'>html_path</span><span class='comma'>,</span> <span class='id identifier rubyid_yaml_path'>yaml_path</span><span class='comma'>,</span> <span class='id identifier rubyid_idx'>idx</span> <span class='op'>=</span> <span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_start_idx'>start_idx</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
575
-
576
- <span class='ivar'>@prediction_len</span> <span class='op'>=</span> <span class='int'>0</span>
577
- <span class='ivar'>@prediction_def</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>no_definition</span><span class='tstring_end'>&quot;</span></span>
578
- <span class='ivar'>@nr_hits</span> <span class='op'>=</span> <span class='int'>0</span>
579
-
580
- <span class='ivar'>@filename</span> <span class='op'>=</span> <span class='id identifier rubyid_filename'>filename</span>
581
- <span class='ivar'>@html_path</span> <span class='op'>=</span> <span class='id identifier rubyid_html_path'>html_path</span>
582
- <span class='ivar'>@yaml_path</span> <span class='op'>=</span> <span class='id identifier rubyid_yaml_path'>yaml_path</span>
583
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='id identifier rubyid_idx'>idx</span>
584
- <span class='ivar'>@start_idx</span> <span class='op'>=</span> <span class='id identifier rubyid_start_idx'>start_idx</span>
585
-
586
- <span class='kw'>end</span></pre>
587
- </td>
588
- </tr>
589
- </table>
590
- </div>
591
-
592
- </div>
593
-
594
- <div id="instance_attr_details" class="attr_details">
595
- <h2>Instance Attribute Details</h2>
596
-
597
-
598
- <span id="filename=-instance_method"></span>
599
- <div class="method_details first">
600
- <h3 class="signature first" id="filename-instance_method">
601
-
602
- - (<tt>Object</tt>) <strong>filename</strong>
603
-
604
-
605
-
606
-
607
-
608
- </h3><div class="docstring">
609
- <div class="discussion">
610
-
611
- <p>Returns the value of attribute filename</p>
612
-
613
-
614
- </div>
615
- </div>
616
- <div class="tags">
617
-
618
-
619
- </div><table class="source_code">
620
- <tr>
621
- <td>
622
- <pre class="lines">
623
-
624
-
625
- 14
626
- 15
627
- 16</pre>
628
- </td>
629
- <td>
630
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 14</span>
631
-
632
- <span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
633
- <span class='ivar'>@filename</span>
634
- <span class='kw'>end</span></pre>
635
- </td>
636
- </tr>
637
- </table>
638
- </div>
639
-
640
-
641
- <span id="html_path=-instance_method"></span>
642
- <div class="method_details ">
643
- <h3 class="signature " id="html_path-instance_method">
644
-
645
- - (<tt>Object</tt>) <strong>html_path</strong>
646
-
647
-
648
-
649
-
650
-
651
- </h3><div class="docstring">
652
- <div class="discussion">
653
-
654
- <p>Returns the value of attribute html_path</p>
655
-
656
-
657
- </div>
658
- </div>
659
- <div class="tags">
660
-
661
-
662
- </div><table class="source_code">
663
- <tr>
664
- <td>
665
- <pre class="lines">
666
-
667
-
668
- 15
669
- 16
670
- 17</pre>
671
- </td>
672
- <td>
673
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 15</span>
674
-
675
- <span class='kw'>def</span> <span class='id identifier rubyid_html_path'>html_path</span>
676
- <span class='ivar'>@html_path</span>
677
- <span class='kw'>end</span></pre>
678
- </td>
679
- </tr>
680
- </table>
681
- </div>
682
-
683
-
684
- <span id="idx=-instance_method"></span>
685
- <div class="method_details ">
686
- <h3 class="signature " id="idx-instance_method">
687
-
688
- - (<tt>Object</tt>) <strong>idx</strong>
689
-
690
-
691
-
692
-
693
-
694
- </h3><div class="docstring">
695
- <div class="discussion">
696
-
697
- <p>Returns the value of attribute idx</p>
698
-
699
-
700
- </div>
701
- </div>
702
- <div class="tags">
703
-
704
-
705
- </div><table class="source_code">
706
- <tr>
707
- <td>
708
- <pre class="lines">
709
-
710
-
711
- 17
712
- 18
713
- 19</pre>
714
- </td>
715
- <td>
716
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 17</span>
717
-
718
- <span class='kw'>def</span> <span class='id identifier rubyid_idx'>idx</span>
719
- <span class='ivar'>@idx</span>
720
- <span class='kw'>end</span></pre>
721
- </td>
722
- </tr>
723
- </table>
724
- </div>
725
-
726
-
727
- <span id="nr_hits=-instance_method"></span>
728
- <div class="method_details ">
729
- <h3 class="signature " id="nr_hits-instance_method">
730
-
731
- - (<tt>Object</tt>) <strong>nr_hits</strong>
732
-
733
-
734
-
735
-
736
-
737
- </h3><div class="docstring">
738
- <div class="discussion">
739
-
740
- <p>Returns the value of attribute nr_hits</p>
741
-
742
-
743
- </div>
744
- </div>
745
- <div class="tags">
746
-
747
-
748
- </div><table class="source_code">
749
- <tr>
750
- <td>
751
- <pre class="lines">
752
-
753
-
754
- 9
755
- 10
756
- 11</pre>
757
- </td>
758
- <td>
759
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 9</span>
760
-
761
- <span class='kw'>def</span> <span class='id identifier rubyid_nr_hits'>nr_hits</span>
762
- <span class='ivar'>@nr_hits</span>
763
- <span class='kw'>end</span></pre>
764
- </td>
765
- </tr>
766
- </table>
767
- </div>
768
-
769
-
770
- <span id="prediction_def=-instance_method"></span>
771
- <div class="method_details ">
772
- <h3 class="signature " id="prediction_def-instance_method">
773
-
774
- - (<tt>Object</tt>) <strong>prediction_def</strong>
775
-
776
-
777
-
778
-
779
-
780
- </h3><div class="docstring">
781
- <div class="discussion">
782
-
783
- <p>Returns the value of attribute prediction_def</p>
784
-
785
-
786
- </div>
787
- </div>
788
- <div class="tags">
789
-
790
-
791
- </div><table class="source_code">
792
- <tr>
793
- <td>
794
- <pre class="lines">
795
-
796
-
797
- 8
798
- 9
799
- 10</pre>
800
- </td>
801
- <td>
802
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 8</span>
803
-
804
- <span class='kw'>def</span> <span class='id identifier rubyid_prediction_def'>prediction_def</span>
805
- <span class='ivar'>@prediction_def</span>
806
- <span class='kw'>end</span></pre>
807
- </td>
808
- </tr>
809
- </table>
810
- </div>
811
-
812
-
813
- <span id="prediction_len=-instance_method"></span>
814
- <div class="method_details ">
815
- <h3 class="signature " id="prediction_len-instance_method">
816
-
817
- - (<tt>Object</tt>) <strong>prediction_len</strong>
818
-
819
-
820
-
821
-
822
-
823
- </h3><div class="docstring">
824
- <div class="discussion">
825
-
826
- <p>Returns the value of attribute prediction_len</p>
827
-
828
-
829
- </div>
830
- </div>
831
- <div class="tags">
832
-
833
-
834
- </div><table class="source_code">
835
- <tr>
836
- <td>
837
- <pre class="lines">
838
-
839
-
840
- 7
841
- 8
842
- 9</pre>
843
- </td>
844
- <td>
845
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 7</span>
846
-
847
- <span class='kw'>def</span> <span class='id identifier rubyid_prediction_len'>prediction_len</span>
848
- <span class='ivar'>@prediction_len</span>
849
- <span class='kw'>end</span></pre>
850
- </td>
851
- </tr>
852
- </table>
853
- </div>
854
-
855
-
856
- <span id="start_idx=-instance_method"></span>
857
- <div class="method_details ">
858
- <h3 class="signature " id="start_idx-instance_method">
859
-
860
- - (<tt>Object</tt>) <strong>start_idx</strong>
861
-
862
-
863
-
864
-
865
-
866
- </h3><div class="docstring">
867
- <div class="discussion">
868
-
869
- <p>Returns the value of attribute start_idx</p>
870
-
871
-
872
- </div>
873
- </div>
874
- <div class="tags">
875
-
876
-
877
- </div><table class="source_code">
878
- <tr>
879
- <td>
880
- <pre class="lines">
881
-
882
-
883
- 18
884
- 19
885
- 20</pre>
886
- </td>
887
- <td>
888
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 18</span>
889
-
890
- <span class='kw'>def</span> <span class='id identifier rubyid_start_idx'>start_idx</span>
891
- <span class='ivar'>@start_idx</span>
892
- <span class='kw'>end</span></pre>
893
- </td>
894
- </tr>
895
- </table>
896
- </div>
897
-
898
-
899
- <span id="validations=-instance_method"></span>
900
- <div class="method_details ">
901
- <h3 class="signature " id="validations-instance_method">
902
-
903
- - (<tt>Object</tt>) <strong>validations</strong>
904
-
905
-
906
-
907
-
908
-
909
- </h3><div class="docstring">
910
- <div class="discussion">
911
-
912
- <p>list of <tt>ValidationReport</tt> objects</p>
913
-
914
-
915
- </div>
916
- </div>
917
- <div class="tags">
918
-
919
-
920
- </div><table class="source_code">
921
- <tr>
922
- <td>
923
- <pre class="lines">
924
-
925
-
926
- 12
927
- 13
928
- 14</pre>
929
- </td>
930
- <td>
931
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 12</span>
932
-
933
- <span class='kw'>def</span> <span class='id identifier rubyid_validations'>validations</span>
934
- <span class='ivar'>@validations</span>
935
- <span class='kw'>end</span></pre>
936
- </td>
937
- </tr>
938
- </table>
939
- </div>
940
-
941
-
942
- <span id="yaml_path=-instance_method"></span>
943
- <div class="method_details ">
944
- <h3 class="signature " id="yaml_path-instance_method">
945
-
946
- - (<tt>Object</tt>) <strong>yaml_path</strong>
947
-
948
-
949
-
950
-
951
-
952
- </h3><div class="docstring">
953
- <div class="discussion">
954
-
955
- <p>Returns the value of attribute yaml_path</p>
956
-
957
-
958
- </div>
959
- </div>
960
- <div class="tags">
961
-
962
-
963
- </div><table class="source_code">
964
- <tr>
965
- <td>
966
- <pre class="lines">
967
-
968
-
969
- 16
970
- 17
971
- 18</pre>
972
- </td>
973
- <td>
974
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 16</span>
975
-
976
- <span class='kw'>def</span> <span class='id identifier rubyid_yaml_path'>yaml_path</span>
977
- <span class='ivar'>@yaml_path</span>
978
- <span class='kw'>end</span></pre>
979
- </td>
980
- </tr>
981
- </table>
982
- </div>
983
-
984
- </div>
985
-
986
-
987
- <div id="class_method_details" class="method_details_list">
988
- <h2>Class Method Details</h2>
989
-
990
-
991
- <div class="method_details first">
992
- <h3 class="signature first" id="overall_evaluation-class_method">
993
-
994
- + (<tt>Object</tt>) <strong>overall_evaluation</strong>(all_query_outputs)
995
-
996
-
997
-
998
-
999
-
1000
- </h3><div class="docstring">
1001
- <div class="discussion">
1002
-
1003
- <p>Calculates an overall evaluation of the output Params:
1004
- <tt>all_query_outputs</tt>: Array of <tt>ValidationTest</tt> objects Output
1005
- Array of Strigs with the reports</p>
1006
-
1007
-
1008
- </div>
1009
- </div>
1010
- <div class="tags">
1011
-
1012
-
1013
- </div><table class="source_code">
1014
- <tr>
1015
- <td>
1016
- <pre class="lines">
1017
-
1018
-
1019
- 148
1020
- 149
1021
- 150
1022
- 151
1023
- 152
1024
- 153
1025
- 154
1026
- 155
1027
- 156
1028
- 157
1029
- 158
1030
- 159
1031
- 160
1032
- 161
1033
- 162
1034
- 163
1035
- 164
1036
- 165
1037
- 166
1038
- 167
1039
- 168
1040
- 169
1041
- 170
1042
- 171
1043
- 172
1044
- 173
1045
- 174
1046
- 175
1047
- 176
1048
- 177
1049
- 178
1050
- 179
1051
- 180
1052
- 181
1053
- 182
1054
- 183
1055
- 184
1056
- 185
1057
- 186
1058
- 187
1059
- 188
1060
- 189
1061
- 190
1062
- 191
1063
- 192
1064
- 193
1065
- 194
1066
- 195
1067
- 196
1068
- 197
1069
- 198
1070
- 199
1071
- 200
1072
- 201
1073
- 202
1074
- 203
1075
- 204
1076
- 205
1077
- 206
1078
- 207
1079
- 208
1080
- 209
1081
- 210
1082
- 211
1083
- 212
1084
- 213
1085
- 214
1086
- 215
1087
- 216
1088
- 217
1089
- 218
1090
- 219
1091
- 220
1092
- 221
1093
- 222
1094
- 223
1095
- 224
1096
- 225
1097
- 226
1098
- 227
1099
- 228
1100
- 229
1101
- 230
1102
- 231
1103
- 232
1104
- 233
1105
- 234
1106
- 235
1107
- 236
1108
- 237
1109
- 238
1110
- 239
1111
- 240
1112
- 241
1113
- 242
1114
- 243
1115
- 244
1116
- 245
1117
- 246
1118
- 247
1119
- 248
1120
- 249
1121
- 250
1122
- 251
1123
- 252</pre>
1124
- </td>
1125
- <td>
1126
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 148</span>
1127
-
1128
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span><span class='lparen'>(</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='rparen'>)</span>
1129
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1130
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Query score evaluation:</span><span class='tstring_end'>&quot;</span></span>
1131
-
1132
- <span class='comment'># count the cases of &quot;not enough evidence&quot;
1133
- </span> <span class='id identifier rubyid_no_evidence'>no_evidence</span> <span class='op'>=</span> <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_report'>report</span><span class='op'>|</span>
1134
- <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='symbol'>:unapplicable</span> <span class='kw'>or</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='symbol'>:warning</span><span class='rbrace'>}</span> <span class='op'>==</span> <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1135
- <span class='rbrace'>}</span>
1136
-
1137
- <span class='comment'># print at the console
1138
- </span> <span class='id identifier rubyid_scores'>scores</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1139
- <span class='id identifier rubyid_no_mafft'>no_mafft</span> <span class='op'>=</span> <span class='int'>0</span>
1140
- <span class='id identifier rubyid_no_internet'>no_internet</span> <span class='op'>=</span> <span class='int'>0</span>
1141
-
1142
- <span class='comment'># how many genes are good
1143
- </span> <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_report'>report</span><span class='op'>|</span>
1144
- <span class='id identifier rubyid_successes'>successes</span> <span class='op'>=</span> <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_expected'>expected</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
1145
- <span class='id identifier rubyid_fails'>fails</span> <span class='op'>=</span> <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:unapplicable</span> <span class='kw'>and</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:error</span> <span class='kw'>and</span>
1146
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>!=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_expected'>expected</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
1147
- <span class='id identifier rubyid_overall_score'>overall_score</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_successes'>successes</span><span class='op'>*</span><span class='int'>100</span><span class='op'>/</span><span class='lparen'>(</span><span class='id identifier rubyid_successes'>successes</span> <span class='op'>+</span> <span class='id identifier rubyid_fails'>fails</span> <span class='op'>+</span> <span class='float'>0.0</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
1148
- <span class='id identifier rubyid_scores'>scores</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_overall_score'>overall_score</span>
1149
-
1150
- <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1151
- <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span> <span class='op'>!=</span> <span class='kw'>nil</span>
1152
- <span class='id identifier rubyid_no_mafft'>no_mafft</span> <span class='op'>+=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span> <span class='op'>==</span> <span class='const'>NoMafftInstallationError</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1153
- <span class='kw'>end</span>
1154
- <span class='kw'>end</span>
1155
-
1156
- <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1157
- <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span> <span class='op'>!=</span> <span class='kw'>nil</span>
1158
- <span class='id identifier rubyid_no_internet'>no_internet</span> <span class='op'>+=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span> <span class='op'>==</span> <span class='const'>NoInternetError</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1159
- <span class='kw'>end</span>
1160
- <span class='kw'>end</span>
1161
- <span class='kw'>end</span>
1162
-
1163
- <span class='id identifier rubyid_good_scores'>good_scores</span> <span class='op'>=</span> <span class='id identifier rubyid_scores'>scores</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span> <span class='op'>&gt;</span> <span class='int'>75</span><span class='rbrace'>}</span>
1164
- <span class='id identifier rubyid_bad_scores'>bad_scores</span> <span class='op'>=</span> <span class='id identifier rubyid_scores'>scores</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='id identifier rubyid_good_scores'>good_scores</span>
1165
-
1166
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nThere were validated </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rbrace'>}</span><span class='tstring_content'> predictions from which:</span><span class='tstring_end'>&quot;</span></span>
1167
- <span class='kw'>if</span> <span class='id identifier rubyid_good_scores'>good_scores</span> <span class='op'>==</span> <span class='int'>1</span>
1168
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nOne good prediction</span><span class='tstring_end'>&quot;</span></span>
1169
- <span class='kw'>else</span>
1170
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_good_scores'>good_scores</span><span class='rbrace'>}</span><span class='tstring_content'> are good predictions</span><span class='tstring_end'>&quot;</span></span>
1171
- <span class='kw'>end</span>
1172
- <span class='kw'>if</span> <span class='id identifier rubyid_bad_scores'>bad_scores</span> <span class='op'>==</span> <span class='int'>1</span>
1173
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nOne possibly weak prediction</span><span class='tstring_end'>&quot;</span></span>
1174
- <span class='kw'>else</span>
1175
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_bad_scores'>bad_scores</span><span class='rbrace'>}</span><span class='tstring_content'> are possibly weak predictions</span><span class='tstring_end'>&quot;</span></span>
1176
- <span class='kw'>end</span>
1177
-
1178
- <span class='kw'>if</span> <span class='id identifier rubyid_no_evidence'>no_evidence</span> <span class='op'>!=</span> <span class='int'>0</span>
1179
- <span class='id identifier rubyid_score_evaluation'>score_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_no_evidence'>no_evidence</span><span class='rbrace'>}</span><span class='tstring_content'> of them couldn't be evaluated because of low evidence</span><span class='tstring_end'>&quot;</span></span>
1180
- <span class='kw'>end</span>
1181
-
1182
- <span class='id identifier rubyid_error_evaluation'>error_evaluation</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1183
- <span class='comment'># errors per validation
1184
- </span> <span class='id identifier rubyid_validations'>validations</span> <span class='op'>=</span> <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span>
1185
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
1186
- <span class='id identifier rubyid_no_errors'>no_errors</span> <span class='op'>=</span> <span class='int'>0</span>
1187
- <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_report'>report</span><span class='op'>|</span>
1188
- <span class='kw'>if</span> <span class='id identifier rubyid_report'>report</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>==</span> <span class='symbol'>:error</span>
1189
- <span class='id identifier rubyid_no_errors'>no_errors</span> <span class='op'>+=</span> <span class='int'>1</span>
1190
- <span class='kw'>end</span>
1191
- <span class='kw'>end</span>
1192
- <span class='kw'>if</span> <span class='id identifier rubyid_no_errors'>no_errors</span> <span class='op'>!=</span> <span class='int'>0</span>
1193
- <span class='id identifier rubyid_error_evaluation'>error_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nWe couldn't run </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_short_header'>short_header</span><span class='rbrace'>}</span><span class='tstring_content'> Validation for </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_no_errors'>no_errors</span><span class='rbrace'>}</span><span class='tstring_content'> queries</span><span class='tstring_end'>&quot;</span></span>
1194
- <span class='kw'>end</span>
1195
- <span class='kw'>end</span>
1196
-
1197
- <span class='kw'>if</span> <span class='id identifier rubyid_no_mafft'>no_mafft</span> <span class='op'>&gt;=</span> <span class='lparen'>(</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='id identifier rubyid_no_evidence'>no_evidence</span><span class='rparen'>)</span>
1198
- <span class='id identifier rubyid_error_evaluation'>error_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nWe couldn't run MAFFT multiple alignment</span><span class='tstring_end'>&quot;</span></span>
1199
- <span class='kw'>end</span>
1200
- <span class='kw'>if</span> <span class='id identifier rubyid_no_internet'>no_internet</span> <span class='op'>&gt;=</span> <span class='lparen'>(</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='id identifier rubyid_no_evidence'>no_evidence</span><span class='rparen'>)</span>
1201
- <span class='id identifier rubyid_error_evaluation'>error_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nWe couldn't make use of your internet connection</span><span class='tstring_end'>&quot;</span></span>
1202
- <span class='kw'>end</span>
1203
-
1204
- <span class='comment'># Running time statistics
1205
- </span> <span class='id identifier rubyid_running_times'>running_times</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1206
- <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1207
- <span class='id identifier rubyid_running_times'>running_times</span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_short_header'>short_header</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1208
- <span class='kw'>end</span>
1209
-
1210
- <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_output'>output</span><span class='op'>|</span>
1211
- <span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1212
- <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_running_time'>running_time</span> <span class='op'>!=</span> <span class='int'>0</span> <span class='kw'>and</span>
1213
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_running_time'>running_time</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span>
1214
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:unapplicable</span> <span class='kw'>and</span>
1215
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:error</span>
1216
- <span class='id identifier rubyid_running_times'>running_times</span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_short_header'>short_header</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_running_time'>running_time</span>
1217
- <span class='kw'>end</span>
1218
- <span class='kw'>end</span>
1219
- <span class='kw'>end</span>
1220
-
1221
- <span class='id identifier rubyid_time_evaluation'>time_evaluation</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1222
- <span class='id identifier rubyid_time_evaluation'>time_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nRunning Time:</span><span class='tstring_end'>&quot;</span></span>
1223
- <span class='id identifier rubyid_running_times'>running_times</span> <span class='op'>=</span> <span class='id identifier rubyid_running_times'>running_times</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>!=</span><span class='int'>0</span><span class='rbrace'>}</span>
1224
- <span class='id identifier rubyid_running_times'>running_times</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_array'>array</span><span class='op'>|</span>
1225
- <span class='id identifier rubyid_average_time'>average_time</span> <span class='op'>=</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sum'>sum</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='op'>|</span> <span class='id identifier rubyid_sum'>sum</span> <span class='op'>+</span> <span class='id identifier rubyid_el'>el</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
1226
- <span class='id identifier rubyid_time_evaluation'>time_evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nAverage running time for </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='rbrace'>}</span><span class='tstring_content'> Validation: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_average_time'>average_time</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>s per validation</span><span class='tstring_end'>&quot;</span></span>
1227
- <span class='kw'>end</span>
1228
-
1229
- <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_score_evaluation'>score_evaluation</span><span class='comma'>,</span> <span class='id identifier rubyid_error_evaluation'>error_evaluation</span><span class='comma'>,</span> <span class='id identifier rubyid_time_evaluation'>time_evaluation</span><span class='rbracket'>]</span>
1230
- <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span> <span class='op'>=</span> <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='op'>!=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span>
1231
- <span class='kw'>return</span> <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span>
1232
- <span class='kw'>end</span></pre>
1233
- </td>
1234
- </tr>
1235
- </table>
1236
- </div>
1237
-
1238
- <div class="method_details ">
1239
- <h3 class="signature " id="print_footer-class_method">
1240
-
1241
- + (<tt>Object</tt>) <strong>print_footer</strong>(all_query_outputs, html_path)
1242
-
1243
-
1244
-
1245
-
1246
-
1247
- </h3><div class="docstring">
1248
- <div class="discussion">
1249
-
1250
- <p>Class that closes the gas in the html file and writes the overall
1251
- evaluation Param: <tt>all_query_outputs</tt>: array with
1252
- <tt>ValidationTest</tt> objects <tt>html_path</tt>: path of the html folder</p>
1253
-
1254
-
1255
- </div>
1256
- </div>
1257
- <div class="tags">
1258
-
1259
-
1260
- </div><table class="source_code">
1261
- <tr>
1262
- <td>
1263
- <pre class="lines">
1264
-
1265
-
1266
- 126
1267
- 127
1268
- 128
1269
- 129
1270
- 130
1271
- 131
1272
- 132
1273
- 133
1274
- 134
1275
- 135
1276
- 136
1277
- 137
1278
- 138
1279
- 139
1280
- 140</pre>
1281
- </td>
1282
- <td>
1283
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 126</span>
1284
-
1285
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_print_footer'>print_footer</span><span class='lparen'>(</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='comma'>,</span> <span class='id identifier rubyid_html_path'>html_path</span><span class='rparen'>)</span>
1286
- <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span> <span class='op'>=</span> <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span><span class='lparen'>(</span><span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span><span class='rparen'>)</span>
1287
- <span class='comment'># print to console
1288
- </span> <span class='id identifier rubyid_evaluation'>evaluation</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1289
- <span class='id identifier rubyid_overall_evaluation'>overall_evaluation</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_evaluation'>evaluation</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span>
1290
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_evaluation'>evaluation</span>
1291
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1292
- <span class='id identifier rubyid_evaluation'>evaluation</span> <span class='op'>=</span> <span class='id identifier rubyid_evaluation'>evaluation</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;br&gt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1293
-
1294
- <span class='comment'># print to html
1295
- </span> <span class='id identifier rubyid_index_file'>index_file</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_html_path'>html_path</span><span class='rbrace'>}</span><span class='tstring_content'>/index.html</span><span class='tstring_end'>&quot;</span></span>
1296
- <span class='id identifier rubyid_template_file'>template_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/template_footer.htm.erb</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
1297
- <span class='id identifier rubyid_erb'>erb</span> <span class='op'>=</span> <span class='const'>ERB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='rparen'>)</span>
1298
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_index_file'>index_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a+</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_erb'>erb</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span><span class='lparen'>(</span><span class='id identifier rubyid_binding'>binding</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1299
- <span class='kw'>end</span></pre>
1300
- </td>
1301
- </tr>
1302
- </table>
1303
- </div>
1304
-
1305
- </div>
1306
-
1307
- <div id="instance_method_details" class="method_details_list">
1308
- <h2>Instance Method Details</h2>
1309
-
1310
-
1311
- <div class="method_details first">
1312
- <h3 class="signature first" id="generate_html-instance_method">
1313
-
1314
- - (<tt>Object</tt>) <strong>generate_html</strong>
1315
-
1316
-
1317
-
1318
-
1319
-
1320
- </h3><table class="source_code">
1321
- <tr>
1322
- <td>
1323
- <pre class="lines">
1324
-
1325
-
1326
- 88
1327
- 89
1328
- 90
1329
- 91
1330
- 92
1331
- 93
1332
- 94
1333
- 95
1334
- 96
1335
- 97
1336
- 98
1337
- 99
1338
- 100
1339
- 101
1340
- 102
1341
- 103
1342
- 104
1343
- 105
1344
- 106
1345
- 107
1346
- 108
1347
- 109
1348
- 110
1349
- 111
1350
- 112
1351
- 113
1352
- 114
1353
- 115
1354
- 116
1355
- 117
1356
- 118
1357
- 119</pre>
1358
- </td>
1359
- <td>
1360
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 88</span>
1361
-
1362
- <span class='kw'>def</span> <span class='id identifier rubyid_generate_html'>generate_html</span>
1363
-
1364
- <span class='id identifier rubyid_successes'>successes</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>==</span>
1365
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_expected'>expected</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
1366
- <span class='id identifier rubyid_fails'>fails</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:unapplicable</span> <span class='kw'>and</span>
1367
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_validation'>validation</span> <span class='op'>!=</span> <span class='symbol'>:error</span> <span class='kw'>and</span>
1368
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>!=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_expected'>expected</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
1369
- <span class='id identifier rubyid_unknown'>unknown</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='id identifier rubyid_successes'>successes</span> <span class='op'>-</span> <span class='id identifier rubyid_fails'>fails</span>
1370
- <span class='id identifier rubyid_overall_score'>overall_score</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_successes'>successes</span><span class='op'>*</span><span class='int'>100</span><span class='op'>/</span><span class='lparen'>(</span><span class='id identifier rubyid_successes'>successes</span> <span class='op'>+</span> <span class='id identifier rubyid_fails'>fails</span> <span class='op'>+</span> <span class='float'>0.0</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
1371
-
1372
- <span class='kw'>if</span> <span class='id identifier rubyid_fails'>fails</span> <span class='op'>==</span> <span class='int'>0</span>
1373
- <span class='id identifier rubyid_bg_icon'>bg_icon</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>success</span><span class='tstring_end'>&quot;</span></span>
1374
- <span class='kw'>else</span>
1375
- <span class='id identifier rubyid_bg_icon'>bg_icon</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>danger</span><span class='tstring_end'>&quot;</span></span>
1376
- <span class='kw'>end</span>
1377
-
1378
- <span class='id identifier rubyid_index_file'>index_file</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@html_path</span><span class='rbrace'>}</span><span class='tstring_content'>/index.html</span><span class='tstring_end'>&quot;</span></span>
1379
-
1380
- <span class='comment'># if it's the first time I write in the html file
1381
- </span> <span class='kw'>if</span> <span class='ivar'>@idx</span> <span class='op'>==</span> <span class='ivar'>@start_idx</span>
1382
- <span class='id identifier rubyid_template_file'>template_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/template_header.htm.erb</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
1383
- <span class='id identifier rubyid_erb'>erb</span> <span class='op'>=</span> <span class='const'>ERB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='rparen'>)</span>
1384
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_index_file'>index_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w+</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_erb'>erb</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span><span class='lparen'>(</span><span class='id identifier rubyid_binding'>binding</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1385
- <span class='kw'>end</span>
1386
-
1387
- <span class='id identifier rubyid_toggle'>toggle</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>toggle</span><span class='embexpr_beg'>#{</span><span class='ivar'>@idx</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
1388
-
1389
- <span class='id identifier rubyid_template_file'>template_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/template_query.htm.erb</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
1390
- <span class='id identifier rubyid_erb'>erb</span> <span class='op'>=</span> <span class='const'>ERB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='rparen'>)</span>
1391
-
1392
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_index_file'>index_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_erb'>erb</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span><span class='lparen'>(</span><span class='id identifier rubyid_binding'>binding</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1393
- <span class='kw'>end</span></pre>
1394
- </td>
1395
- </tr>
1396
- </table>
1397
- </div>
1398
-
1399
- <div class="method_details ">
1400
- <h3 class="signature " id="print_output_console-instance_method">
1401
-
1402
- - (<tt>Object</tt>) <strong>print_output_console</strong>
1403
-
1404
-
1405
-
1406
-
1407
-
1408
- </h3><table class="source_code">
1409
- <tr>
1410
- <td>
1411
- <pre class="lines">
1412
-
1413
-
1414
- 43
1415
- 44
1416
- 45
1417
- 46
1418
- 47
1419
- 48
1420
- 49
1421
- 50
1422
- 51
1423
- 52
1424
- 53
1425
- 54
1426
- 55
1427
- 56
1428
- 57
1429
- 58
1430
- 59
1431
- 60
1432
- 61
1433
- 62
1434
- 63
1435
- 64
1436
- 65
1437
- 66</pre>
1438
- </td>
1439
- <td>
1440
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 43</span>
1441
-
1442
- <span class='kw'>def</span> <span class='id identifier rubyid_print_output_console'>print_output_console</span>
1443
-
1444
- <span class='kw'>if</span> <span class='ivar'>@idx</span> <span class='op'>==</span> <span class='ivar'>@start_idx</span>
1445
- <span class='id identifier rubyid_header'>header</span> <span class='op'>=</span><span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%3s|%20s|%5s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>No</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Identifier</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>No_Hits</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1446
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1447
- <span class='id identifier rubyid_header'>header</span><span class='op'>&lt;&lt;</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_short_header'>short_header</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
1448
- <span class='kw'>end</span>
1449
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_header'>header</span>
1450
- <span class='kw'>end</span>
1451
-
1452
- <span class='id identifier rubyid_short_def'>short_def</span> <span class='op'>=</span> <span class='ivar'>@prediction_def</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([^ ]+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
1453
- <span class='id identifier rubyid_short_def'>short_def</span> <span class='op'>=</span> <span class='id identifier rubyid_short_def'>short_def</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='lbracket'>[</span><span class='int'>20</span><span class='comma'>,</span><span class='id identifier rubyid_short_def'>short_def</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span><span class='rbracket'>]</span>
1454
- <span class='id identifier rubyid_validation_outputs'>validation_outputs</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='rbrace'>}</span>
1455
-
1456
- <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%3s|%20s|%5s|</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@idx</span><span class='comma'>,</span> <span class='id identifier rubyid_short_def'>short_def</span><span class='comma'>,</span> <span class='ivar'>@nr_hits</span><span class='rparen'>)</span>
1457
- <span class='id identifier rubyid_validation_outputs'>validation_outputs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
1458
- <span class='id identifier rubyid_item_padd'>item_padd</span> <span class='op'>=</span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%17s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span><span class='semicolon'>;</span>
1459
- <span class='id identifier rubyid_output'>output</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_item'>item</span>
1460
- <span class='id identifier rubyid_output'>output</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
1461
- <span class='kw'>end</span>
1462
-
1463
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_output'>output</span>
1464
-
1465
- <span class='kw'>end</span></pre>
1466
- </td>
1467
- </tr>
1468
- </table>
1469
- </div>
1470
-
1471
- <div class="method_details ">
1472
- <h3 class="signature " id="print_output_file_yaml-instance_method">
1473
-
1474
- - (<tt>Object</tt>) <strong>print_output_file_yaml</strong>
1475
-
1476
-
1477
-
1478
-
1479
-
1480
- </h3><table class="source_code">
1481
- <tr>
1482
- <td>
1483
- <pre class="lines">
1484
-
1485
-
1486
- 69
1487
- 70
1488
- 71
1489
- 72
1490
- 73
1491
- 74
1492
- 75
1493
- 76
1494
- 77
1495
- 78
1496
- 79
1497
- 80
1498
- 81
1499
- 82
1500
- 83
1501
- 84
1502
- 85</pre>
1503
- </td>
1504
- <td>
1505
- <pre class="code"><span class="info file"># File 'lib/genevalidator/output.rb', line 69</span>
1506
-
1507
- <span class='kw'>def</span> <span class='id identifier rubyid_print_output_file_yaml'>print_output_file_yaml</span>
1508
-
1509
- <span class='id identifier rubyid_file_yaml'>file_yaml</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@yaml_path</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@filename</span><span class='rbrace'>}</span><span class='tstring_content'>.yaml</span><span class='tstring_end'>&quot;</span></span>
1510
- <span class='id identifier rubyid_report'>report</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_validation_report'>validation_report</span><span class='rbrace'>}</span>
1511
- <span class='kw'>unless</span> <span class='ivar'>@idx</span> <span class='op'>==</span> <span class='ivar'>@start_idx</span>
1512
- <span class='id identifier rubyid_hsh'>hsh</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</span><span class='id identifier rubyid_file_yaml'>file_yaml</span><span class='rparen'>)</span>
1513
- <span class='id identifier rubyid_hsh'>hsh</span><span class='lbracket'>[</span><span class='ivar'>@prediction_def</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([^ ]+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_report'>report</span>
1514
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file_yaml'>file_yaml</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
1515
- <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span><span class='lparen'>(</span><span class='id identifier rubyid_hsh'>hsh</span><span class='comma'>,</span> <span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span>
1516
- <span class='kw'>end</span>
1517
- <span class='kw'>else</span>
1518
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file_yaml'>file_yaml</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
1519
- <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='ivar'>@prediction_def</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>([^ ]+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_report'>report</span><span class='rbrace'>}</span><span class='comma'>,</span><span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span>
1520
- <span class='kw'>end</span>
1521
- <span class='kw'>end</span>
1522
-
1523
- <span class='kw'>end</span></pre>
1524
- </td>
1525
- </tr>
1526
- </table>
1527
- </div>
1528
-
1529
- </div>
1530
-
1531
- </div>
1532
-
1533
- <div id="footer">
1534
- Generated on Sat Sep 28 07:01:32 2013 by
1535
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1536
- 0.8.7.2 (ruby-1.9.3).
1537
- </div>
1538
-
1539
- </body>
1540
- </html>