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,2147 +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: Validation
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 (V)</a> &raquo;
35
-
36
-
37
- <span class="title">Validation</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: Validation
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">Validation</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/validation.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="#all_query_outputs-instance_method" title="#all_query_outputs (instance method)">- (Object) <strong>all_query_outputs</strong> </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
- <span class="note title readonly">readonly</span>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <span class="summary_desc"><div class='inline'>
132
- <p>list with all validation reports.</p>
133
- </div></span>
134
-
135
- </li>
136
-
137
-
138
- <li class="public ">
139
- <span class="summary_signature">
140
-
141
- <a href="#fasta_filepath-instance_method" title="#fasta_filepath (instance method)">- (Object) <strong>fasta_filepath</strong> </a>
142
-
143
-
144
-
145
- </span>
146
-
147
-
148
-
149
-
150
- <span class="note title readonly">readonly</span>
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
- <span class="summary_desc"><div class='inline'>
161
- <p>Returns the value of attribute fasta_filepath.</p>
162
- </div></span>
163
-
164
- </li>
165
-
166
-
167
- <li class="public ">
168
- <span class="summary_signature">
169
-
170
- <a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
171
-
172
-
173
-
174
- </span>
175
-
176
-
177
-
178
-
179
- <span class="note title readonly">readonly</span>
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
- <span class="summary_desc"><div class='inline'>
190
- <p>Returns the value of attribute filename.</p>
191
- </div></span>
192
-
193
- </li>
194
-
195
-
196
- <li class="public ">
197
- <span class="summary_signature">
198
-
199
- <a href="#html_path-instance_method" title="#html_path (instance method)">- (Object) <strong>html_path</strong> </a>
200
-
201
-
202
-
203
- </span>
204
-
205
-
206
-
207
-
208
- <span class="note title readonly">readonly</span>
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
- <span class="summary_desc"><div class='inline'>
219
- <p>Returns the value of attribute html_path.</p>
220
- </div></span>
221
-
222
- </li>
223
-
224
-
225
- <li class="public ">
226
- <span class="summary_signature">
227
-
228
- <a href="#idx-instance_method" title="#idx (instance method)">- (Object) <strong>idx</strong> </a>
229
-
230
-
231
-
232
- </span>
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
-
245
- <span class="summary_desc"><div class='inline'>
246
- <p>current number of the querry processed.</p>
247
- </div></span>
248
-
249
- </li>
250
-
251
-
252
- <li class="public ">
253
- <span class="summary_signature">
254
-
255
- <a href="#mafft_path-instance_method" title="#mafft_path (instance method)">- (Object) <strong>mafft_path</strong> </a>
256
-
257
-
258
-
259
- </span>
260
-
261
-
262
-
263
-
264
- <span class="note title readonly">readonly</span>
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
- <span class="summary_desc"><div class='inline'>
275
- <p>Returns the value of attribute mafft_path.</p>
276
- </div></span>
277
-
278
- </li>
279
-
280
-
281
- <li class="public ">
282
- <span class="summary_signature">
283
-
284
- <a href="#query_offset_lst-instance_method" title="#query_offset_lst (instance method)">- (Object) <strong>query_offset_lst</strong> </a>
285
-
286
-
287
-
288
- </span>
289
-
290
-
291
-
292
-
293
- <span class="note title readonly">readonly</span>
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
- <span class="summary_desc"><div class='inline'>
304
- <p>array of indexes for the start offsets of each query in the fasta file.</p>
305
- </div></span>
306
-
307
- </li>
308
-
309
-
310
- <li class="public ">
311
- <span class="summary_signature">
312
-
313
- <a href="#raw_seq_file_index-instance_method" title="#raw_seq_file_index (instance method)">- (Object) <strong>raw_seq_file_index</strong> </a>
314
-
315
-
316
-
317
- </span>
318
-
319
-
320
-
321
-
322
- <span class="note title readonly">readonly</span>
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
- <span class="summary_desc"><div class='inline'>
333
- <p>Returns the value of attribute raw_seq_file_index.</p>
334
- </div></span>
335
-
336
- </li>
337
-
338
-
339
- <li class="public ">
340
- <span class="summary_signature">
341
-
342
- <a href="#start_idx-instance_method" title="#start_idx (instance method)">- (Object) <strong>start_idx</strong> </a>
343
-
344
-
345
-
346
- </span>
347
-
348
-
349
-
350
-
351
- <span class="note title readonly">readonly</span>
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
- <span class="summary_desc"><div class='inline'>
362
- <p>Returns the value of attribute start_idx.</p>
363
- </div></span>
364
-
365
- </li>
366
-
367
-
368
- <li class="public ">
369
- <span class="summary_signature">
370
-
371
- <a href="#tabular_format-instance_method" title="#tabular_format (instance method)">- (Object) <strong>tabular_format</strong> </a>
372
-
373
-
374
-
375
- </span>
376
-
377
-
378
-
379
-
380
- <span class="note title readonly">readonly</span>
381
-
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
- <span class="summary_desc"><div class='inline'>
391
- <p>Returns the value of attribute tabular_format.</p>
392
- </div></span>
393
-
394
- </li>
395
-
396
-
397
- <li class="public ">
398
- <span class="summary_signature">
399
-
400
- <a href="#type-instance_method" title="#type (instance method)">- (Object) <strong>type</strong> </a>
401
-
402
-
403
-
404
- </span>
405
-
406
-
407
-
408
-
409
- <span class="note title readonly">readonly</span>
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
-
419
- <span class="summary_desc"><div class='inline'>
420
- <p>Returns the value of attribute type.</p>
421
- </div></span>
422
-
423
- </li>
424
-
425
-
426
- <li class="public ">
427
- <span class="summary_signature">
428
-
429
- <a href="#vlist-instance_method" title="#vlist (instance method)">- (Object) <strong>vlist</strong> </a>
430
-
431
-
432
-
433
- </span>
434
-
435
-
436
-
437
-
438
- <span class="note title readonly">readonly</span>
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
- <span class="summary_desc"><div class='inline'>
449
- <p>Returns the value of attribute vlist.</p>
450
- </div></span>
451
-
452
- </li>
453
-
454
-
455
- <li class="public ">
456
- <span class="summary_signature">
457
-
458
- <a href="#yaml_path-instance_method" title="#yaml_path (instance method)">- (Object) <strong>yaml_path</strong> </a>
459
-
460
-
461
-
462
- </span>
463
-
464
-
465
-
466
-
467
- <span class="note title readonly">readonly</span>
468
-
469
-
470
-
471
-
472
-
473
-
474
-
475
-
476
-
477
- <span class="summary_desc"><div class='inline'>
478
- <p>Returns the value of attribute yaml_path.</p>
479
- </div></span>
480
-
481
- </li>
482
-
483
-
484
- </ul>
485
-
486
-
487
-
488
-
489
-
490
- <h2>
491
- Instance Method Summary
492
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
493
- </h2>
494
-
495
- <ul class="summary">
496
-
497
- <li class="public ">
498
- <span class="summary_signature">
499
-
500
- <a href="#do_validations-instance_method" title="#do_validations (instance method)">- (Object) <strong>do_validations</strong>(prediction, hits) </a>
501
-
502
-
503
-
504
- </span>
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
- <span class="summary_desc"><div class='inline'>
515
- <p>Runs all the validations and prints the outputs given the current
516
- prediction query and the corresponding hits Params: <tt>hits</tt>: Array of
517
- <tt>Sequence</tt> objects Output: Array <tt>Output</tt> object.</p>
518
- </div></span>
519
-
520
- </li>
521
-
522
-
523
- <li class="public ">
524
- <span class="summary_signature">
525
-
526
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Validation) <strong>initialize</strong>(fasta_filepath, vlist = [&quot;all&quot;], tabular_format = nil, xml_file = nil, raw_seq_file = nil, mafft_path = nil, start_idx = 1) </a>
527
-
528
-
529
-
530
- </span>
531
-
532
-
533
- <span class="note title constructor">constructor</span>
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
-
542
- <span class="summary_desc"><div class='inline'>
543
- <p>Initilizes the object Params: <tt>fasta_filepath</tt>: fasta file with
544
- query sequences <tt>vlist</tt>: list of validations
545
- <tt>tabular_format</tt>: list of column names for parsing the tablar blast
546
- output <tt>xml_file</tt>: name of the precalculated blast xml output (used
547
- in 'skip blast' case) <tt>mafft_path</tt>: path of the MAFFT program
548
- installation <tt>start_idx</tt>: number of the sequence from the file to
549
- start with.</p>
550
- </div></span>
551
-
552
- </li>
553
-
554
-
555
- <li class="public ">
556
- <span class="summary_signature">
557
-
558
- <a href="#parse_output-instance_method" title="#parse_output (instance method)">- (Object) <strong>parse_output</strong>(output) </a>
559
-
560
-
561
-
562
- </span>
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
-
571
-
572
- <span class="summary_desc"><div class='inline'>
573
- <p>Parses the blast output: autodetect the format: xml or tabular Param:
574
- <tt>output</tt>: <tt>String</tt> with the blast output.</p>
575
- </div></span>
576
-
577
- </li>
578
-
579
-
580
- <li class="public ">
581
- <span class="summary_signature">
582
-
583
- <a href="#remove_identical_hits-instance_method" title="#remove_identical_hits (instance method)">- (Object) <strong>remove_identical_hits</strong>(prediction, hits) </a>
584
-
585
-
586
-
587
- </span>
588
-
589
-
590
-
591
-
592
-
593
-
594
-
595
-
596
-
597
- <span class="summary_desc"><div class='inline'>
598
- <p>Removes identical hits Params: <tt>prediction</tt>: Sequence object
599
- <tt>hits</tt>: Array of <tt>Sequence</tt> objects Output: new array of hit
600
- <tt>Sequence</tt> objects.</p>
601
- </div></span>
602
-
603
- </li>
604
-
605
-
606
- <li class="public ">
607
- <span class="summary_signature">
608
-
609
- <a href="#validation-instance_method" title="#validation (instance method)">- (Object) <strong>validation</strong> </a>
610
-
611
-
612
-
613
- </span>
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
- <span class="summary_desc"><div class='inline'>
624
- <p>Parse the blast output and run validations.</p>
625
- </div></span>
626
-
627
- </li>
628
-
629
-
630
- <li class="public ">
631
- <span class="summary_signature">
632
-
633
- <a href="#which-instance_method" title="#which (instance method)">- (Object) <strong>which</strong>(cmd) </a>
634
-
635
-
636
-
637
- </span>
638
-
639
-
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
- <span class="summary_desc"><div class='inline'>
648
- <p>The ruby equivalent for 'which' command in unix.</p>
649
- </div></span>
650
-
651
- </li>
652
-
653
-
654
- </ul>
655
-
656
-
657
- <div id="constructor_details" class="method_details_list">
658
- <h2>Constructor Details</h2>
659
-
660
- <div class="method_details first">
661
- <h3 class="signature first" id="initialize-instance_method">
662
-
663
- - (<tt><span class='object_link'><a href="" title="Validation (class)">Validation</a></span></tt>) <strong>initialize</strong>(fasta_filepath, vlist = [&quot;all&quot;], tabular_format = nil, xml_file = nil, raw_seq_file = nil, mafft_path = nil, start_idx = 1)
664
-
665
-
666
-
667
-
668
-
669
- </h3><div class="docstring">
670
- <div class="discussion">
671
-
672
- <p>Initilizes the object Params: <tt>fasta_filepath</tt>: fasta file with
673
- query sequences <tt>vlist</tt>: list of validations
674
- <tt>tabular_format</tt>: list of column names for parsing the tablar blast
675
- output <tt>xml_file</tt>: name of the precalculated blast xml output (used
676
- in 'skip blast' case) <tt>mafft_path</tt>: path of the MAFFT program
677
- installation <tt>start_idx</tt>: number of the sequence from the file to
678
- start with</p>
679
-
680
-
681
- </div>
682
- </div>
683
- <div class="tags">
684
-
685
-
686
- </div><table class="source_code">
687
- <tr>
688
- <td>
689
- <pre class="lines">
690
-
691
-
692
- 50
693
- 51
694
- 52
695
- 53
696
- 54
697
- 55
698
- 56
699
- 57
700
- 58
701
- 59
702
- 60
703
- 61
704
- 62
705
- 63
706
- 64
707
- 65
708
- 66
709
- 67
710
- 68
711
- 69
712
- 70
713
- 71
714
- 72
715
- 73
716
- 74
717
- 75
718
- 76
719
- 77
720
- 78
721
- 79
722
- 80
723
- 81
724
- 82
725
- 83
726
- 84
727
- 85
728
- 86
729
- 87
730
- 88
731
- 89
732
- 90
733
- 91
734
- 92
735
- 93
736
- 94
737
- 95
738
- 96
739
- 97
740
- 98
741
- 99
742
- 100
743
- 101
744
- 102
745
- 103
746
- 104
747
- 105
748
- 106
749
- 107
750
- 108
751
- 109
752
- 110
753
- 111
754
- 112
755
- 113
756
- 114
757
- 115
758
- 116
759
- 117
760
- 118
761
- 119
762
- 120
763
- 121
764
- 122
765
- 123
766
- 124
767
- 125
768
- 126
769
- 127
770
- 128
771
- 129
772
- 130
773
- 131
774
- 132
775
- 133
776
- 134
777
- 135
778
- 136
779
- 137
780
- 138
781
- 139
782
- 140
783
- 141
784
- 142
785
- 143
786
- 144
787
- 145
788
- 146
789
- 147</pre>
790
- </td>
791
- <td>
792
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 50</span>
793
-
794
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_fasta_filepath'>fasta_filepath</span><span class='comma'>,</span>
795
- <span class='id identifier rubyid_vlist'>vlist</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>all</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
796
- <span class='id identifier rubyid_tabular_format'>tabular_format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span>
797
- <span class='id identifier rubyid_xml_file'>xml_file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span>
798
- <span class='id identifier rubyid_raw_seq_file'>raw_seq_file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span>
799
- <span class='id identifier rubyid_mafft_path'>mafft_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span>
800
- <span class='id identifier rubyid_start_idx'>start_idx</span> <span class='op'>=</span> <span class='int'>1</span><span class='rparen'>)</span>
801
- <span class='kw'>begin</span>
802
-
803
- <span class='ivar'>@fasta_filepath</span> <span class='op'>=</span> <span class='id identifier rubyid_fasta_filepath'>fasta_filepath</span>
804
- <span class='ivar'>@xml_file</span> <span class='op'>=</span> <span class='id identifier rubyid_xml_file'>xml_file</span>
805
- <span class='ivar'>@vlist</span> <span class='op'>=</span> <span class='id identifier rubyid_vlist'>vlist</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_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\s</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s\Z</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
806
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='int'>0</span>
807
-
808
- <span class='kw'>if</span> <span class='id identifier rubyid_start_idx'>start_idx</span> <span class='op'>==</span> <span class='kw'>nil</span>
809
- <span class='ivar'>@start_idx</span> <span class='op'>=</span> <span class='int'>1</span>
810
- <span class='kw'>else</span>
811
- <span class='ivar'>@start_idx</span> <span class='op'>=</span> <span class='id identifier rubyid_start_idx'>start_idx</span>
812
- <span class='kw'>end</span>
813
-
814
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>FileNotFoundException</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='rparen'>)</span>
815
- <span class='id identifier rubyid_fasta_content'>fasta_content</span> <span class='op'>=</span> <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_binread'>binread</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='rparen'>)</span><span class='semicolon'>;</span>
816
-
817
- <span class='comment'># the expected type for the sequences is the
818
- </span> <span class='comment'># type of the first query
819
- </span>
820
- <span class='comment'># autodetect the type of the sequence in the FASTA
821
- </span> <span class='comment'># also check if the fasta file contains a single type of queries
822
- </span> <span class='ivar'>@type</span> <span class='op'>=</span> <span class='const'>BlastUtils</span><span class='period'>.</span><span class='id identifier rubyid_type_of_sequences'>type_of_sequences</span><span class='lparen'>(</span><span class='id identifier rubyid_fasta_content'>fasta_content</span><span class='rparen'>)</span>
823
-
824
- <span class='comment'># create a list of index of the queries in the FASTA
825
- </span> <span class='ivar'>@query_offset_lst</span> <span class='op'>=</span> <span class='id identifier rubyid_fasta_content'>fasta_content</span><span class='period'>.</span><span class='id identifier rubyid_enum_for'>enum_for</span><span class='lparen'>(</span><span class='symbol'>:scan</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(&gt;[^&gt;]+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rbrace'>}</span>
826
- <span class='ivar'>@query_offset_lst</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_fasta_content'>fasta_content</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span>
827
- <span class='id identifier rubyid_fasta_content'>fasta_content</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='comment'># free memory for variable fasta_content
828
- </span> <span class='ivar'>@tabular_format</span> <span class='op'>=</span> <span class='id identifier rubyid_tabular_format'>tabular_format</span>
829
-
830
- <span class='kw'>if</span> <span class='id identifier rubyid_mafft_path'>mafft_path</span> <span class='op'>==</span> <span class='kw'>nil</span>
831
- <span class='ivar'>@mafft_path</span> <span class='op'>=</span> <span class='id identifier rubyid_which'>which</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>mafft</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
832
- <span class='kw'>else</span>
833
- <span class='ivar'>@mafft_path</span> <span class='op'>=</span> <span class='id identifier rubyid_mafft_path'>mafft_path</span>
834
- <span class='kw'>end</span>
835
-
836
- <span class='kw'>begin</span>
837
- <span class='comment'># index raw_sequence file
838
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_raw_seq_file'>raw_seq_file</span> <span class='op'>!=</span> <span class='kw'>nil</span>
839
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>FileNotFoundException</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_raw_seq_file'>raw_seq_file</span><span class='rparen'>)</span>
840
- <span class='comment'># leave only the identifiers in the fasta description
841
- </span> <span class='id identifier rubyid_content'>content</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='id identifier rubyid_raw_seq_file'>raw_seq_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
842
- <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_raw_seq_file'>raw_seq_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_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rbrace'>}</span>
843
-
844
- <span class='comment'>#index the fasta file
845
- </span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</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'>&gt;(.*)\n</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
846
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enum_for'>enum_for</span><span class='lparen'>(</span><span class='symbol'>:scan</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(&gt;[^&gt;]+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rbrace'>}</span>
847
-
848
- <span class='comment'># make am index hash
849
- </span> <span class='id identifier rubyid_index_hash'>index_hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
850
- <span class='id identifier rubyid_index_hash'>index_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</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_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_index_hash'>index_hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
851
-
852
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_index_hash'>index_hash</span>
853
-
854
- <span class='comment'># create FASTA index
855
- </span> <span class='ivar'>@raw_seq_file_index</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_raw_seq_file'>raw_seq_file</span><span class='rbrace'>}</span><span class='tstring_content'>.idx</span><span class='tstring_end'>&quot;</span></span>
856
-
857
- <span class='kw'>end</span>
858
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
859
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
860
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: your file with raw sequences is not FASTA. Please use get_raw_sequences executable to create a correct one.\n</span><span class='tstring_end'>&quot;</span></span>
861
- <span class='kw'>end</span>
862
-
863
- <span class='comment'># build the path of html folder output
864
- </span> <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='rparen'>)</span>
865
- <span class='ivar'>@html_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_fasta_filepath'>fasta_filepath</span><span class='rbrace'>}</span><span class='tstring_content'>.html</span><span class='tstring_end'>&quot;</span></span>
866
- <span class='ivar'>@yaml_path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
867
-
868
- <span class='ivar'>@filename</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='rparen'>)</span><span class='comment'>#.scan(/\/([^\/]+)$/)[0][0]
869
- </span> <span class='ivar'>@all_query_outputs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
870
-
871
- <span class='comment'># create 'html' directory
872
- </span> <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_rm_rf'>rm_rf</span><span class='lparen'>(</span><span class='ivar'>@html_path</span><span class='rparen'>)</span>
873
- <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mkdir'>mkdir</span><span class='lparen'>(</span><span class='ivar'>@html_path</span><span class='rparen'>)</span>
874
-
875
- <span class='comment'># copy auxiliar folders to the html folder
876
- </span> <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/css</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
877
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/js</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
878
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/img</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
879
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/font</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
880
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aux/doc</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
881
-
882
- <span class='kw'>rescue</span> <span class='const'>SequenceTypeError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
883
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Sequence Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
884
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: input file containes mixed sequence types.\n</span><span class='tstring_end'>&quot;</span></span>
885
- <span class='id identifier rubyid_exit'>exit</span>
886
- <span class='kw'>rescue</span> <span class='const'>FileNotFoundException</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
887
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>File not found error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
888
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: input file does not exist.\n</span><span class='tstring_end'>&quot;</span></span>
889
- <span class='id identifier rubyid_exit'>exit</span>
890
- <span class='kw'>end</span>
891
- <span class='kw'>end</span></pre>
892
- </td>
893
- </tr>
894
- </table>
895
- </div>
896
-
897
- </div>
898
-
899
- <div id="instance_attr_details" class="attr_details">
900
- <h2>Instance Attribute Details</h2>
901
-
902
-
903
- <span id=""></span>
904
- <div class="method_details first">
905
- <h3 class="signature first" id="all_query_outputs-instance_method">
906
-
907
- - (<tt>Object</tt>) <strong>all_query_outputs</strong> <span class="extras">(readonly)</span>
908
-
909
-
910
-
911
-
912
-
913
- </h3><div class="docstring">
914
- <div class="discussion">
915
-
916
- <p>list with all validation reports</p>
917
-
918
-
919
- </div>
920
- </div>
921
- <div class="tags">
922
-
923
-
924
- </div><table class="source_code">
925
- <tr>
926
- <td>
927
- <pre class="lines">
928
-
929
-
930
- 36
931
- 37
932
- 38</pre>
933
- </td>
934
- <td>
935
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 36</span>
936
-
937
- <span class='kw'>def</span> <span class='id identifier rubyid_all_query_outputs'>all_query_outputs</span>
938
- <span class='ivar'>@all_query_outputs</span>
939
- <span class='kw'>end</span></pre>
940
- </td>
941
- </tr>
942
- </table>
943
- </div>
944
-
945
-
946
- <span id=""></span>
947
- <div class="method_details ">
948
- <h3 class="signature " id="fasta_filepath-instance_method">
949
-
950
- - (<tt>Object</tt>) <strong>fasta_filepath</strong> <span class="extras">(readonly)</span>
951
-
952
-
953
-
954
-
955
-
956
- </h3><div class="docstring">
957
- <div class="discussion">
958
-
959
- <p>Returns the value of attribute fasta_filepath</p>
960
-
961
-
962
- </div>
963
- </div>
964
- <div class="tags">
965
-
966
-
967
- </div><table class="source_code">
968
- <tr>
969
- <td>
970
- <pre class="lines">
971
-
972
-
973
- 24
974
- 25
975
- 26</pre>
976
- </td>
977
- <td>
978
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 24</span>
979
-
980
- <span class='kw'>def</span> <span class='id identifier rubyid_fasta_filepath'>fasta_filepath</span>
981
- <span class='ivar'>@fasta_filepath</span>
982
- <span class='kw'>end</span></pre>
983
- </td>
984
- </tr>
985
- </table>
986
- </div>
987
-
988
-
989
- <span id=""></span>
990
- <div class="method_details ">
991
- <h3 class="signature " id="filename-instance_method">
992
-
993
- - (<tt>Object</tt>) <strong>filename</strong> <span class="extras">(readonly)</span>
994
-
995
-
996
-
997
-
998
-
999
- </h3><div class="docstring">
1000
- <div class="discussion">
1001
-
1002
- <p>Returns the value of attribute filename</p>
1003
-
1004
-
1005
- </div>
1006
- </div>
1007
- <div class="tags">
1008
-
1009
-
1010
- </div><table class="source_code">
1011
- <tr>
1012
- <td>
1013
- <pre class="lines">
1014
-
1015
-
1016
- 28
1017
- 29
1018
- 30</pre>
1019
- </td>
1020
- <td>
1021
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 28</span>
1022
-
1023
- <span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
1024
- <span class='ivar'>@filename</span>
1025
- <span class='kw'>end</span></pre>
1026
- </td>
1027
- </tr>
1028
- </table>
1029
- </div>
1030
-
1031
-
1032
- <span id=""></span>
1033
- <div class="method_details ">
1034
- <h3 class="signature " id="html_path-instance_method">
1035
-
1036
- - (<tt>Object</tt>) <strong>html_path</strong> <span class="extras">(readonly)</span>
1037
-
1038
-
1039
-
1040
-
1041
-
1042
- </h3><div class="docstring">
1043
- <div class="discussion">
1044
-
1045
- <p>Returns the value of attribute html_path</p>
1046
-
1047
-
1048
- </div>
1049
- </div>
1050
- <div class="tags">
1051
-
1052
-
1053
- </div><table class="source_code">
1054
- <tr>
1055
- <td>
1056
- <pre class="lines">
1057
-
1058
-
1059
- 25
1060
- 26
1061
- 27</pre>
1062
- </td>
1063
- <td>
1064
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 25</span>
1065
-
1066
- <span class='kw'>def</span> <span class='id identifier rubyid_html_path'>html_path</span>
1067
- <span class='ivar'>@html_path</span>
1068
- <span class='kw'>end</span></pre>
1069
- </td>
1070
- </tr>
1071
- </table>
1072
- </div>
1073
-
1074
-
1075
- <span id="idx=-instance_method"></span>
1076
- <div class="method_details ">
1077
- <h3 class="signature " id="idx-instance_method">
1078
-
1079
- - (<tt>Object</tt>) <strong>idx</strong>
1080
-
1081
-
1082
-
1083
-
1084
-
1085
- </h3><div class="docstring">
1086
- <div class="discussion">
1087
-
1088
- <p>current number of the querry processed</p>
1089
-
1090
-
1091
- </div>
1092
- </div>
1093
- <div class="tags">
1094
-
1095
-
1096
- </div><table class="source_code">
1097
- <tr>
1098
- <td>
1099
- <pre class="lines">
1100
-
1101
-
1102
- 31
1103
- 32
1104
- 33</pre>
1105
- </td>
1106
- <td>
1107
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 31</span>
1108
-
1109
- <span class='kw'>def</span> <span class='id identifier rubyid_idx'>idx</span>
1110
- <span class='ivar'>@idx</span>
1111
- <span class='kw'>end</span></pre>
1112
- </td>
1113
- </tr>
1114
- </table>
1115
- </div>
1116
-
1117
-
1118
- <span id=""></span>
1119
- <div class="method_details ">
1120
- <h3 class="signature " id="mafft_path-instance_method">
1121
-
1122
- - (<tt>Object</tt>) <strong>mafft_path</strong> <span class="extras">(readonly)</span>
1123
-
1124
-
1125
-
1126
-
1127
-
1128
- </h3><div class="docstring">
1129
- <div class="discussion">
1130
-
1131
- <p>Returns the value of attribute mafft_path</p>
1132
-
1133
-
1134
- </div>
1135
- </div>
1136
- <div class="tags">
1137
-
1138
-
1139
- </div><table class="source_code">
1140
- <tr>
1141
- <td>
1142
- <pre class="lines">
1143
-
1144
-
1145
- 27
1146
- 28
1147
- 29</pre>
1148
- </td>
1149
- <td>
1150
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 27</span>
1151
-
1152
- <span class='kw'>def</span> <span class='id identifier rubyid_mafft_path'>mafft_path</span>
1153
- <span class='ivar'>@mafft_path</span>
1154
- <span class='kw'>end</span></pre>
1155
- </td>
1156
- </tr>
1157
- </table>
1158
- </div>
1159
-
1160
-
1161
- <span id=""></span>
1162
- <div class="method_details ">
1163
- <h3 class="signature " id="query_offset_lst-instance_method">
1164
-
1165
- - (<tt>Object</tt>) <strong>query_offset_lst</strong> <span class="extras">(readonly)</span>
1166
-
1167
-
1168
-
1169
-
1170
-
1171
- </h3><div class="docstring">
1172
- <div class="discussion">
1173
-
1174
- <p>array of indexes for the start offsets of each query in the fasta file</p>
1175
-
1176
-
1177
- </div>
1178
- </div>
1179
- <div class="tags">
1180
-
1181
-
1182
- </div><table class="source_code">
1183
- <tr>
1184
- <td>
1185
- <pre class="lines">
1186
-
1187
-
1188
- 34
1189
- 35
1190
- 36</pre>
1191
- </td>
1192
- <td>
1193
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 34</span>
1194
-
1195
- <span class='kw'>def</span> <span class='id identifier rubyid_query_offset_lst'>query_offset_lst</span>
1196
- <span class='ivar'>@query_offset_lst</span>
1197
- <span class='kw'>end</span></pre>
1198
- </td>
1199
- </tr>
1200
- </table>
1201
- </div>
1202
-
1203
-
1204
- <span id=""></span>
1205
- <div class="method_details ">
1206
- <h3 class="signature " id="raw_seq_file_index-instance_method">
1207
-
1208
- - (<tt>Object</tt>) <strong>raw_seq_file_index</strong> <span class="extras">(readonly)</span>
1209
-
1210
-
1211
-
1212
-
1213
-
1214
- </h3><div class="docstring">
1215
- <div class="discussion">
1216
-
1217
- <p>Returns the value of attribute raw_seq_file_index</p>
1218
-
1219
-
1220
- </div>
1221
- </div>
1222
- <div class="tags">
1223
-
1224
-
1225
- </div><table class="source_code">
1226
- <tr>
1227
- <td>
1228
- <pre class="lines">
1229
-
1230
-
1231
- 29
1232
- 30
1233
- 31</pre>
1234
- </td>
1235
- <td>
1236
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 29</span>
1237
-
1238
- <span class='kw'>def</span> <span class='id identifier rubyid_raw_seq_file_index'>raw_seq_file_index</span>
1239
- <span class='ivar'>@raw_seq_file_index</span>
1240
- <span class='kw'>end</span></pre>
1241
- </td>
1242
- </tr>
1243
- </table>
1244
- </div>
1245
-
1246
-
1247
- <span id=""></span>
1248
- <div class="method_details ">
1249
- <h3 class="signature " id="start_idx-instance_method">
1250
-
1251
- - (<tt>Object</tt>) <strong>start_idx</strong> <span class="extras">(readonly)</span>
1252
-
1253
-
1254
-
1255
-
1256
-
1257
- </h3><div class="docstring">
1258
- <div class="discussion">
1259
-
1260
- <p>Returns the value of attribute start_idx</p>
1261
-
1262
-
1263
- </div>
1264
- </div>
1265
- <div class="tags">
1266
-
1267
-
1268
- </div><table class="source_code">
1269
- <tr>
1270
- <td>
1271
- <pre class="lines">
1272
-
1273
-
1274
- 32
1275
- 33
1276
- 34</pre>
1277
- </td>
1278
- <td>
1279
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 32</span>
1280
-
1281
- <span class='kw'>def</span> <span class='id identifier rubyid_start_idx'>start_idx</span>
1282
- <span class='ivar'>@start_idx</span>
1283
- <span class='kw'>end</span></pre>
1284
- </td>
1285
- </tr>
1286
- </table>
1287
- </div>
1288
-
1289
-
1290
- <span id=""></span>
1291
- <div class="method_details ">
1292
- <h3 class="signature " id="tabular_format-instance_method">
1293
-
1294
- - (<tt>Object</tt>) <strong>tabular_format</strong> <span class="extras">(readonly)</span>
1295
-
1296
-
1297
-
1298
-
1299
-
1300
- </h3><div class="docstring">
1301
- <div class="discussion">
1302
-
1303
- <p>Returns the value of attribute tabular_format</p>
1304
-
1305
-
1306
- </div>
1307
- </div>
1308
- <div class="tags">
1309
-
1310
-
1311
- </div><table class="source_code">
1312
- <tr>
1313
- <td>
1314
- <pre class="lines">
1315
-
1316
-
1317
- 39
1318
- 40
1319
- 41</pre>
1320
- </td>
1321
- <td>
1322
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 39</span>
1323
-
1324
- <span class='kw'>def</span> <span class='id identifier rubyid_tabular_format'>tabular_format</span>
1325
- <span class='ivar'>@tabular_format</span>
1326
- <span class='kw'>end</span></pre>
1327
- </td>
1328
- </tr>
1329
- </table>
1330
- </div>
1331
-
1332
-
1333
- <span id=""></span>
1334
- <div class="method_details ">
1335
- <h3 class="signature " id="type-instance_method">
1336
-
1337
- - (<tt>Object</tt>) <strong>type</strong> <span class="extras">(readonly)</span>
1338
-
1339
-
1340
-
1341
-
1342
-
1343
- </h3><div class="docstring">
1344
- <div class="discussion">
1345
-
1346
- <p>Returns the value of attribute type</p>
1347
-
1348
-
1349
- </div>
1350
- </div>
1351
- <div class="tags">
1352
-
1353
-
1354
- </div><table class="source_code">
1355
- <tr>
1356
- <td>
1357
- <pre class="lines">
1358
-
1359
-
1360
- 23
1361
- 24
1362
- 25</pre>
1363
- </td>
1364
- <td>
1365
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 23</span>
1366
-
1367
- <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
1368
- <span class='ivar'>@type</span>
1369
- <span class='kw'>end</span></pre>
1370
- </td>
1371
- </tr>
1372
- </table>
1373
- </div>
1374
-
1375
-
1376
- <span id=""></span>
1377
- <div class="method_details ">
1378
- <h3 class="signature " id="vlist-instance_method">
1379
-
1380
- - (<tt>Object</tt>) <strong>vlist</strong> <span class="extras">(readonly)</span>
1381
-
1382
-
1383
-
1384
-
1385
-
1386
- </h3><div class="docstring">
1387
- <div class="discussion">
1388
-
1389
- <p>Returns the value of attribute vlist</p>
1390
-
1391
-
1392
- </div>
1393
- </div>
1394
- <div class="tags">
1395
-
1396
-
1397
- </div><table class="source_code">
1398
- <tr>
1399
- <td>
1400
- <pre class="lines">
1401
-
1402
-
1403
- 38
1404
- 39
1405
- 40</pre>
1406
- </td>
1407
- <td>
1408
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 38</span>
1409
-
1410
- <span class='kw'>def</span> <span class='id identifier rubyid_vlist'>vlist</span>
1411
- <span class='ivar'>@vlist</span>
1412
- <span class='kw'>end</span></pre>
1413
- </td>
1414
- </tr>
1415
- </table>
1416
- </div>
1417
-
1418
-
1419
- <span id=""></span>
1420
- <div class="method_details ">
1421
- <h3 class="signature " id="yaml_path-instance_method">
1422
-
1423
- - (<tt>Object</tt>) <strong>yaml_path</strong> <span class="extras">(readonly)</span>
1424
-
1425
-
1426
-
1427
-
1428
-
1429
- </h3><div class="docstring">
1430
- <div class="discussion">
1431
-
1432
- <p>Returns the value of attribute yaml_path</p>
1433
-
1434
-
1435
- </div>
1436
- </div>
1437
- <div class="tags">
1438
-
1439
-
1440
- </div><table class="source_code">
1441
- <tr>
1442
- <td>
1443
- <pre class="lines">
1444
-
1445
-
1446
- 26
1447
- 27
1448
- 28</pre>
1449
- </td>
1450
- <td>
1451
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 26</span>
1452
-
1453
- <span class='kw'>def</span> <span class='id identifier rubyid_yaml_path'>yaml_path</span>
1454
- <span class='ivar'>@yaml_path</span>
1455
- <span class='kw'>end</span></pre>
1456
- </td>
1457
- </tr>
1458
- </table>
1459
- </div>
1460
-
1461
- </div>
1462
-
1463
-
1464
- <div id="instance_method_details" class="method_details_list">
1465
- <h2>Instance Method Details</h2>
1466
-
1467
-
1468
- <div class="method_details first">
1469
- <h3 class="signature first" id="do_validations-instance_method">
1470
-
1471
- - (<tt>Object</tt>) <strong>do_validations</strong>(prediction, hits)
1472
-
1473
-
1474
-
1475
-
1476
-
1477
- </h3><div class="docstring">
1478
- <div class="discussion">
1479
-
1480
- <p>Runs all the validations and prints the outputs given the current
1481
- prediction query and the corresponding hits Params: <tt>hits</tt>: Array of
1482
- <tt>Sequence</tt> objects Output: Array <tt>Output</tt> object</p>
1483
-
1484
-
1485
- </div>
1486
- </div>
1487
- <div class="tags">
1488
-
1489
-
1490
- </div><table class="source_code">
1491
- <tr>
1492
- <td>
1493
- <pre class="lines">
1494
-
1495
-
1496
- 320
1497
- 321
1498
- 322
1499
- 323
1500
- 324
1501
- 325
1502
- 326
1503
- 327
1504
- 328
1505
- 329
1506
- 330
1507
- 331
1508
- 332
1509
- 333
1510
- 334
1511
- 335
1512
- 336
1513
- 337
1514
- 338
1515
- 339
1516
- 340
1517
- 341
1518
- 342
1519
- 343
1520
- 344
1521
- 345
1522
- 346
1523
- 347
1524
- 348
1525
- 349
1526
- 350
1527
- 351
1528
- 352
1529
- 353
1530
- 354
1531
- 355
1532
- 356
1533
- 357
1534
- 358
1535
- 359
1536
- 360
1537
- 361
1538
- 362
1539
- 363
1540
- 364
1541
- 365
1542
- 366
1543
- 367
1544
- 368
1545
- 369
1546
- 370
1547
- 371
1548
- 372
1549
- 373
1550
- 374
1551
- 375
1552
- 376
1553
- 377
1554
- 378
1555
- 379
1556
- 380
1557
- 381
1558
- 382
1559
- 383
1560
- 384
1561
- 385
1562
- 386
1563
- 387
1564
- 388
1565
- 389
1566
- 390
1567
- 391
1568
- 392
1569
- 393
1570
- 394
1571
- 395
1572
- 396
1573
- 397
1574
- 398
1575
- 399
1576
- 400
1577
- 401
1578
- 402
1579
- 403
1580
- 404
1581
- 405</pre>
1582
- </td>
1583
- <td>
1584
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 320</span>
1585
-
1586
- <span class='kw'>def</span> <span class='id identifier rubyid_do_validations'>do_validations</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1587
- <span class='kw'>begin</span>
1588
- <span class='kw'>begin</span>
1589
- <span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='id identifier rubyid_remove_identical_hits'>remove_identical_hits</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1590
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span> <span class='comment'>#NoPIdentError
1591
- </span> <span class='kw'>end</span>
1592
-
1593
- <span class='comment'># do validations
1594
- </span> <span class='kw'>begin</span>
1595
-
1596
- <span class='id identifier rubyid_query_output'>query_output</span> <span class='op'>=</span> <span class='const'>Output</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@filename</span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='comma'>,</span> <span class='ivar'>@yaml_path</span><span class='comma'>,</span> <span class='ivar'>@idx</span><span class='comma'>,</span> <span class='ivar'>@start_idx</span><span class='rparen'>)</span>
1597
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_prediction_len'>prediction_len</span> <span class='op'>=</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_length_protein'>length_protein</span>
1598
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_prediction_def'>prediction_def</span> <span class='op'>=</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span>
1599
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_nr_hits'>nr_hits</span> <span class='op'>=</span> <span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1600
-
1601
- <span class='id identifier rubyid_plot_path'>plot_path</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'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filename'>filename</span><span class='rbrace'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='ivar'>@idx</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
1602
-
1603
- <span class='id identifier rubyid_validations'>validations</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1604
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>LengthClusterValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='comma'>,</span> <span class='id identifier rubyid_plot_path'>plot_path</span><span class='rparen'>)</span>
1605
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>LengthRankValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1606
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>BlastReadingFrameValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1607
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>GeneMergeValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='comma'>,</span> <span class='id identifier rubyid_plot_path'>plot_path</span><span class='rparen'>)</span>
1608
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>DuplicationValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='comma'>,</span> <span class='ivar'>@mafft_path</span><span class='comma'>,</span> <span class='ivar'>@raw_seq_file_index</span><span class='rparen'>)</span>
1609
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>OpenReadingFrameValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='comma'>,</span> <span class='id identifier rubyid_plot_path'>plot_path</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ATG</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1610
- <span class='id identifier rubyid_validations'>validations</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>AlignmentValidation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='comma'>,</span> <span class='id identifier rubyid_plot_path'>plot_path</span><span class='comma'>,</span> <span class='ivar'>@mafft_path</span><span class='comma'>,</span> <span class='ivar'>@raw_seq_file_index</span><span class='rparen'>)</span>
1611
-
1612
- <span class='comment'># check the class type of the elements in the list
1613
- </span> <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>
1614
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ValidationClassError</span> <span class='kw'>unless</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>ValidationTest</span>
1615
- <span class='kw'>end</span>
1616
-
1617
- <span class='comment'># check alias duplication
1618
- </span> <span class='kw'>unless</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_cli_name'>cli_name</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</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_cli_name'>cli_name</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1619
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>AliasDuplicationError</span>
1620
- <span class='kw'>end</span>
1621
-
1622
- <span class='kw'>if</span> <span class='id identifier rubyid_vlist'>vlist</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_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>all</span><span class='tstring_end'>&quot;</span></span>
1623
- <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_run'>run</span><span class='rbrace'>}</span>
1624
- <span class='comment'># check the class type of the validation reports
1625
- </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>
1626
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ReportClassError</span> <span class='kw'>unless</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_is_a?'>is_a?</span> <span class='const'>ValidationReport</span>
1627
- <span class='kw'>end</span>
1628
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</span>
1629
- <span class='kw'>else</span>
1630
- <span class='id identifier rubyid_desired_validations'>desired_validations</span> <span class='op'>=</span> <span class='id identifier rubyid_validations'>validations</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_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_vlist'>vlist</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_vv'>vv</span><span class='op'>|</span> <span class='id identifier rubyid_vv'>vv</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_cli_name'>cli_name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
1631
- <span class='id identifier rubyid_desired_validations'>desired_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>
1632
- <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
1633
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ReportClassError</span> <span class='kw'>unless</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_is_a?'>is_a?</span> <span class='const'>ValidationReport</span>
1634
- <span class='kw'>end</span>
1635
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_validations'>validations</span> <span class='op'>=</span> <span class='id identifier rubyid_desired_validations'>desired_validations</span>
1636
- <span class='kw'>if</span> <span class='id identifier rubyid_query_output'>query_output</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> <span class='op'>==</span> <span class='int'>0</span>
1637
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NoValidationError</span>
1638
- <span class='kw'>end</span>
1639
- <span class='kw'>end</span>
1640
-
1641
- <span class='kw'>rescue</span> <span class='const'>ValidationClassError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1642
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Class Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1643
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: type of one of the validations is not ValidationTest\n</span><span class='tstring_end'>&quot;</span></span>
1644
- <span class='id identifier rubyid_exit!'>exit!</span>
1645
- <span class='kw'>rescue</span> <span class='const'>NoValidationError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1646
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Validation error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1647
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: your -v arguments are not valid aliases\n</span><span class='tstring_end'>&quot;</span></span>
1648
- <span class='id identifier rubyid_exit!'>exit!</span>
1649
- <span class='kw'>rescue</span> <span class='const'>ReportClassError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1650
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Class Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1651
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: type of one of the validation reports returned by the 'run' method is not ValidationReport\n</span><span class='tstring_end'>&quot;</span></span>
1652
- <span class='id identifier rubyid_exit!'>exit!</span>
1653
- <span class='kw'>rescue</span> <span class='const'>AliasDuplicationError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1654
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Alias Duplication error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1655
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: At least two validations have the same CLI alias\n</span><span class='tstring_end'>&quot;</span></span>
1656
- <span class='id identifier rubyid_exit!'>exit!</span>
1657
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1658
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>.\n</span><span class='tstring_end'>&quot;</span></span>
1659
- <span class='id identifier rubyid_exit!'>exit!</span>
1660
- <span class='kw'>end</span>
1661
-
1662
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_generate_html'>generate_html</span>
1663
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_print_output_console'>print_output_console</span>
1664
- <span class='id identifier rubyid_query_output'>query_output</span><span class='period'>.</span><span class='id identifier rubyid_print_output_file_yaml'>print_output_file_yaml</span>
1665
- <span class='ivar'>@all_query_outputs</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_query_output'>query_output</span><span class='rparen'>)</span>
1666
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1667
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>.\n</span><span class='tstring_end'>&quot;</span></span>
1668
- <span class='id identifier rubyid_exit'>exit</span>
1669
- <span class='kw'>end</span>
1670
-
1671
- <span class='kw'>end</span></pre>
1672
- </td>
1673
- </tr>
1674
- </table>
1675
- </div>
1676
-
1677
- <div class="method_details ">
1678
- <h3 class="signature " id="parse_output-instance_method">
1679
-
1680
- - (<tt>Object</tt>) <strong>parse_output</strong>(output)
1681
-
1682
-
1683
-
1684
-
1685
-
1686
- </h3><div class="docstring">
1687
- <div class="discussion">
1688
-
1689
- <p>Parses the blast output: autodetect the format: xml or tabular Param:
1690
- <tt>output</tt>: <tt>String</tt> with the blast output</p>
1691
-
1692
-
1693
- </div>
1694
- </div>
1695
- <div class="tags">
1696
-
1697
-
1698
- </div><table class="source_code">
1699
- <tr>
1700
- <td>
1701
- <pre class="lines">
1702
-
1703
-
1704
- 205
1705
- 206
1706
- 207
1707
- 208
1708
- 209
1709
- 210
1710
- 211
1711
- 212
1712
- 213
1713
- 214
1714
- 215
1715
- 216
1716
- 217
1717
- 218
1718
- 219
1719
- 220
1720
- 221
1721
- 222
1722
- 223
1723
- 224
1724
- 225
1725
- 226
1726
- 227
1727
- 228
1728
- 229
1729
- 230
1730
- 231
1731
- 232
1732
- 233
1733
- 234
1734
- 235
1735
- 236
1736
- 237
1737
- 238
1738
- 239
1739
- 240
1740
- 241
1741
- 242
1742
- 243
1743
- 244
1744
- 245
1745
- 246
1746
- 247
1747
- 248
1748
- 249
1749
- 250
1750
- 251
1751
- 252
1752
- 253
1753
- 254
1754
- 255
1755
- 256
1756
- 257
1757
- 258
1758
- 259
1759
- 260
1760
- 261
1761
- 262
1762
- 263
1763
- 264
1764
- 265
1765
- 266
1766
- 267
1767
- 268
1768
- 269
1769
- 270
1770
- 271
1771
- 272
1772
- 273
1773
- 274
1774
- 275
1775
- 276
1776
- 277
1777
- 278
1778
- 279
1779
- 280
1780
- 281
1781
- 282</pre>
1782
- </td>
1783
- <td>
1784
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 205</span>
1785
-
1786
- <span class='kw'>def</span> <span class='id identifier rubyid_parse_output'>parse_output</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
1787
- <span class='kw'>begin</span>
1788
- <span class='id identifier rubyid_iterator_xml'>iterator_xml</span> <span class='op'>=</span> <span class='const'>Bio</span><span class='op'>::</span><span class='const'>BlastXMLParser</span><span class='op'>::</span><span class='const'>NokogiriBlastXml</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_enum'>to_enum</span>
1789
- <span class='id identifier rubyid_iterator_tab'>iterator_tab</span> <span class='op'>=</span> <span class='const'>TabularParser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='comma'>,</span> <span class='id identifier rubyid_tabular_format'>tabular_format</span><span class='comma'>,</span> <span class='ivar'>@type</span><span class='rparen'>)</span>
1790
- <span class='id identifier rubyid_input_file_type'>input_file_type</span> <span class='op'>=</span> <span class='symbol'>:xml</span>
1791
- <span class='kw'>begin</span>
1792
- <span class='comment'># get info about the query
1793
- </span> <span class='comment'># get the @idx-th sequence from the fasta file
1794
- </span>
1795
- <span class='id identifier rubyid_prediction'>prediction</span> <span class='op'>=</span> <span class='const'>Sequence</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1796
- <span class='kw'>if</span> <span class='ivar'>@idx</span><span class='op'>+</span><span class='int'>1</span> <span class='op'>==</span> <span class='ivar'>@query_offset_lst</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1797
- <span class='kw'>break</span>
1798
- <span class='kw'>end</span>
1799
- <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_binread'>binread</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='comma'>,</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='ivar'>@idx</span><span class='op'>+</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='ivar'>@idx</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='ivar'>@idx</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1800
- <span class='id identifier rubyid_parse_query'>parse_query</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</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'>&gt;([^\n]*)\n([A-Za-z\n]*)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
1801
-
1802
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_query'>parse_query</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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_end'>&quot;</span></span><span class='rparen'>)</span>
1803
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1804
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='ivar'>@type</span>
1805
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_raw_sequence'>raw_sequence</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_query'>parse_query</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</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_end'>&quot;</span></span><span class='rparen'>)</span>
1806
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_length_protein'>length_protein</span> <span class='op'>=</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_raw_sequence'>raw_sequence</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1807
-
1808
- <span class='kw'>if</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='symbol'>:nucleotide</span>
1809
- <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_length_protein'>length_protein</span> <span class='op'>/=</span> <span class='int'>3</span>
1810
- <span class='kw'>end</span>
1811
-
1812
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='ivar'>@idx</span> <span class='op'>+</span> <span class='int'>1</span>
1813
-
1814
- <span class='kw'>begin</span>
1815
- <span class='kw'>if</span> <span class='id identifier rubyid_input_file_type'>input_file_type</span> <span class='op'>==</span> <span class='symbol'>:xml</span>
1816
- <span class='comment'># check xml format
1817
- </span> <span class='kw'>if</span> <span class='ivar'>@idx</span> <span class='op'>&lt;</span> <span class='ivar'>@start_idx</span>
1818
- <span class='id identifier rubyid_iter'>iter</span> <span class='op'>=</span> <span class='id identifier rubyid_iterator_xml'>iterator_xml</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span>
1819
- <span class='kw'>else</span>
1820
- <span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='const'>BlastUtils</span><span class='period'>.</span><span class='id identifier rubyid_parse_next_query_xml'>parse_next_query_xml</span><span class='lparen'>(</span><span class='id identifier rubyid_iterator_xml'>iterator_xml</span><span class='comma'>,</span> <span class='ivar'>@type</span><span class='rparen'>)</span>
1821
- <span class='kw'>if</span> <span class='id identifier rubyid_hits'>hits</span> <span class='op'>==</span> <span class='kw'>nil</span>
1822
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='ivar'>@idx</span> <span class='op'>-</span><span class='int'>1</span>
1823
- <span class='kw'>break</span>
1824
- <span class='kw'>end</span>
1825
- <span class='id identifier rubyid_do_validations'>do_validations</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1826
- <span class='kw'>end</span>
1827
- <span class='kw'>else</span>
1828
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exception</span>
1829
- <span class='kw'>end</span>
1830
- <span class='kw'>rescue</span> <span class='const'>SequenceTypeError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1831
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Sequence Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1832
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: the blast output was not obtained against a protein database.\n</span><span class='tstring_end'>&quot;</span></span>
1833
- <span class='id identifier rubyid_exit!'>exit!</span>
1834
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1835
- <span class='kw'>begin</span>
1836
- <span class='id identifier rubyid_input_file_type'>input_file_type</span> <span class='op'>=</span> <span class='symbol'>:tabular</span>
1837
- <span class='kw'>if</span> <span class='ivar'>@tabular_format</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='ivar'>@xml_file</span><span class='op'>!=</span> <span class='kw'>nil</span>
1838
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Note: Please specify the --tabular argument if you used tabular format input with nonstandard columns.\n</span><span class='tstring_end'>&quot;</span></span>
1839
- <span class='kw'>end</span>
1840
- <span class='comment'>#check tabular format
1841
- </span> <span class='kw'>if</span> <span class='ivar'>@idx</span> <span class='op'>&lt;</span> <span class='ivar'>@start_idx</span>
1842
- <span class='id identifier rubyid_iterator_tab'>iterator_tab</span><span class='period'>.</span><span class='id identifier rubyid_jump_next'>jump_next</span>
1843
- <span class='kw'>else</span>
1844
- <span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='id identifier rubyid_iterator_tab'>iterator_tab</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_identifier'>identifier</span><span class='rparen'>)</span>
1845
- <span class='kw'>if</span> <span class='id identifier rubyid_hits'>hits</span> <span class='op'>==</span> <span class='kw'>nil</span>
1846
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='ivar'>@idx</span> <span class='op'>-</span><span class='int'>1</span>
1847
- <span class='kw'>break</span>
1848
- <span class='kw'>end</span>
1849
- <span class='id identifier rubyid_do_validations'>do_validations</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1850
- <span class='kw'>end</span>
1851
- <span class='kw'>rescue</span> <span class='const'>SequenceTypeError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1852
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Sequence Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1853
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: the blast output was not obtained against a protein database.\n</span><span class='tstring_end'>&quot;</span></span>
1854
- <span class='id identifier rubyid_exit!'>exit!</span>
1855
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
1856
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Blast file error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
1857
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: blast output file format is neihter xml nor tabular.\n</span><span class='tstring_end'>&quot;</span></span>
1858
- <span class='id identifier rubyid_exit!'>exit!</span>
1859
- <span class='kw'>end</span>
1860
- <span class='kw'>end</span>
1861
- <span class='kw'>end</span> <span class='kw'>while</span> <span class='int'>1</span>
1862
- <span class='kw'>end</span>
1863
- <span class='kw'>end</span></pre>
1864
- </td>
1865
- </tr>
1866
- </table>
1867
- </div>
1868
-
1869
- <div class="method_details ">
1870
- <h3 class="signature " id="remove_identical_hits-instance_method">
1871
-
1872
- - (<tt>Object</tt>) <strong>remove_identical_hits</strong>(prediction, hits)
1873
-
1874
-
1875
-
1876
-
1877
-
1878
- </h3><div class="docstring">
1879
- <div class="discussion">
1880
-
1881
- <p>Removes identical hits Params: <tt>prediction</tt>: Sequence object
1882
- <tt>hits</tt>: Array of <tt>Sequence</tt> objects Output: new array of hit
1883
- <tt>Sequence</tt> objects</p>
1884
-
1885
-
1886
- </div>
1887
- </div>
1888
- <div class="tags">
1889
-
1890
-
1891
- </div><table class="source_code">
1892
- <tr>
1893
- <td>
1894
- <pre class="lines">
1895
-
1896
-
1897
- 291
1898
- 292
1899
- 293
1900
- 294
1901
- 295
1902
- 296
1903
- 297
1904
- 298
1905
- 299
1906
- 300
1907
- 301
1908
- 302
1909
- 303
1910
- 304
1911
- 305
1912
- 306
1913
- 307
1914
- 308
1915
- 309
1916
- 310
1917
- 311</pre>
1918
- </td>
1919
- <td>
1920
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 291</span>
1921
-
1922
- <span class='kw'>def</span> <span class='id identifier rubyid_remove_identical_hits'>remove_identical_hits</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_hits'>hits</span><span class='rparen'>)</span>
1923
- <span class='comment'># remove the identical hits
1924
- </span> <span class='comment'># identical hit means 100%coverage and &gt;99% identity
1925
- </span> <span class='id identifier rubyid_identical_hits'>identical_hits</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1926
- <span class='id identifier rubyid_hits'>hits</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_hit'>hit</span><span class='op'>|</span>
1927
- <span class='comment'># check if all hsps have identity more than 99%
1928
- </span> <span class='id identifier rubyid_low_identity'>low_identity</span> <span class='op'>=</span> <span class='id identifier rubyid_hit'>hit</span><span class='period'>.</span><span class='id identifier rubyid_hsp_list'>hsp_list</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_hsp'>hsp</span><span class='op'>|</span> <span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_pidentity'>pidentity</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='kw'>or</span> <span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_pidentity'>pidentity</span> <span class='op'>&lt;</span> <span class='int'>99</span><span class='rbrace'>}</span>
1929
- <span class='comment'># check the coverage
1930
- </span> <span class='id identifier rubyid_coverage'>coverage</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_length_protein'>length_protein</span><span class='comma'>,</span><span class='int'>0</span><span class='rparen'>)</span>
1931
- <span class='id identifier rubyid_hit'>hit</span><span class='period'>.</span><span class='id identifier rubyid_hsp_list'>hsp_list</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_hsp'>hsp</span><span class='op'>|</span>
1932
- <span class='id identifier rubyid_len'>len</span> <span class='op'>=</span> <span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_match_query_to'>match_query_to</span> <span class='op'>-</span> <span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_match_query_from'>match_query_from</span> <span class='op'>+</span> <span class='int'>1</span>
1933
- <span class='id identifier rubyid_coverage'>coverage</span><span class='lbracket'>[</span><span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_match_query_from'>match_query_from</span><span class='op'>-</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_match_query_to'>match_query_to</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_len'>len</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
1934
- <span class='kw'>end</span>
1935
- <span class='kw'>if</span> <span class='id identifier rubyid_low_identity'>low_identity</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span> <span class='kw'>and</span> <span class='id identifier rubyid_coverage'>coverage</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span>
1936
- <span class='id identifier rubyid_identical_hits'>identical_hits</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_hit'>hit</span><span class='rparen'>)</span>
1937
- <span class='kw'>end</span>
1938
- <span class='kw'>end</span>
1939
-
1940
- <span class='id identifier rubyid_identical_hits'>identical_hits</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_hit'>hit</span><span class='op'>|</span> <span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_hit'>hit</span><span class='rparen'>)</span><span class='rbrace'>}</span>
1941
- <span class='kw'>return</span> <span class='id identifier rubyid_hits'>hits</span>
1942
- <span class='kw'>end</span></pre>
1943
- </td>
1944
- </tr>
1945
- </table>
1946
- </div>
1947
-
1948
- <div class="method_details ">
1949
- <h3 class="signature " id="validation-instance_method">
1950
-
1951
- - (<tt>Object</tt>) <strong>validation</strong>
1952
-
1953
-
1954
-
1955
-
1956
-
1957
- </h3><div class="docstring">
1958
- <div class="discussion">
1959
-
1960
- <p>Parse the blast output and run validations</p>
1961
-
1962
-
1963
- </div>
1964
- </div>
1965
- <div class="tags">
1966
-
1967
-
1968
- </div><table class="source_code">
1969
- <tr>
1970
- <td>
1971
- <pre class="lines">
1972
-
1973
-
1974
- 151
1975
- 152
1976
- 153
1977
- 154
1978
- 155
1979
- 156
1980
- 157
1981
- 158
1982
- 159
1983
- 160
1984
- 161
1985
- 162
1986
- 163
1987
- 164
1988
- 165
1989
- 166
1990
- 167
1991
- 168
1992
- 169
1993
- 170
1994
- 171
1995
- 172
1996
- 173
1997
- 174
1998
- 175
1999
- 176
2000
- 177
2001
- 178
2002
- 179
2003
- 180
2004
- 181
2005
- 182
2006
- 183
2007
- 184
2008
- 185
2009
- 186
2010
- 187
2011
- 188
2012
- 189
2013
- 190
2014
- 191
2015
- 192
2016
- 193
2017
- 194
2018
- 195
2019
- 196
2020
- 197
2021
- 198
2022
- 199</pre>
2023
- </td>
2024
- <td>
2025
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 151</span>
2026
-
2027
- <span class='kw'>def</span> <span class='id identifier rubyid_validation'>validation</span>
2028
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\nDepending on your input and your computational </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
2029
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>resources, this may take a while. Please wait...</span><span class='tstring_end'>&quot;</span></span>
2030
- <span class='kw'>begin</span>
2031
- <span class='kw'>if</span> <span class='ivar'>@xml_file</span> <span class='op'>==</span> <span class='kw'>nil</span>
2032
-
2033
- <span class='comment'>#file seek for each query
2034
- </span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='ivar'>@query_offset_lst</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</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_pos'>pos</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
2035
-
2036
- <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='op'>+</span><span class='int'>1</span><span class='rparen'>)</span> <span class='op'>&gt;=</span> <span class='ivar'>@start_idx</span>
2037
- <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_binread'>binread</span><span class='lparen'>(</span><span class='ivar'>@fasta_filepath</span><span class='comma'>,</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='op'>+</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@query_offset_lst</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='semicolon'>;</span>
2038
-
2039
- <span class='comment'>#call blast with the default parameters
2040
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:protein</span>
2041
- <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='const'>BlastUtils</span><span class='period'>.</span><span class='id identifier rubyid_call_blast_from_stdin'>call_blast_from_stdin</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>blastp</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='int'>11</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
2042
- <span class='kw'>else</span>
2043
- <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='const'>BlastUtils</span><span class='period'>.</span><span class='id identifier rubyid_call_blast_from_stdin'>call_blast_from_stdin</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>blastx</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='int'>11</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
2044
- <span class='kw'>end</span>
2045
-
2046
- <span class='comment'>#save output in a file
2047
- </span> <span class='comment'>#xml_file = &quot;blast/#{@fasta_filepath}_#{i+1}.xml&quot;
2048
- </span> <span class='comment'>#File.open(xml_file , &quot;w&quot;) do |f| f.write(output) end
2049
- </span>
2050
- <span class='comment'>#parse output
2051
- </span> <span class='id identifier rubyid_parse_output'>parse_output</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
2052
- <span class='kw'>else</span>
2053
- <span class='ivar'>@idx</span> <span class='op'>=</span> <span class='ivar'>@idx</span> <span class='op'>+</span> <span class='int'>1</span>
2054
- <span class='kw'>end</span>
2055
- <span class='kw'>end</span>
2056
- <span class='kw'>else</span>
2057
- <span class='id identifier rubyid_file'>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='ivar'>@xml_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
2058
- <span class='comment'>#check the format of the input file
2059
- </span> <span class='id identifier rubyid_parse_output'>parse_output</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
2060
- <span class='kw'>end</span>
2061
- <span class='const'>Output</span><span class='period'>.</span><span class='id identifier rubyid_print_footer'>print_footer</span><span class='lparen'>(</span><span class='ivar'>@all_query_outputs</span><span class='comma'>,</span> <span class='ivar'>@html_path</span><span class='rparen'>)</span>
2062
-
2063
- <span class='kw'>rescue</span> <span class='const'>SystemCallError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
2064
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Load error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
2065
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: input file is not valid\n</span><span class='tstring_end'>&quot;</span></span>
2066
- <span class='id identifier rubyid_exit'>exit</span>
2067
- <span class='kw'>rescue</span> <span class='const'>SequenceTypeError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
2068
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Sequence Type error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>. </span><span class='tstring_end'>&quot;</span></span><span class='op'>&lt;&lt;</span>
2069
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Possible cause: the blast output was not obtained against a protein database.\n</span><span class='tstring_end'>&quot;</span></span>
2070
- <span class='id identifier rubyid_exit!'>exit!</span>
2071
- <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_error'>error</span>
2072
- <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</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'>\/([^\/]+:\d+):.*</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='rbrace'>}</span><span class='tstring_content'>.\n</span><span class='tstring_end'>&quot;</span></span>
2073
- <span class='id identifier rubyid_exit!'>exit!</span>
2074
- <span class='kw'>end</span>
2075
- <span class='kw'>end</span></pre>
2076
- </td>
2077
- </tr>
2078
- </table>
2079
- </div>
2080
-
2081
- <div class="method_details ">
2082
- <h3 class="signature " id="which-instance_method">
2083
-
2084
- - (<tt>Object</tt>) <strong>which</strong>(cmd)
2085
-
2086
-
2087
-
2088
-
2089
-
2090
- </h3><div class="docstring">
2091
- <div class="discussion">
2092
-
2093
- <p>The ruby equivalent for 'which' command in unix</p>
2094
-
2095
-
2096
- </div>
2097
- </div>
2098
- <div class="tags">
2099
-
2100
-
2101
- </div><table class="source_code">
2102
- <tr>
2103
- <td>
2104
- <pre class="lines">
2105
-
2106
-
2107
- 409
2108
- 410
2109
- 411
2110
- 412
2111
- 413
2112
- 414
2113
- 415
2114
- 416
2115
- 417
2116
- 418</pre>
2117
- </td>
2118
- <td>
2119
- <pre class="code"><span class="info file"># File 'lib/genevalidator/validation.rb', line 409</span>
2120
-
2121
- <span class='kw'>def</span> <span class='id identifier rubyid_which'>which</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
2122
- <span class='id identifier rubyid_exts'>exts</span> <span class='op'>=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATHEXT</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATHEXT</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>;</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
2123
- <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='const'>File</span><span class='op'>::</span><span class='const'>PATH_SEPARATOR</span><span class='rparen'>)</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_path'>path</span><span class='op'>|</span>
2124
- <span class='id identifier rubyid_exts'>exts</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_ext'>ext</span><span class='op'>|</span>
2125
- <span class='id identifier rubyid_exe'>exe</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ext'>ext</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
2126
- <span class='kw'>return</span> <span class='id identifier rubyid_exe'>exe</span> <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_executable?'>executable?</span> <span class='id identifier rubyid_exe'>exe</span>
2127
- <span class='rbrace'>}</span>
2128
- <span class='kw'>end</span>
2129
- <span class='kw'>return</span> <span class='kw'>nil</span>
2130
- <span class='kw'>end</span></pre>
2131
- </td>
2132
- </tr>
2133
- </table>
2134
- </div>
2135
-
2136
- </div>
2137
-
2138
- </div>
2139
-
2140
- <div id="footer">
2141
- Generated on Sat Sep 28 07:01:32 2013 by
2142
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2143
- 0.8.7.2 (ruby-1.9.3).
2144
- </div>
2145
-
2146
- </body>
2147
- </html>