genevalidator 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.travis.yml +2 -0
- data/README.md +78 -30
- data/Rakefile +11 -8
- data/aux/app_template_footer.erb +1 -6
- data/aux/app_template_header.erb +12 -32
- data/aux/files/css/style.css +2 -8
- data/aux/files/js/plots.js +564 -576
- data/aux/files/js/script.js +10 -0
- data/aux/json_footer.erb +8 -0
- data/aux/json_header.erb +19 -0
- data/aux/json_query.erb +14 -0
- data/aux/template_footer.erb +9 -58
- data/aux/template_header.erb +18 -58
- data/aux/template_query.erb +8 -36
- data/bin/genevalidator +45 -32
- data/genevalidator.gemspec +11 -7
- data/lib/genevalidator.rb +75 -455
- data/lib/genevalidator/arg_validation.rb +78 -107
- data/lib/genevalidator/blast.rb +57 -60
- data/lib/genevalidator/clusterization.rb +15 -15
- data/lib/genevalidator/exceptions.rb +32 -5
- data/lib/genevalidator/get_raw_sequences.rb +70 -33
- data/lib/genevalidator/hsp.rb +1 -4
- data/lib/genevalidator/json_to_gv_results.rb +109 -0
- data/lib/genevalidator/output.rb +177 -185
- data/lib/genevalidator/pool.rb +2 -1
- data/lib/genevalidator/sequences.rb +3 -3
- data/lib/genevalidator/tabular_parser.rb +24 -18
- data/lib/genevalidator/validation.rb +279 -0
- data/lib/genevalidator/validation_alignment.rb +31 -47
- data/lib/genevalidator/validation_blast_reading_frame.rb +19 -18
- data/lib/genevalidator/validation_duplication.rb +23 -19
- data/lib/genevalidator/validation_gene_merge.rb +30 -65
- data/lib/genevalidator/validation_length_cluster.rb +14 -53
- data/lib/genevalidator/validation_length_rank.rb +10 -11
- data/lib/genevalidator/validation_open_reading_frame.rb +18 -19
- data/lib/genevalidator/validation_report.rb +2 -5
- data/lib/genevalidator/validation_test.rb +8 -4
- data/lib/genevalidator/version.rb +1 -1
- data/test/test_all_validations.rb +51 -66
- data/test/test_blast.rb +68 -51
- data/test/test_clusterization.rb +1 -1
- data/test/test_clusterization_2d.rb +19 -13
- data/test/test_extended_array_methods.rb +1 -1
- data/test/test_files/all_validations_mrna/mrna.blast_tab6 +1806 -0
- data/test/test_files/all_validations_mrna/mrna.blast_tab7 +1865 -0
- data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml → mrna.blast_xml} +18642 -1
- data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.index → mrna.blast_xml.index} +300 -0
- data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta → mrna.fa} +0 -0
- data/test/test_files/all_validations_mrna/mrna.raw_seq +3970 -0
- data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.raw_seq.idx → mrna.raw_seq.idx} +901 -1
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_tab → prot.blast_tab6} +416 -0
- data/test/test_files/all_validations_prot/prot.blast_tab7 +2400 -0
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml → prot.blast_xml} +18299 -6723
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.index → prot.blast_xml.index} +408 -0
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta → prot.fa} +0 -0
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq → prot.raw_seq} +2735 -0
- data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq.idx → prot.raw_seq.idx} +3032 -1808
- data/test/test_sequences.rb +46 -41
- data/test/test_validation_open_reading_frame.rb +318 -202
- data/test/test_validations.rb +48 -32
- metadata +76 -102
- data/doc/AliasDuplicationError.html +0 -134
- data/doc/AlignmentValidation.html +0 -1687
- data/doc/AlignmentValidationOutput.html +0 -659
- data/doc/Blast.html +0 -1905
- data/doc/BlastRFValidationOutput.html +0 -545
- data/doc/BlastReadingFrameValidation.html +0 -370
- data/doc/BlastUtils.html +0 -875
- data/doc/ClasspathError.html +0 -134
- data/doc/Cluster.html +0 -1316
- data/doc/DuplciationValidationOutput.html +0 -564
- data/doc/DuplicationValidation.html +0 -920
- data/doc/DuplicationValidationOutput.html +0 -564
- data/doc/FileNotFoundException.html +0 -134
- data/doc/GeneMergeValidation.html +0 -935
- data/doc/GeneMergeValidationOutput.html +0 -652
- data/doc/HierarchicalClusterization.html +0 -994
- data/doc/Hsp.html +0 -1485
- data/doc/InconsistentTabularFormat.html +0 -135
- data/doc/LengthClusterValidation.html +0 -982
- data/doc/LengthClusterValidationOutput.html +0 -515
- data/doc/LengthRankValidation.html +0 -496
- data/doc/LengthRankValidationOutput.html +0 -517
- data/doc/NoInternetError.html +0 -135
- data/doc/NoMafftInstallationError.html +0 -134
- data/doc/NoPIdentError.html +0 -134
- data/doc/NoValidationError.html +0 -134
- data/doc/NotEnoughHitsError.html +0 -135
- data/doc/ORFValidationOutput.html +0 -593
- data/doc/OpenReadingFrameValidation.html +0 -1107
- data/doc/OtherError.html +0 -123
- data/doc/Output.html +0 -1540
- data/doc/Pair.html +0 -309
- data/doc/PairCluster.html +0 -767
- data/doc/Plot.html +0 -837
- data/doc/QueryError.html +0 -134
- data/doc/ReportClassError.html +0 -135
- data/doc/Sequence.html +0 -1299
- data/doc/SequenceTypeError.html +0 -135
- data/doc/TabularEntry.html +0 -837
- data/doc/TabularParser.html +0 -1104
- data/doc/Validation.html +0 -2147
- data/doc/ValidationClassError.html +0 -134
- data/doc/ValidationOutput.html +0 -460
- data/doc/ValidationReport.html +0 -940
- data/doc/ValidationTest.html +0 -939
- data/doc/_index.html +0 -449
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -338
- data/doc/file.README.html +0 -151
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -151
- data/doc/js/app.js +0 -214
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1505
- data/doc/top-level-namespace.html +0 -112
- data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab +0 -967
- data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.index +0 -967
- data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq +0 -4929
- data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq.idx +0 -1006
- data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_xml.raw_seq +0 -2075
- data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.index +0 -1864
- data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq +0 -42411
- data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq.idx +0 -3751
data/doc/TabularParser.html
DELETED
@@ -1,1104 +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: TabularParser
|
8
|
-
|
9
|
-
— 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 (T)</a> »
|
35
|
-
|
36
|
-
|
37
|
-
<span class="title">TabularParser</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: TabularParser
|
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">TabularParser</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/tabular_parser.rb</dd>
|
98
|
-
|
99
|
-
</dl>
|
100
|
-
<div class="clear"></div>
|
101
|
-
|
102
|
-
<h2>Overview</h2><div class="docstring">
|
103
|
-
<div class="discussion">
|
104
|
-
|
105
|
-
<p>This class parses the tabular output of BLAST (outfmt 6)</p>
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
|
112
|
-
|
113
|
-
</div>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
118
|
-
<ul class="summary">
|
119
|
-
|
120
|
-
<li class="public ">
|
121
|
-
<span class="summary_signature">
|
122
|
-
|
123
|
-
<a href="#column_names-instance_method" title="#column_names (instance method)">- (Object) <strong>column_names</strong> </a>
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
</span>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
<span class="note title readonly">readonly</span>
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
<span class="summary_desc"><div class='inline'>
|
143
|
-
<p>Returns the value of attribute column_names.</p>
|
144
|
-
</div></span>
|
145
|
-
|
146
|
-
</li>
|
147
|
-
|
148
|
-
|
149
|
-
<li class="public ">
|
150
|
-
<span class="summary_signature">
|
151
|
-
|
152
|
-
<a href="#content-instance_method" title="#content (instance method)">- (Object) <strong>content</strong> </a>
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
</span>
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
<span class="note title readonly">readonly</span>
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<span class="summary_desc"><div class='inline'>
|
172
|
-
<p>Returns the value of attribute content.</p>
|
173
|
-
</div></span>
|
174
|
-
|
175
|
-
</li>
|
176
|
-
|
177
|
-
|
178
|
-
<li class="public ">
|
179
|
-
<span class="summary_signature">
|
180
|
-
|
181
|
-
<a href="#content_iterator-instance_method" title="#content_iterator (instance method)">- (Object) <strong>content_iterator</strong> </a>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</span>
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
<span class="note title readonly">readonly</span>
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
<span class="summary_desc"><div class='inline'>
|
201
|
-
<p>Returns the value of attribute content_iterator.</p>
|
202
|
-
</div></span>
|
203
|
-
|
204
|
-
</li>
|
205
|
-
|
206
|
-
|
207
|
-
<li class="public ">
|
208
|
-
<span class="summary_signature">
|
209
|
-
|
210
|
-
<a href="#format-instance_method" title="#format (instance method)">- (Object) <strong>format</strong> </a>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
</span>
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
<span class="note title readonly">readonly</span>
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
<span class="summary_desc"><div class='inline'>
|
230
|
-
<p>Returns the value of attribute format.</p>
|
231
|
-
</div></span>
|
232
|
-
|
233
|
-
</li>
|
234
|
-
|
235
|
-
|
236
|
-
<li class="public ">
|
237
|
-
<span class="summary_signature">
|
238
|
-
|
239
|
-
<a href="#hit_id_idx-instance_method" title="#hit_id_idx (instance method)">- (Object) <strong>hit_id_idx</strong> </a>
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
</span>
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
<span class="note title readonly">readonly</span>
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
<span class="summary_desc"><div class='inline'>
|
259
|
-
<p>Returns the value of attribute hit_id_idx.</p>
|
260
|
-
</div></span>
|
261
|
-
|
262
|
-
</li>
|
263
|
-
|
264
|
-
|
265
|
-
<li class="public ">
|
266
|
-
<span class="summary_signature">
|
267
|
-
|
268
|
-
<a href="#query_id_idx-instance_method" title="#query_id_idx (instance method)">- (Object) <strong>query_id_idx</strong> </a>
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
</span>
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
<span class="note title readonly">readonly</span>
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
<span class="summary_desc"><div class='inline'>
|
288
|
-
<p>Returns the value of attribute query_id_idx.</p>
|
289
|
-
</div></span>
|
290
|
-
|
291
|
-
</li>
|
292
|
-
|
293
|
-
|
294
|
-
<li class="public ">
|
295
|
-
<span class="summary_signature">
|
296
|
-
|
297
|
-
<a href="#type-instance_method" title="#type (instance method)">- (Object) <strong>type</strong> </a>
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
</span>
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
<span class="note title readonly">readonly</span>
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
<span class="summary_desc"><div class='inline'>
|
317
|
-
<p>Returns the value of attribute type.</p>
|
318
|
-
</div></span>
|
319
|
-
|
320
|
-
</li>
|
321
|
-
|
322
|
-
|
323
|
-
</ul>
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
<h2>
|
330
|
-
Instance Method Summary
|
331
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
332
|
-
</h2>
|
333
|
-
|
334
|
-
<ul class="summary">
|
335
|
-
|
336
|
-
<li class="public ">
|
337
|
-
<span class="summary_signature">
|
338
|
-
|
339
|
-
<a href="#has_next-instance_method" title="#has_next (instance method)">- (Object) <strong>has_next</strong> </a>
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
</span>
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
<span class="summary_desc"><div class='inline'>
|
354
|
-
<p>Returns true if there are more hits in the tabular file.</p>
|
355
|
-
</div></span>
|
356
|
-
|
357
|
-
</li>
|
358
|
-
|
359
|
-
|
360
|
-
<li class="public ">
|
361
|
-
<span class="summary_signature">
|
362
|
-
|
363
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (TabularParser) <strong>initialize</strong>(content, format, type) </a>
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
</span>
|
368
|
-
|
369
|
-
|
370
|
-
<span class="note title constructor">constructor</span>
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
<span class="summary_desc"><div class='inline'>
|
380
|
-
<p>Initializes the object <tt>content</tt> : String with the tabular BLAST
|
381
|
-
output <tt>format</tt>: format of the tabular output (string with column
|
382
|
-
sepatared by space or coma) <tt>type</tt>: :nucleotide or :mrna.</p>
|
383
|
-
</div></span>
|
384
|
-
|
385
|
-
</li>
|
386
|
-
|
387
|
-
|
388
|
-
<li class="public ">
|
389
|
-
<span class="summary_signature">
|
390
|
-
|
391
|
-
<a href="#jump_next-instance_method" title="#jump_next (instance method)">- (Object) <strong>jump_next</strong> </a>
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
</span>
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
<span class="summary_desc"><div class='inline'>
|
406
|
-
<p>Jumps to the next query.</p>
|
407
|
-
</div></span>
|
408
|
-
|
409
|
-
</li>
|
410
|
-
|
411
|
-
|
412
|
-
<li class="public ">
|
413
|
-
<span class="summary_signature">
|
414
|
-
|
415
|
-
<a href="#next-instance_method" title="#next (instance method)">- (Object) <strong>next</strong>(identifier = nil) </a>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
</span>
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
<span class="summary_desc"><div class='inline'>
|
430
|
-
<p>Returns the next query output <tt>identifier</tt>: <tt>String</tt>, the
|
431
|
-
identifier of the next expected query if the identifier is nil, it takes
|
432
|
-
the next query Output: Array of <tt>Sequence</tt> objects corresponding to
|
433
|
-
hits.</p>
|
434
|
-
</div></span>
|
435
|
-
|
436
|
-
</li>
|
437
|
-
|
438
|
-
|
439
|
-
</ul>
|
440
|
-
|
441
|
-
|
442
|
-
<div id="constructor_details" class="method_details_list">
|
443
|
-
<h2>Constructor Details</h2>
|
444
|
-
|
445
|
-
<div class="method_details first">
|
446
|
-
<h3 class="signature first" id="initialize-instance_method">
|
447
|
-
|
448
|
-
- (<tt><span class='object_link'><a href="" title="TabularParser (class)">TabularParser</a></span></tt>) <strong>initialize</strong>(content, format, type)
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
</h3><div class="docstring">
|
455
|
-
<div class="discussion">
|
456
|
-
|
457
|
-
<p>Initializes the object <tt>content</tt> : String with the tabular BLAST
|
458
|
-
output <tt>format</tt>: format of the tabular output (string with column
|
459
|
-
sepatared by space or coma) <tt>type</tt>: :nucleotide or :mrna</p>
|
460
|
-
|
461
|
-
|
462
|
-
</div>
|
463
|
-
</div>
|
464
|
-
<div class="tags">
|
465
|
-
|
466
|
-
|
467
|
-
</div><table class="source_code">
|
468
|
-
<tr>
|
469
|
-
<td>
|
470
|
-
<pre class="lines">
|
471
|
-
|
472
|
-
|
473
|
-
22
|
474
|
-
23
|
475
|
-
24
|
476
|
-
25
|
477
|
-
26
|
478
|
-
27
|
479
|
-
28
|
480
|
-
29
|
481
|
-
30
|
482
|
-
31
|
483
|
-
32
|
484
|
-
33
|
485
|
-
34
|
486
|
-
35</pre>
|
487
|
-
</td>
|
488
|
-
<td>
|
489
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 22</span>
|
490
|
-
|
491
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
492
|
-
<span class='ivar'>@content</span> <span class='op'>=</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'>#.*\n</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
493
|
-
<span class='ivar'>@content_iterator</span> <span class='op'>=</span> <span class='ivar'>@content</span>
|
494
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_format'>format</span> <span class='op'>==</span> <span class='kw'>nil</span>
|
495
|
-
<span class='ivar'>@format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore</span><span class='tstring_end'>"</span></span>
|
496
|
-
<span class='kw'>else</span>
|
497
|
-
<span class='ivar'>@format</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</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'>[-\d]</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
498
|
-
<span class='kw'>end</span>
|
499
|
-
|
500
|
-
<span class='ivar'>@column_names</span> <span class='op'>=</span> <span class='ivar'>@format</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'>[ ,]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
501
|
-
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
|
502
|
-
<span class='ivar'>@query_id_idx</span> <span class='op'>=</span> <span class='ivar'>@column_names</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>qseqid</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
503
|
-
<span class='ivar'>@hit_id_idx</span> <span class='op'>=</span> <span class='ivar'>@column_names</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sseqid</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
504
|
-
<span class='kw'>end</span></pre>
|
505
|
-
</td>
|
506
|
-
</tr>
|
507
|
-
</table>
|
508
|
-
</div>
|
509
|
-
|
510
|
-
</div>
|
511
|
-
|
512
|
-
<div id="instance_attr_details" class="attr_details">
|
513
|
-
<h2>Instance Attribute Details</h2>
|
514
|
-
|
515
|
-
|
516
|
-
<span id=""></span>
|
517
|
-
<div class="method_details first">
|
518
|
-
<h3 class="signature first" id="column_names-instance_method">
|
519
|
-
|
520
|
-
- (<tt>Object</tt>) <strong>column_names</strong> <span class="extras">(readonly)</span>
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
</h3><div class="docstring">
|
527
|
-
<div class="discussion">
|
528
|
-
|
529
|
-
<p>Returns the value of attribute column_names</p>
|
530
|
-
|
531
|
-
|
532
|
-
</div>
|
533
|
-
</div>
|
534
|
-
<div class="tags">
|
535
|
-
|
536
|
-
|
537
|
-
</div><table class="source_code">
|
538
|
-
<tr>
|
539
|
-
<td>
|
540
|
-
<pre class="lines">
|
541
|
-
|
542
|
-
|
543
|
-
13
|
544
|
-
14
|
545
|
-
15</pre>
|
546
|
-
</td>
|
547
|
-
<td>
|
548
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 13</span>
|
549
|
-
|
550
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_column_names'>column_names</span>
|
551
|
-
<span class='ivar'>@column_names</span>
|
552
|
-
<span class='kw'>end</span></pre>
|
553
|
-
</td>
|
554
|
-
</tr>
|
555
|
-
</table>
|
556
|
-
</div>
|
557
|
-
|
558
|
-
|
559
|
-
<span id=""></span>
|
560
|
-
<div class="method_details ">
|
561
|
-
<h3 class="signature " id="content-instance_method">
|
562
|
-
|
563
|
-
- (<tt>Object</tt>) <strong>content</strong> <span class="extras">(readonly)</span>
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
</h3><div class="docstring">
|
570
|
-
<div class="discussion">
|
571
|
-
|
572
|
-
<p>Returns the value of attribute content</p>
|
573
|
-
|
574
|
-
|
575
|
-
</div>
|
576
|
-
</div>
|
577
|
-
<div class="tags">
|
578
|
-
|
579
|
-
|
580
|
-
</div><table class="source_code">
|
581
|
-
<tr>
|
582
|
-
<td>
|
583
|
-
<pre class="lines">
|
584
|
-
|
585
|
-
|
586
|
-
9
|
587
|
-
10
|
588
|
-
11</pre>
|
589
|
-
</td>
|
590
|
-
<td>
|
591
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 9</span>
|
592
|
-
|
593
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span>
|
594
|
-
<span class='ivar'>@content</span>
|
595
|
-
<span class='kw'>end</span></pre>
|
596
|
-
</td>
|
597
|
-
</tr>
|
598
|
-
</table>
|
599
|
-
</div>
|
600
|
-
|
601
|
-
|
602
|
-
<span id=""></span>
|
603
|
-
<div class="method_details ">
|
604
|
-
<h3 class="signature " id="content_iterator-instance_method">
|
605
|
-
|
606
|
-
- (<tt>Object</tt>) <strong>content_iterator</strong> <span class="extras">(readonly)</span>
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
</h3><div class="docstring">
|
613
|
-
<div class="discussion">
|
614
|
-
|
615
|
-
<p>Returns the value of attribute content_iterator</p>
|
616
|
-
|
617
|
-
|
618
|
-
</div>
|
619
|
-
</div>
|
620
|
-
<div class="tags">
|
621
|
-
|
622
|
-
|
623
|
-
</div><table class="source_code">
|
624
|
-
<tr>
|
625
|
-
<td>
|
626
|
-
<pre class="lines">
|
627
|
-
|
628
|
-
|
629
|
-
10
|
630
|
-
11
|
631
|
-
12</pre>
|
632
|
-
</td>
|
633
|
-
<td>
|
634
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 10</span>
|
635
|
-
|
636
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_content_iterator'>content_iterator</span>
|
637
|
-
<span class='ivar'>@content_iterator</span>
|
638
|
-
<span class='kw'>end</span></pre>
|
639
|
-
</td>
|
640
|
-
</tr>
|
641
|
-
</table>
|
642
|
-
</div>
|
643
|
-
|
644
|
-
|
645
|
-
<span id=""></span>
|
646
|
-
<div class="method_details ">
|
647
|
-
<h3 class="signature " id="format-instance_method">
|
648
|
-
|
649
|
-
- (<tt>Object</tt>) <strong>format</strong> <span class="extras">(readonly)</span>
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
</h3><div class="docstring">
|
656
|
-
<div class="discussion">
|
657
|
-
|
658
|
-
<p>Returns the value of attribute format</p>
|
659
|
-
|
660
|
-
|
661
|
-
</div>
|
662
|
-
</div>
|
663
|
-
<div class="tags">
|
664
|
-
|
665
|
-
|
666
|
-
</div><table class="source_code">
|
667
|
-
<tr>
|
668
|
-
<td>
|
669
|
-
<pre class="lines">
|
670
|
-
|
671
|
-
|
672
|
-
11
|
673
|
-
12
|
674
|
-
13</pre>
|
675
|
-
</td>
|
676
|
-
<td>
|
677
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 11</span>
|
678
|
-
|
679
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span>
|
680
|
-
<span class='ivar'>@format</span>
|
681
|
-
<span class='kw'>end</span></pre>
|
682
|
-
</td>
|
683
|
-
</tr>
|
684
|
-
</table>
|
685
|
-
</div>
|
686
|
-
|
687
|
-
|
688
|
-
<span id=""></span>
|
689
|
-
<div class="method_details ">
|
690
|
-
<h3 class="signature " id="hit_id_idx-instance_method">
|
691
|
-
|
692
|
-
- (<tt>Object</tt>) <strong>hit_id_idx</strong> <span class="extras">(readonly)</span>
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
</h3><div class="docstring">
|
699
|
-
<div class="discussion">
|
700
|
-
|
701
|
-
<p>Returns the value of attribute hit_id_idx</p>
|
702
|
-
|
703
|
-
|
704
|
-
</div>
|
705
|
-
</div>
|
706
|
-
<div class="tags">
|
707
|
-
|
708
|
-
|
709
|
-
</div><table class="source_code">
|
710
|
-
<tr>
|
711
|
-
<td>
|
712
|
-
<pre class="lines">
|
713
|
-
|
714
|
-
|
715
|
-
15
|
716
|
-
16
|
717
|
-
17</pre>
|
718
|
-
</td>
|
719
|
-
<td>
|
720
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 15</span>
|
721
|
-
|
722
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_hit_id_idx'>hit_id_idx</span>
|
723
|
-
<span class='ivar'>@hit_id_idx</span>
|
724
|
-
<span class='kw'>end</span></pre>
|
725
|
-
</td>
|
726
|
-
</tr>
|
727
|
-
</table>
|
728
|
-
</div>
|
729
|
-
|
730
|
-
|
731
|
-
<span id=""></span>
|
732
|
-
<div class="method_details ">
|
733
|
-
<h3 class="signature " id="query_id_idx-instance_method">
|
734
|
-
|
735
|
-
- (<tt>Object</tt>) <strong>query_id_idx</strong> <span class="extras">(readonly)</span>
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
</h3><div class="docstring">
|
742
|
-
<div class="discussion">
|
743
|
-
|
744
|
-
<p>Returns the value of attribute query_id_idx</p>
|
745
|
-
|
746
|
-
|
747
|
-
</div>
|
748
|
-
</div>
|
749
|
-
<div class="tags">
|
750
|
-
|
751
|
-
|
752
|
-
</div><table class="source_code">
|
753
|
-
<tr>
|
754
|
-
<td>
|
755
|
-
<pre class="lines">
|
756
|
-
|
757
|
-
|
758
|
-
14
|
759
|
-
15
|
760
|
-
16</pre>
|
761
|
-
</td>
|
762
|
-
<td>
|
763
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 14</span>
|
764
|
-
|
765
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_query_id_idx'>query_id_idx</span>
|
766
|
-
<span class='ivar'>@query_id_idx</span>
|
767
|
-
<span class='kw'>end</span></pre>
|
768
|
-
</td>
|
769
|
-
</tr>
|
770
|
-
</table>
|
771
|
-
</div>
|
772
|
-
|
773
|
-
|
774
|
-
<span id=""></span>
|
775
|
-
<div class="method_details ">
|
776
|
-
<h3 class="signature " id="type-instance_method">
|
777
|
-
|
778
|
-
- (<tt>Object</tt>) <strong>type</strong> <span class="extras">(readonly)</span>
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
</h3><div class="docstring">
|
785
|
-
<div class="discussion">
|
786
|
-
|
787
|
-
<p>Returns the value of attribute type</p>
|
788
|
-
|
789
|
-
|
790
|
-
</div>
|
791
|
-
</div>
|
792
|
-
<div class="tags">
|
793
|
-
|
794
|
-
|
795
|
-
</div><table class="source_code">
|
796
|
-
<tr>
|
797
|
-
<td>
|
798
|
-
<pre class="lines">
|
799
|
-
|
800
|
-
|
801
|
-
12
|
802
|
-
13
|
803
|
-
14</pre>
|
804
|
-
</td>
|
805
|
-
<td>
|
806
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 12</span>
|
807
|
-
|
808
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
809
|
-
<span class='ivar'>@type</span>
|
810
|
-
<span class='kw'>end</span></pre>
|
811
|
-
</td>
|
812
|
-
</tr>
|
813
|
-
</table>
|
814
|
-
</div>
|
815
|
-
|
816
|
-
</div>
|
817
|
-
|
818
|
-
|
819
|
-
<div id="instance_method_details" class="method_details_list">
|
820
|
-
<h2>Instance Method Details</h2>
|
821
|
-
|
822
|
-
|
823
|
-
<div class="method_details first">
|
824
|
-
<h3 class="signature first" id="has_next-instance_method">
|
825
|
-
|
826
|
-
- (<tt>Object</tt>) <strong>has_next</strong>
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
</h3><div class="docstring">
|
833
|
-
<div class="discussion">
|
834
|
-
|
835
|
-
<p>Returns true if there are more hits in the tabular file</p>
|
836
|
-
|
837
|
-
|
838
|
-
</div>
|
839
|
-
</div>
|
840
|
-
<div class="tags">
|
841
|
-
|
842
|
-
|
843
|
-
</div><table class="source_code">
|
844
|
-
<tr>
|
845
|
-
<td>
|
846
|
-
<pre class="lines">
|
847
|
-
|
848
|
-
|
849
|
-
39
|
850
|
-
40
|
851
|
-
41</pre>
|
852
|
-
</td>
|
853
|
-
<td>
|
854
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 39</span>
|
855
|
-
|
856
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_has_next'>has_next</span>
|
857
|
-
<span class='kw'>return</span> <span class='ivar'>@content_iterator</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>0</span>
|
858
|
-
<span class='kw'>end</span></pre>
|
859
|
-
</td>
|
860
|
-
</tr>
|
861
|
-
</table>
|
862
|
-
</div>
|
863
|
-
|
864
|
-
<div class="method_details ">
|
865
|
-
<h3 class="signature " id="jump_next-instance_method">
|
866
|
-
|
867
|
-
- (<tt>Object</tt>) <strong>jump_next</strong>
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
</h3><div class="docstring">
|
874
|
-
<div class="discussion">
|
875
|
-
|
876
|
-
<p>Jumps to the next query</p>
|
877
|
-
|
878
|
-
|
879
|
-
</div>
|
880
|
-
</div>
|
881
|
-
<div class="tags">
|
882
|
-
|
883
|
-
|
884
|
-
</div><table class="source_code">
|
885
|
-
<tr>
|
886
|
-
<td>
|
887
|
-
<pre class="lines">
|
888
|
-
|
889
|
-
|
890
|
-
45
|
891
|
-
46
|
892
|
-
47
|
893
|
-
48
|
894
|
-
49
|
895
|
-
50
|
896
|
-
51
|
897
|
-
52
|
898
|
-
53
|
899
|
-
54
|
900
|
-
55
|
901
|
-
56
|
902
|
-
57
|
903
|
-
58
|
904
|
-
59
|
905
|
-
60
|
906
|
-
61</pre>
|
907
|
-
</td>
|
908
|
-
<td>
|
909
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 45</span>
|
910
|
-
|
911
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_jump_next'>jump_next</span>
|
912
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_has_next'>has_next</span>
|
913
|
-
<span class='comment'># get current query id
|
914
|
-
</span> <span class='comment'># search for the endline
|
915
|
-
</span> <span class='id identifier rubyid_first_row'>first_row</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</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'>([^\n]*)\n</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
916
|
-
|
917
|
-
<span class='kw'>unless</span> <span class='id identifier rubyid_first_row'>first_row</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='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'>\t</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span> <span class='op'>==</span> <span class='ivar'>@column_names</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
918
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>InconsistentTabularFormat</span>
|
919
|
-
<span class='kw'>end</span>
|
920
|
-
|
921
|
-
<span class='id identifier rubyid_query_id'>query_id</span> <span class='op'>=</span> <span class='id identifier rubyid_first_row'>first_row</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</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='tstring_beg'>"</span><span class='tstring_content'>\t</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_query_id_idx'>query_id_idx</span><span class='rbracket'>]</span>
|
922
|
-
<span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</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'>[^\n]*</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query_id'>query_id</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</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='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</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='rbrace'>}</span><span class='tstring_content'>[^\n]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
923
|
-
|
924
|
-
<span class='id identifier rubyid_next_query'>next_query</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hits'>hits</span><span class='lbracket'>[</span><span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_hits'>hits</span><span class='lbracket'>[</span><span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span>
|
925
|
-
<span class='ivar'>@content_iterator</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</span><span class='lbracket'>[</span><span class='id identifier rubyid_next_query'>next_query</span><span class='op'>..</span><span class='ivar'>@content_iterator</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
926
|
-
<span class='kw'>end</span>
|
927
|
-
<span class='kw'>end</span></pre>
|
928
|
-
</td>
|
929
|
-
</tr>
|
930
|
-
</table>
|
931
|
-
</div>
|
932
|
-
|
933
|
-
<div class="method_details ">
|
934
|
-
<h3 class="signature " id="next-instance_method">
|
935
|
-
|
936
|
-
- (<tt>Object</tt>) <strong>next</strong>(identifier = nil)
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
</h3><div class="docstring">
|
943
|
-
<div class="discussion">
|
944
|
-
|
945
|
-
<p>Returns the next query output <tt>identifier</tt>: <tt>String</tt>, the
|
946
|
-
identifier of the next expected query if the identifier is nil, it takes
|
947
|
-
the next query Output: Array of <tt>Sequence</tt> objects corresponding to
|
948
|
-
hits</p>
|
949
|
-
|
950
|
-
|
951
|
-
</div>
|
952
|
-
</div>
|
953
|
-
<div class="tags">
|
954
|
-
|
955
|
-
|
956
|
-
</div><table class="source_code">
|
957
|
-
<tr>
|
958
|
-
<td>
|
959
|
-
<pre class="lines">
|
960
|
-
|
961
|
-
|
962
|
-
68
|
963
|
-
69
|
964
|
-
70
|
965
|
-
71
|
966
|
-
72
|
967
|
-
73
|
968
|
-
74
|
969
|
-
75
|
970
|
-
76
|
971
|
-
77
|
972
|
-
78
|
973
|
-
79
|
974
|
-
80
|
975
|
-
81
|
976
|
-
82
|
977
|
-
83
|
978
|
-
84
|
979
|
-
85
|
980
|
-
86
|
981
|
-
87
|
982
|
-
88
|
983
|
-
89
|
984
|
-
90
|
985
|
-
91
|
986
|
-
92
|
987
|
-
93
|
988
|
-
94
|
989
|
-
95
|
990
|
-
96
|
991
|
-
97
|
992
|
-
98
|
993
|
-
99
|
994
|
-
100
|
995
|
-
101
|
996
|
-
102
|
997
|
-
103
|
998
|
-
104
|
999
|
-
105
|
1000
|
-
106
|
1001
|
-
107
|
1002
|
-
108
|
1003
|
-
109
|
1004
|
-
110
|
1005
|
-
111
|
1006
|
-
112
|
1007
|
-
113
|
1008
|
-
114
|
1009
|
-
115
|
1010
|
-
116
|
1011
|
-
117
|
1012
|
-
118
|
1013
|
-
119
|
1014
|
-
120
|
1015
|
-
121
|
1016
|
-
122
|
1017
|
-
123
|
1018
|
-
124
|
1019
|
-
125
|
1020
|
-
126
|
1021
|
-
127
|
1022
|
-
128</pre>
|
1023
|
-
</td>
|
1024
|
-
<td>
|
1025
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/tabular_parser.rb', line 68</span>
|
1026
|
-
|
1027
|
-
<span class='kw'>def</span> <span class='kw'>next</span><span class='lparen'>(</span><span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1028
|
-
<span class='kw'>begin</span>
|
1029
|
-
<span class='kw'>unless</span> <span class='id identifier rubyid_has_next'>has_next</span>
|
1030
|
-
<span class='kw'>return</span> <span class='kw'>nil</span>
|
1031
|
-
<span class='kw'>end</span>
|
1032
|
-
|
1033
|
-
<span class='comment'># get current query id
|
1034
|
-
</span> <span class='comment'># search for the endline
|
1035
|
-
</span> <span class='id identifier rubyid_first_row'>first_row</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</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'>([^\n]*)\n</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
1036
|
-
|
1037
|
-
<span class='kw'>unless</span> <span class='id identifier rubyid_first_row'>first_row</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='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'>\t</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span> <span class='op'>==</span> <span class='ivar'>@column_names</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
1038
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>InconsistentTabularFormat</span>
|
1039
|
-
<span class='kw'>end</span>
|
1040
|
-
|
1041
|
-
<span class='id identifier rubyid_query_id'>query_id</span> <span class='op'>=</span> <span class='id identifier rubyid_first_row'>first_row</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</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='tstring_beg'>"</span><span class='tstring_content'>\t</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_query_id_idx'>query_id_idx</span><span class='rbracket'>]</span>
|
1042
|
-
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_query_id'>query_id</span> <span class='op'>!=</span> <span class='id identifier rubyid_identifier'>identifier</span><span class='rparen'>)</span>
|
1043
|
-
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1044
|
-
<span class='kw'>end</span>
|
1045
|
-
|
1046
|
-
<span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</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'>[^\n]*</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query_id'>query_id</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</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='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</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='rbrace'>}</span><span class='tstring_content'>[^\n]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
1047
|
-
|
1048
|
-
<span class='id identifier rubyid_next_query'>next_query</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hits'>hits</span><span class='lbracket'>[</span><span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_hits'>hits</span><span class='lbracket'>[</span><span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span>
|
1049
|
-
<span class='ivar'>@content_iterator</span> <span class='op'>=</span> <span class='ivar'>@content_iterator</span><span class='lbracket'>[</span><span class='id identifier rubyid_next_query'>next_query</span><span class='op'>..</span><span class='ivar'>@content_iterator</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
1050
|
-
|
1051
|
-
<span class='id identifier rubyid_hit_list'>hit_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1052
|
-
<span class='id identifier rubyid_hits'>hits</span> <span class='op'>=</span> <span class='id identifier rubyid_hits'>hits</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_hit'>hit</span><span class='op'>|</span> <span class='id identifier rubyid_hit'>hit</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'>\t</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1053
|
-
|
1054
|
-
<span class='comment'># for each hit
|
1055
|
-
</span> <span class='id identifier rubyid_hits'>hits</span><span class='period'>.</span><span class='id identifier rubyid_group_by'>group_by</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_hit'>hit</span><span class='lbracket'>[</span><span class='ivar'>@hit_id_idx</span><span class='rbracket'>]</span><span class='rbrace'>}</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_idx'>idx</span><span class='comma'>,</span> <span class='id identifier rubyid_hit'>hit</span><span class='op'>|</span>
|
1056
|
-
<span class='id identifier rubyid_hit_seq'>hit_seq</span> <span class='op'>=</span> <span class='const'>Sequence</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1057
|
-
<span class='id identifier rubyid_column_names'>column_names</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_column'>column</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
1058
|
-
<span class='id identifier rubyid_hit_seq'>hit_seq</span><span class='period'>.</span><span class='id identifier rubyid_init_tabular_attribute'>init_tabular_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_column'>column</span><span class='comma'>,</span> <span class='id identifier rubyid_hit'>hit</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1059
|
-
<span class='kw'>end</span>
|
1060
|
-
|
1061
|
-
<span class='comment'># take all hsps
|
1062
|
-
</span> <span class='id identifier rubyid_hsps'>hsps</span> <span class='op'>=</span> <span class='id identifier rubyid_hits'>hits</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_hit'>hit</span><span class='op'>|</span> <span class='id identifier rubyid_hit'>hit</span><span class='lbracket'>[</span><span class='ivar'>@hit_id_idx</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_idx'>idx</span><span class='rbrace'>}</span>
|
1063
|
-
<span class='comment'># for each hsp fill the Hsp structure
|
1064
|
-
</span> <span class='id identifier rubyid_hsps'>hsps</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_array'>hsp_array</span><span class='op'>|</span>
|
1065
|
-
<span class='id identifier rubyid_hsp'>hsp</span> <span class='op'>=</span> <span class='const'>Hsp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1066
|
-
<span class='id identifier rubyid_column_names'>column_names</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_column'>column</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
1067
|
-
<span class='id identifier rubyid_hsp'>hsp</span><span class='period'>.</span><span class='id identifier rubyid_init_tabular_attribute'>init_tabular_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_column'>column</span><span class='comma'>,</span> <span class='id identifier rubyid_hsp_array'>hsp_array</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@type</span><span class='rparen'>)</span>
|
1068
|
-
<span class='kw'>end</span>
|
1069
|
-
<span class='id identifier rubyid_hit_seq'>hit_seq</span><span class='period'>.</span><span class='id identifier rubyid_hsp_list'>hsp_list</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_hsp'>hsp</span><span class='rparen'>)</span>
|
1070
|
-
<span class='kw'>end</span>
|
1071
|
-
<span class='comment'># all the hits are proteins because are obtained with blastx or blastp
|
1072
|
-
</span> <span class='id identifier rubyid_hit_seq'>hit_seq</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:protein</span>
|
1073
|
-
<span class='id identifier rubyid_hit_list'>hit_list</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_hit_seq'>hit_seq</span><span class='rparen'>)</span>
|
1074
|
-
|
1075
|
-
<span class='kw'>end</span>
|
1076
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_hit_list'>hit_list</span>
|
1077
|
-
<span class='kw'>rescue</span> <span class='const'>InconsistentTabularFormat</span> <span class='op'>=></span><span class='id identifier rubyid_error'>error</span>
|
1078
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
|
1079
|
-
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Tabular format 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'>"</span></span><span class='op'><<</span>
|
1080
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Possible cause: The tabular file and the tabular header do not correspond. </span><span class='tstring_end'>"</span></span><span class='op'><<</span>
|
1081
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Please provide -tabular argument with the correct format of the columns\n</span><span class='tstring_end'>"</span></span>
|
1082
|
-
<span class='id identifier rubyid_exit!'>exit!</span>
|
1083
|
-
<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
1084
|
-
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Tabular format 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'>"</span></span>
|
1085
|
-
<span class='id identifier rubyid_exit'>exit</span>
|
1086
|
-
<span class='kw'>end</span>
|
1087
|
-
<span class='kw'>end</span></pre>
|
1088
|
-
</td>
|
1089
|
-
</tr>
|
1090
|
-
</table>
|
1091
|
-
</div>
|
1092
|
-
|
1093
|
-
</div>
|
1094
|
-
|
1095
|
-
</div>
|
1096
|
-
|
1097
|
-
<div id="footer">
|
1098
|
-
Generated on Sat Sep 28 07:01:33 2013 by
|
1099
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1100
|
-
0.8.7.2 (ruby-1.9.3).
|
1101
|
-
</div>
|
1102
|
-
|
1103
|
-
</body>
|
1104
|
-
</html>
|