genevalidator 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,1107 +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: OpenReadingFrameValidation
|
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 (O)</a> »
|
35
|
-
|
36
|
-
|
37
|
-
<span class="title">OpenReadingFrameValidation</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: OpenReadingFrameValidation
|
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"><span class='object_link'><a href="ValidationTest.html" title="ValidationTest (class)">ValidationTest</a></span></span>
|
77
|
-
|
78
|
-
<ul class="fullTree">
|
79
|
-
<li>Object</li>
|
80
|
-
|
81
|
-
<li class="next"><span class='object_link'><a href="ValidationTest.html" title="ValidationTest (class)">ValidationTest</a></span></li>
|
82
|
-
|
83
|
-
<li class="next">OpenReadingFrameValidation</li>
|
84
|
-
|
85
|
-
</ul>
|
86
|
-
<a href="#" class="inheritanceTree">show all</a>
|
87
|
-
|
88
|
-
</dd>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/genevalidator/validation_open_reading_frame.rb</dd>
|
100
|
-
|
101
|
-
</dl>
|
102
|
-
<div class="clear"></div>
|
103
|
-
|
104
|
-
<h2>Overview</h2><div class="docstring">
|
105
|
-
<div class="discussion">
|
106
|
-
|
107
|
-
<p>This class contains the methods necessary for checking whether there is a
|
108
|
-
main Open Reading Frame in the predicted sequence</p>
|
109
|
-
|
110
|
-
|
111
|
-
</div>
|
112
|
-
</div>
|
113
|
-
<div class="tags">
|
114
|
-
|
115
|
-
|
116
|
-
</div>
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
121
|
-
<ul class="summary">
|
122
|
-
|
123
|
-
<li class="public ">
|
124
|
-
<span class="summary_signature">
|
125
|
-
|
126
|
-
<a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
</span>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<span class="note title readonly">readonly</span>
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<span class="summary_desc"><div class='inline'>
|
146
|
-
<p>Returns the value of attribute filename.</p>
|
147
|
-
</div></span>
|
148
|
-
|
149
|
-
</li>
|
150
|
-
|
151
|
-
|
152
|
-
<li class="public ">
|
153
|
-
<span class="summary_signature">
|
154
|
-
|
155
|
-
<a href="#start_codons-instance_method" title="#start_codons (instance method)">- (Object) <strong>start_codons</strong> </a>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
</span>
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
<span class="note title readonly">readonly</span>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<span class="summary_desc"><div class='inline'>
|
175
|
-
<p>Returns the value of attribute start_codons.</p>
|
176
|
-
</div></span>
|
177
|
-
|
178
|
-
</li>
|
179
|
-
|
180
|
-
|
181
|
-
<li class="public ">
|
182
|
-
<span class="summary_signature">
|
183
|
-
|
184
|
-
<a href="#stop_codons-instance_method" title="#stop_codons (instance method)">- (Object) <strong>stop_codons</strong> </a>
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
</span>
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
<span class="note title readonly">readonly</span>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
<span class="summary_desc"><div class='inline'>
|
204
|
-
<p>Returns the value of attribute stop_codons.</p>
|
205
|
-
</div></span>
|
206
|
-
|
207
|
-
</li>
|
208
|
-
|
209
|
-
|
210
|
-
</ul>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="ValidationTest.html" title="ValidationTest (class)">ValidationTest</a></span></h3>
|
217
|
-
<p class="inherited"><span class='object_link'><a href="ValidationTest.html#cli_name-instance_method" title="ValidationTest#cli_name (method)">#cli_name</a></span>, <span class='object_link'><a href="ValidationTest.html#description-instance_method" title="ValidationTest#description (method)">#description</a></span>, <span class='object_link'><a href="ValidationTest.html#header-instance_method" title="ValidationTest#header (method)">#header</a></span>, <span class='object_link'><a href="ValidationTest.html#hits-instance_method" title="ValidationTest#hits (method)">#hits</a></span>, <span class='object_link'><a href="ValidationTest.html#prediction-instance_method" title="ValidationTest#prediction (method)">#prediction</a></span>, <span class='object_link'><a href="ValidationTest.html#running_time-instance_method" title="ValidationTest#running_time (method)">#running_time</a></span>, <span class='object_link'><a href="ValidationTest.html#short_header-instance_method" title="ValidationTest#short_header (method)">#short_header</a></span>, <span class='object_link'><a href="ValidationTest.html#type-instance_method" title="ValidationTest#type (method)">#type</a></span>, <span class='object_link'><a href="ValidationTest.html#validation_report-instance_method" title="ValidationTest#validation_report (method)">#validation_report</a></span></p>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
<h2>
|
222
|
-
Instance Method Summary
|
223
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
224
|
-
</h2>
|
225
|
-
|
226
|
-
<ul class="summary">
|
227
|
-
|
228
|
-
<li class="public ">
|
229
|
-
<span class="summary_signature">
|
230
|
-
|
231
|
-
<a href="#get_orfs-instance_method" title="#get_orfs (instance method)">- (Object) <strong>get_orfs</strong>(orf_length = 100, prediction = @prediction, start_codons = @start_codons, stop_codons = @stop_codons) </a>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</span>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
<span class="summary_desc"><div class='inline'>
|
246
|
-
<p>Find open reading frames in the original sequence Applied only to
|
247
|
-
nucleotide sequences Params: <tt>orf_length</tt>: minimimum ORF length,
|
248
|
-
default 100 <tt>prediction</tt>: <tt>Sequence</tt> object
|
249
|
-
<tt>start_codons</tt>: Array of <tt>String</tt> <tt>stop_codon</tt>: Array
|
250
|
-
of <tt>String</tt> Output: <tt>Hash</tt> containing the reading frame (the
|
251
|
-
key) and a list of intervals (the values).</p>
|
252
|
-
</div></span>
|
253
|
-
|
254
|
-
</li>
|
255
|
-
|
256
|
-
|
257
|
-
<li class="public ">
|
258
|
-
<span class="summary_signature">
|
259
|
-
|
260
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (OpenReadingFrameValidation) <strong>initialize</strong>(type, prediction, hits, filename, start_codons = [], stop_codons = []) </a>
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
</span>
|
265
|
-
|
266
|
-
|
267
|
-
<span class="note title constructor">constructor</span>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
<span class="summary_desc"><div class='inline'>
|
277
|
-
<p>Initilizes the object Params: <tt>type</tt>: type of the predicted sequence
|
278
|
-
(:nucleotide or :protein) <tt>prediction</tt>: a <tt>Sequence</tt> object
|
279
|
-
representing the blast query <tt>hits</tt>: a vector of <tt>Sequence</tt>
|
280
|
-
objects (usually representig the blast hits) <tt>plot_filename</tt>: name
|
281
|
-
of the input file, used when generatig the plot files
|
282
|
-
<tt>start_codons</tt>: <tt>Array</tt> of codons <tt>stop_codons</tt>:
|
283
|
-
<tt>Array</tt> of codons.</p>
|
284
|
-
</div></span>
|
285
|
-
|
286
|
-
</li>
|
287
|
-
|
288
|
-
|
289
|
-
<li class="public ">
|
290
|
-
<span class="summary_signature">
|
291
|
-
|
292
|
-
<a href="#plot_orfs-instance_method" title="#plot_orfs (instance method)">- (Object) <strong>plot_orfs</strong>(orfs, output = "#{@filename}_orfs.json", prediction = @prediction) </a>
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
</span>
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
<span class="summary_desc"><div class='inline'>
|
307
|
-
<p>Plots the resions corresponding to open reading frames Param <tt>orfs</tt>:
|
308
|
-
<tt>Hash</tt> containing the reading frame (the key) and a list of
|
309
|
-
intervals (the values) <tt>output</tt>: location where the plot will be
|
310
|
-
saved in jped file format <tt>prediction</tt>: Sequence objects.</p>
|
311
|
-
</div></span>
|
312
|
-
|
313
|
-
</li>
|
314
|
-
|
315
|
-
|
316
|
-
<li class="public ">
|
317
|
-
<span class="summary_signature">
|
318
|
-
|
319
|
-
<a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
</span>
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
<span class="summary_desc"><div class='inline'>
|
334
|
-
<p>Check whether there is a main reading frame Output:
|
335
|
-
<tt>ORFValidationOutput</tt> object.</p>
|
336
|
-
</div></span>
|
337
|
-
|
338
|
-
</li>
|
339
|
-
|
340
|
-
|
341
|
-
</ul>
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
<div id="constructor_details" class="method_details_list">
|
351
|
-
<h2>Constructor Details</h2>
|
352
|
-
|
353
|
-
<div class="method_details first">
|
354
|
-
<h3 class="signature first" id="initialize-instance_method">
|
355
|
-
|
356
|
-
- (<tt><span class='object_link'><a href="" title="OpenReadingFrameValidation (class)">OpenReadingFrameValidation</a></span></tt>) <strong>initialize</strong>(type, prediction, hits, filename, start_codons = [], stop_codons = [])
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
</h3><div class="docstring">
|
363
|
-
<div class="discussion">
|
364
|
-
|
365
|
-
<p>Initilizes the object Params: <tt>type</tt>: type of the predicted sequence
|
366
|
-
(:nucleotide or :protein) <tt>prediction</tt>: a <tt>Sequence</tt> object
|
367
|
-
representing the blast query <tt>hits</tt>: a vector of <tt>Sequence</tt>
|
368
|
-
objects (usually representig the blast hits) <tt>plot_filename</tt>: name
|
369
|
-
of the input file, used when generatig the plot files
|
370
|
-
<tt>start_codons</tt>: <tt>Array</tt> of codons <tt>stop_codons</tt>:
|
371
|
-
<tt>Array</tt> of codons</p>
|
372
|
-
|
373
|
-
|
374
|
-
</div>
|
375
|
-
</div>
|
376
|
-
<div class="tags">
|
377
|
-
|
378
|
-
|
379
|
-
</div><table class="source_code">
|
380
|
-
<tr>
|
381
|
-
<td>
|
382
|
-
<pre class="lines">
|
383
|
-
|
384
|
-
|
385
|
-
57
|
386
|
-
58
|
387
|
-
59
|
388
|
-
60
|
389
|
-
61
|
390
|
-
62
|
391
|
-
63
|
392
|
-
64
|
393
|
-
65
|
394
|
-
66
|
395
|
-
67
|
396
|
-
68
|
397
|
-
69</pre>
|
398
|
-
</td>
|
399
|
-
<td>
|
400
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 57</span>
|
401
|
-
|
402
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_type'>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_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_start_codons'>start_codons</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_stop_codons'>stop_codons</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
403
|
-
<span class='kw'>super</span>
|
404
|
-
<span class='ivar'>@filename</span> <span class='op'>=</span> <span class='id identifier rubyid_filename'>filename</span>
|
405
|
-
<span class='ivar'>@start_codons</span> <span class='op'>=</span> <span class='id identifier rubyid_start_codons'>start_codons</span>
|
406
|
-
<span class='ivar'>@stop_codons</span> <span class='op'>=</span> <span class='id identifier rubyid_stop_codons'>stop_codons</span>
|
407
|
-
<span class='ivar'>@short_header</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ORF</span><span class='tstring_end'>"</span></span>
|
408
|
-
<span class='ivar'>@header</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Main ORF</span><span class='tstring_end'>"</span></span>
|
409
|
-
<span class='ivar'>@description</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Check whether there is a single main Open Reading Frame</span><span class='tstring_end'>'</span></span><span class='op'><<</span>
|
410
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> in the predicted gene. Aplicable only for nucleotide queries. Meaning</span><span class='tstring_end'>'</span></span><span class='op'><<</span>
|
411
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> of the output displayed: %=MAIN ORF COVERAGE. Coverage higher than 80%</span><span class='tstring_end'>'</span></span><span class='op'><<</span>
|
412
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> passe the validation test.</span><span class='tstring_end'>'</span></span>
|
413
|
-
<span class='ivar'>@cli_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>orf</span><span class='tstring_end'>"</span></span>
|
414
|
-
<span class='kw'>end</span></pre>
|
415
|
-
</td>
|
416
|
-
</tr>
|
417
|
-
</table>
|
418
|
-
</div>
|
419
|
-
|
420
|
-
</div>
|
421
|
-
|
422
|
-
<div id="instance_attr_details" class="attr_details">
|
423
|
-
<h2>Instance Attribute Details</h2>
|
424
|
-
|
425
|
-
|
426
|
-
<span id=""></span>
|
427
|
-
<div class="method_details first">
|
428
|
-
<h3 class="signature first" id="filename-instance_method">
|
429
|
-
|
430
|
-
- (<tt>Object</tt>) <strong>filename</strong> <span class="extras">(readonly)</span>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
</h3><div class="docstring">
|
437
|
-
<div class="discussion">
|
438
|
-
|
439
|
-
<p>Returns the value of attribute filename</p>
|
440
|
-
|
441
|
-
|
442
|
-
</div>
|
443
|
-
</div>
|
444
|
-
<div class="tags">
|
445
|
-
|
446
|
-
|
447
|
-
</div><table class="source_code">
|
448
|
-
<tr>
|
449
|
-
<td>
|
450
|
-
<pre class="lines">
|
451
|
-
|
452
|
-
|
453
|
-
44
|
454
|
-
45
|
455
|
-
46</pre>
|
456
|
-
</td>
|
457
|
-
<td>
|
458
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 44</span>
|
459
|
-
|
460
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
|
461
|
-
<span class='ivar'>@filename</span>
|
462
|
-
<span class='kw'>end</span></pre>
|
463
|
-
</td>
|
464
|
-
</tr>
|
465
|
-
</table>
|
466
|
-
</div>
|
467
|
-
|
468
|
-
|
469
|
-
<span id=""></span>
|
470
|
-
<div class="method_details ">
|
471
|
-
<h3 class="signature " id="start_codons-instance_method">
|
472
|
-
|
473
|
-
- (<tt>Object</tt>) <strong>start_codons</strong> <span class="extras">(readonly)</span>
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
</h3><div class="docstring">
|
480
|
-
<div class="discussion">
|
481
|
-
|
482
|
-
<p>Returns the value of attribute start_codons</p>
|
483
|
-
|
484
|
-
|
485
|
-
</div>
|
486
|
-
</div>
|
487
|
-
<div class="tags">
|
488
|
-
|
489
|
-
|
490
|
-
</div><table class="source_code">
|
491
|
-
<tr>
|
492
|
-
<td>
|
493
|
-
<pre class="lines">
|
494
|
-
|
495
|
-
|
496
|
-
45
|
497
|
-
46
|
498
|
-
47</pre>
|
499
|
-
</td>
|
500
|
-
<td>
|
501
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 45</span>
|
502
|
-
|
503
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_start_codons'>start_codons</span>
|
504
|
-
<span class='ivar'>@start_codons</span>
|
505
|
-
<span class='kw'>end</span></pre>
|
506
|
-
</td>
|
507
|
-
</tr>
|
508
|
-
</table>
|
509
|
-
</div>
|
510
|
-
|
511
|
-
|
512
|
-
<span id=""></span>
|
513
|
-
<div class="method_details ">
|
514
|
-
<h3 class="signature " id="stop_codons-instance_method">
|
515
|
-
|
516
|
-
- (<tt>Object</tt>) <strong>stop_codons</strong> <span class="extras">(readonly)</span>
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
</h3><div class="docstring">
|
523
|
-
<div class="discussion">
|
524
|
-
|
525
|
-
<p>Returns the value of attribute stop_codons</p>
|
526
|
-
|
527
|
-
|
528
|
-
</div>
|
529
|
-
</div>
|
530
|
-
<div class="tags">
|
531
|
-
|
532
|
-
|
533
|
-
</div><table class="source_code">
|
534
|
-
<tr>
|
535
|
-
<td>
|
536
|
-
<pre class="lines">
|
537
|
-
|
538
|
-
|
539
|
-
46
|
540
|
-
47
|
541
|
-
48</pre>
|
542
|
-
</td>
|
543
|
-
<td>
|
544
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 46</span>
|
545
|
-
|
546
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_stop_codons'>stop_codons</span>
|
547
|
-
<span class='ivar'>@stop_codons</span>
|
548
|
-
<span class='kw'>end</span></pre>
|
549
|
-
</td>
|
550
|
-
</tr>
|
551
|
-
</table>
|
552
|
-
</div>
|
553
|
-
|
554
|
-
</div>
|
555
|
-
|
556
|
-
|
557
|
-
<div id="instance_method_details" class="method_details_list">
|
558
|
-
<h2>Instance Method Details</h2>
|
559
|
-
|
560
|
-
|
561
|
-
<div class="method_details first">
|
562
|
-
<h3 class="signature first" id="get_orfs-instance_method">
|
563
|
-
|
564
|
-
- (<tt>Object</tt>) <strong>get_orfs</strong>(orf_length = 100, prediction = @prediction, start_codons = @start_codons, stop_codons = @stop_codons)
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
</h3><div class="docstring">
|
571
|
-
<div class="discussion">
|
572
|
-
|
573
|
-
<p>Find open reading frames in the original sequence Applied only to
|
574
|
-
nucleotide sequences Params: <tt>orf_length</tt>: minimimum ORF length,
|
575
|
-
default 100 <tt>prediction</tt>: <tt>Sequence</tt> object
|
576
|
-
<tt>start_codons</tt>: Array of <tt>String</tt> <tt>stop_codon</tt>: Array
|
577
|
-
of <tt>String</tt> Output: <tt>Hash</tt> containing the reading frame (the
|
578
|
-
key) and a list of intervals (the values)</p>
|
579
|
-
|
580
|
-
|
581
|
-
</div>
|
582
|
-
</div>
|
583
|
-
<div class="tags">
|
584
|
-
|
585
|
-
|
586
|
-
</div><table class="source_code">
|
587
|
-
<tr>
|
588
|
-
<td>
|
589
|
-
<pre class="lines">
|
590
|
-
|
591
|
-
|
592
|
-
122
|
593
|
-
123
|
594
|
-
124
|
595
|
-
125
|
596
|
-
126
|
597
|
-
127
|
598
|
-
128
|
599
|
-
129
|
600
|
-
130
|
601
|
-
131
|
602
|
-
132
|
603
|
-
133
|
604
|
-
134
|
605
|
-
135
|
606
|
-
136
|
607
|
-
137
|
608
|
-
138
|
609
|
-
139
|
610
|
-
140
|
611
|
-
141
|
612
|
-
142
|
613
|
-
143
|
614
|
-
144
|
615
|
-
145
|
616
|
-
146
|
617
|
-
147
|
618
|
-
148
|
619
|
-
149
|
620
|
-
150
|
621
|
-
151
|
622
|
-
152
|
623
|
-
153
|
624
|
-
154
|
625
|
-
155
|
626
|
-
156
|
627
|
-
157
|
628
|
-
158
|
629
|
-
159
|
630
|
-
160
|
631
|
-
161
|
632
|
-
162
|
633
|
-
163
|
634
|
-
164
|
635
|
-
165
|
636
|
-
166
|
637
|
-
167
|
638
|
-
168
|
639
|
-
169
|
640
|
-
170
|
641
|
-
171
|
642
|
-
172
|
643
|
-
173
|
644
|
-
174
|
645
|
-
175
|
646
|
-
176
|
647
|
-
177
|
648
|
-
178
|
649
|
-
179
|
650
|
-
180
|
651
|
-
181
|
652
|
-
182
|
653
|
-
183
|
654
|
-
184
|
655
|
-
185
|
656
|
-
186
|
657
|
-
187
|
658
|
-
188
|
659
|
-
189
|
660
|
-
190
|
661
|
-
191
|
662
|
-
192
|
663
|
-
193
|
664
|
-
194
|
665
|
-
195
|
666
|
-
196
|
667
|
-
197
|
668
|
-
198
|
669
|
-
199
|
670
|
-
200
|
671
|
-
201
|
672
|
-
202
|
673
|
-
203
|
674
|
-
204
|
675
|
-
205
|
676
|
-
206
|
677
|
-
207
|
678
|
-
208
|
679
|
-
209
|
680
|
-
210
|
681
|
-
211
|
682
|
-
212
|
683
|
-
213
|
684
|
-
214
|
685
|
-
215
|
686
|
-
216
|
687
|
-
217
|
688
|
-
218
|
689
|
-
219
|
690
|
-
220
|
691
|
-
221
|
692
|
-
222
|
693
|
-
223
|
694
|
-
224
|
695
|
-
225
|
696
|
-
226
|
697
|
-
227
|
698
|
-
228
|
699
|
-
229
|
700
|
-
230
|
701
|
-
231
|
702
|
-
232
|
703
|
-
233
|
704
|
-
234
|
705
|
-
235
|
706
|
-
236
|
707
|
-
237
|
708
|
-
238
|
709
|
-
239
|
710
|
-
240
|
711
|
-
241
|
712
|
-
242
|
713
|
-
243
|
714
|
-
244
|
715
|
-
245
|
716
|
-
246
|
717
|
-
247
|
718
|
-
248
|
719
|
-
249
|
720
|
-
250
|
721
|
-
251
|
722
|
-
252
|
723
|
-
253
|
724
|
-
254
|
725
|
-
255
|
726
|
-
256
|
727
|
-
257
|
728
|
-
258
|
729
|
-
259
|
730
|
-
260
|
731
|
-
261
|
732
|
-
262
|
733
|
-
263
|
734
|
-
264
|
735
|
-
265
|
736
|
-
266
|
737
|
-
267
|
738
|
-
268
|
739
|
-
269
|
740
|
-
270
|
741
|
-
271</pre>
|
742
|
-
</td>
|
743
|
-
<td>
|
744
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 122</span>
|
745
|
-
|
746
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_get_orfs'>get_orfs</span><span class='lparen'>(</span><span class='id identifier rubyid_orf_length'>orf_length</span> <span class='op'>=</span> <span class='int'>100</span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span> <span class='op'>=</span> <span class='ivar'>@prediction</span><span class='comma'>,</span> <span class='id identifier rubyid_start_codons'>start_codons</span> <span class='op'>=</span> <span class='ivar'>@start_codons</span><span class='comma'>,</span> <span class='id identifier rubyid_stop_codons'>stop_codons</span> <span class='op'>=</span> <span class='ivar'>@stop_codons</span><span class='rparen'>)</span>
|
747
|
-
|
748
|
-
<span class='kw'>if</span> <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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>nucleotide</span><span class='tstring_end'>"</span></span>
|
749
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span>
|
750
|
-
<span class='kw'>end</span>
|
751
|
-
|
752
|
-
<span class='id identifier rubyid_seq'>seq</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>
|
753
|
-
<span class='id identifier rubyid_len'>len</span> <span class='op'>=</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
754
|
-
<span class='id identifier rubyid_stops'>stops</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
755
|
-
|
756
|
-
<span class='id identifier rubyid_stop_codons'>stop_codons</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_codon'>codon</span><span class='op'>|</span>
|
757
|
-
<span class='id identifier rubyid_occurences'>occurences</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='int'>0</span> <span class='op'>..</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_codon'>codon</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
|
758
|
-
<span class='id identifier rubyid_occurences'>occurences</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_occ'>occ</span><span class='op'>|</span>
|
759
|
-
<span class='id identifier rubyid_stops'>stops</span><span class='lbracket'>[</span><span class='id identifier rubyid_occ'>occ</span> <span class='op'>+</span> <span class='int'>3</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_codon'>codon</span>
|
760
|
-
<span class='kw'>end</span>
|
761
|
-
<span class='kw'>end</span>
|
762
|
-
|
763
|
-
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
764
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
765
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
766
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>3</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
767
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
768
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
769
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>3</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
770
|
-
|
771
|
-
<span class='comment'>#direct strand
|
772
|
-
</span> <span class='comment'>#reading frame 1, direct strand
|
773
|
-
</span> <span class='id identifier rubyid_m3'>m3</span> <span class='op'>=</span> <span class='id identifier rubyid_stops'>stops</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>0</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
774
|
-
|
775
|
-
<span class='id identifier rubyid_m3'>m3</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_m3'>m3</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
776
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3'>m3</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
777
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
778
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3'>m3</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='id identifier rubyid_orf_length'>orf_length</span>
|
779
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_m3'>m3</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='comma'>,</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
780
|
-
<span class='kw'>end</span>
|
781
|
-
<span class='kw'>else</span>
|
782
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
783
|
-
<span class='comment'># start_offset = 0
|
784
|
-
</span><span class='comment'># unless i == 1
|
785
|
-
</span> <span class='comment'>#find the first occurence of the start codon in the prospective orf
|
786
|
-
</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3'>m3</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>0</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
787
|
-
<span class='comment'># end
|
788
|
-
</span> <span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
789
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_start_offset'>start_offset</span><span class='comma'>,</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
790
|
-
<span class='kw'>end</span>
|
791
|
-
<span class='kw'>end</span>
|
792
|
-
<span class='kw'>end</span>
|
793
|
-
<span class='kw'>end</span>
|
794
|
-
|
795
|
-
<span class='comment'>#reading frame 2, direct strand
|
796
|
-
</span> <span class='id identifier rubyid_m3_1'>m3_1</span> <span class='op'>=</span> <span class='id identifier rubyid_stops'>stops</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
797
|
-
<span class='id identifier rubyid_m3_1'>m3_1</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
798
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_1'>m3_1</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
799
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
800
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_1'>m3_1</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='id identifier rubyid_orf_length'>orf_length</span>
|
801
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_m3_1'>m3_1</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='comma'>,</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
802
|
-
<span class='kw'>end</span>
|
803
|
-
<span class='kw'>else</span>
|
804
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
805
|
-
<span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3_1'>m3_1</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
806
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
807
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_start_offset'>start_offset</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
808
|
-
<span class='kw'>end</span>
|
809
|
-
<span class='kw'>end</span>
|
810
|
-
<span class='kw'>end</span>
|
811
|
-
<span class='kw'>end</span>
|
812
|
-
|
813
|
-
<span class='comment'>#reading frame 3, direct strand
|
814
|
-
</span> <span class='id identifier rubyid_m3_2'>m3_2</span> <span class='op'>=</span> <span class='id identifier rubyid_stops'>stops</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>2</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
815
|
-
<span class='id identifier rubyid_m3_2'>m3_2</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>3</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
816
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_2'>m3_2</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
817
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
818
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_2'>m3_2</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='id identifier rubyid_orf_length'>orf_length</span>
|
819
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_m3_2'>m3_2</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='comma'>,</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
820
|
-
<span class='kw'>end</span>
|
821
|
-
<span class='kw'>else</span>
|
822
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
823
|
-
<span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3_2'>m3_2</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>2</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
824
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
825
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_start_offset'>start_offset</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
826
|
-
<span class='kw'>end</span>
|
827
|
-
<span class='kw'>end</span>
|
828
|
-
<span class='kw'>end</span>
|
829
|
-
<span class='kw'>end</span>
|
830
|
-
|
831
|
-
<span class='comment'>#reverse strand
|
832
|
-
</span> <span class='id identifier rubyid_stops_reverse'>stops_reverse</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
833
|
-
|
834
|
-
<span class='id identifier rubyid_seq_reverse'>seq_reverse</span> <span class='op'>=</span> <span class='const'>Bio</span><span class='op'>::</span><span class='const'>Sequence</span><span class='op'>::</span><span class='const'>NA</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_seq'>seq</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse_complement'>reverse_complement</span>
|
835
|
-
<span class='id identifier rubyid_stop_codons'>stop_codons</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_codon'>codon</span><span class='op'>|</span>
|
836
|
-
<span class='id identifier rubyid_occurences'>occurences</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='int'>0</span> <span class='op'>..</span> <span class='id identifier rubyid_seq_reverse'>seq_reverse</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq_reverse'>seq_reverse</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_codon'>codon</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
|
837
|
-
<span class='id identifier rubyid_occurences'>occurences</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_occ'>occ</span><span class='op'>|</span>
|
838
|
-
<span class='id identifier rubyid_stops_reverse'>stops_reverse</span><span class='lbracket'>[</span><span class='id identifier rubyid_occ'>occ</span> <span class='op'>+</span> <span class='int'>3</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_codon'>codon</span>
|
839
|
-
<span class='kw'>end</span>
|
840
|
-
<span class='kw'>end</span>
|
841
|
-
|
842
|
-
<span class='id identifier rubyid_m3'>m3</span> <span class='op'>=</span> <span class='id identifier rubyid_stops_reverse'>stops_reverse</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>0</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
843
|
-
<span class='id identifier rubyid_m3'>m3</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_m3'>m3</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
844
|
-
|
845
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3'>m3</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
846
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
847
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3'>m3</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='id identifier rubyid_orf_length'>orf_length</span>
|
848
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3'>m3</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='rbracket'>]</span><span class='rparen'>)</span>
|
849
|
-
<span class='kw'>end</span>
|
850
|
-
<span class='kw'>else</span>
|
851
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
852
|
-
<span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3'>m3</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq_reverse'>seq_reverse</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>0</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
853
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
854
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3'>m3</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
855
|
-
<span class='kw'>end</span>
|
856
|
-
<span class='kw'>end</span>
|
857
|
-
<span class='kw'>end</span>
|
858
|
-
<span class='kw'>end</span>
|
859
|
-
|
860
|
-
<span class='id identifier rubyid_m3_1'>m3_1</span> <span class='op'>=</span> <span class='id identifier rubyid_stops_reverse'>stops_reverse</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
861
|
-
<span class='id identifier rubyid_m3_1'>m3_1</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
862
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_1'>m3_1</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
863
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
864
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_1'>m3_1</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='id identifier rubyid_orf_length'>orf_length</span>
|
865
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_1'>m3_1</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='rbracket'>]</span><span class='rparen'>)</span>
|
866
|
-
<span class='kw'>end</span>
|
867
|
-
<span class='kw'>else</span>
|
868
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
869
|
-
<span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3_1'>m3_1</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq_reverse'>seq_reverse</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
870
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
871
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_1'>m3_1</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
872
|
-
<span class='kw'>end</span>
|
873
|
-
<span class='kw'>end</span>
|
874
|
-
<span class='kw'>end</span>
|
875
|
-
<span class='kw'>end</span>
|
876
|
-
|
877
|
-
<span class='id identifier rubyid_m3_2'>m3_2</span> <span class='op'>=</span> <span class='id identifier rubyid_stops_reverse'>stops_reverse</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_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</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_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>2</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
878
|
-
<span class='id identifier rubyid_m3_2'>m3_2</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>3</span><span class='comma'>,</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='comma'>,</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><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
879
|
-
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_2'>m3_2</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</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_i'>i</span><span class='op'>|</span>
|
880
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_codons'>start_codons</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
881
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_2'>m3_2</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='id identifier rubyid_orf_length'>orf_length</span>
|
882
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_2'>m3_2</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='rbracket'>]</span><span class='rparen'>)</span>
|
883
|
-
<span class='kw'>end</span>
|
884
|
-
<span class='kw'>else</span>
|
885
|
-
<span class='id identifier rubyid_start_codons'>start_codons</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_scd'>scd</span><span class='op'>|</span>
|
886
|
-
<span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_m3_2'>m3_2</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='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf_length'>orf_length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find_all'>find_all</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_seq_reverse'>seq_reverse</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='id identifier rubyid_scd'>scd</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_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>%</span> <span class='int'>3</span> <span class='op'>==</span> <span class='int'>2</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
887
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span> <span class='op'>></span> <span class='id identifier rubyid_orf_length'>orf_length</span>
|
888
|
-
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_m3_2'>m3_2</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>-</span> <span class='id identifier rubyid_start_offset'>start_offset</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
889
|
-
<span class='kw'>end</span>
|
890
|
-
<span class='kw'>end</span>
|
891
|
-
<span class='kw'>end</span>
|
892
|
-
<span class='kw'>end</span>
|
893
|
-
|
894
|
-
<span class='id identifier rubyid_result'>result</span>
|
895
|
-
<span class='kw'>end</span></pre>
|
896
|
-
</td>
|
897
|
-
</tr>
|
898
|
-
</table>
|
899
|
-
</div>
|
900
|
-
|
901
|
-
<div class="method_details ">
|
902
|
-
<h3 class="signature " id="plot_orfs-instance_method">
|
903
|
-
|
904
|
-
- (<tt>Object</tt>) <strong>plot_orfs</strong>(orfs, output = "#{@filename}_orfs.json", prediction = @prediction)
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
</h3><div class="docstring">
|
911
|
-
<div class="discussion">
|
912
|
-
|
913
|
-
<p>Plots the resions corresponding to open reading frames Param <tt>orfs</tt>:
|
914
|
-
<tt>Hash</tt> containing the reading frame (the key) and a list of
|
915
|
-
intervals (the values) <tt>output</tt>: location where the plot will be
|
916
|
-
saved in jped file format <tt>prediction</tt>: Sequence objects</p>
|
917
|
-
|
918
|
-
|
919
|
-
</div>
|
920
|
-
</div>
|
921
|
-
<div class="tags">
|
922
|
-
|
923
|
-
<p class="tag_title">Raises:</p>
|
924
|
-
<ul class="raise">
|
925
|
-
|
926
|
-
<li>
|
927
|
-
|
928
|
-
|
929
|
-
<span class='type'>(<tt><span class='object_link'><a href="QueryError.html" title="QueryError (class)">QueryError</a></span></tt>)</span>
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
</li>
|
934
|
-
|
935
|
-
</ul>
|
936
|
-
|
937
|
-
</div><table class="source_code">
|
938
|
-
<tr>
|
939
|
-
<td>
|
940
|
-
<pre class="lines">
|
941
|
-
|
942
|
-
|
943
|
-
279
|
944
|
-
280
|
945
|
-
281
|
946
|
-
282
|
947
|
-
283
|
948
|
-
284
|
949
|
-
285
|
950
|
-
286
|
951
|
-
287
|
952
|
-
288
|
953
|
-
289
|
954
|
-
290
|
955
|
-
291
|
956
|
-
292
|
957
|
-
293
|
958
|
-
294
|
959
|
-
295
|
960
|
-
296
|
961
|
-
297</pre>
|
962
|
-
</td>
|
963
|
-
<td>
|
964
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 279</span>
|
965
|
-
|
966
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_plot_orfs'>plot_orfs</span><span class='lparen'>(</span><span class='id identifier rubyid_orfs'>orfs</span><span class='comma'>,</span> <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='ivar'>@filename</span><span class='rbrace'>}</span><span class='tstring_content'>_orfs.json</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_prediction'>prediction</span> <span class='op'>=</span> <span class='ivar'>@prediction</span><span class='rparen'>)</span>
|
967
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>QueryError</span> <span class='kw'>unless</span> <span class='id identifier rubyid_orfs'>orfs</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
|
968
|
-
|
969
|
-
<span class='id identifier rubyid_len'>len</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>
|
970
|
-
|
971
|
-
<span class='id identifier rubyid_f'>f</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_output'>output</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>
|
972
|
-
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_orfs'>orfs</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</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_elem'>elem</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>y</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>start</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>stop</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='id identifier rubyid_len'>len</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>color</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>black</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rbrace'>}</span> <span class='op'>+</span>
|
973
|
-
<span class='id identifier rubyid_orfs'>orfs</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</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_elem'>elem</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</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_orf'>orf</span><span class='op'>|</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>y</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>start</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='id identifier rubyid_orf'>orf</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>stop</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='id identifier rubyid_orf'>orf</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>color</span><span class='tstring_end'>"</span></span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>red</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='rparen'>)</span>
|
974
|
-
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
975
|
-
|
976
|
-
<span class='kw'>return</span> <span class='const'>Plot</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='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\/([^\/]+)$</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
977
|
-
<span class='symbol'>:lines</span><span class='comma'>,</span>
|
978
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Open reading frame with START codon</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
979
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
980
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>length</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
981
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Reading Frame</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
982
|
-
<span class='int'>14</span><span class='rparen'>)</span>
|
983
|
-
|
984
|
-
<span class='kw'>end</span></pre>
|
985
|
-
</td>
|
986
|
-
</tr>
|
987
|
-
</table>
|
988
|
-
</div>
|
989
|
-
|
990
|
-
<div class="method_details ">
|
991
|
-
<h3 class="signature " id="run-instance_method">
|
992
|
-
|
993
|
-
- (<tt>Object</tt>) <strong>run</strong>
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
</h3><div class="docstring">
|
1000
|
-
<div class="discussion">
|
1001
|
-
|
1002
|
-
<p>Check whether there is a main reading frame Output:
|
1003
|
-
<tt>ORFValidationOutput</tt> object</p>
|
1004
|
-
|
1005
|
-
|
1006
|
-
</div>
|
1007
|
-
</div>
|
1008
|
-
<div class="tags">
|
1009
|
-
|
1010
|
-
|
1011
|
-
</div><table class="source_code">
|
1012
|
-
<tr>
|
1013
|
-
<td>
|
1014
|
-
<pre class="lines">
|
1015
|
-
|
1016
|
-
|
1017
|
-
76
|
1018
|
-
77
|
1019
|
-
78
|
1020
|
-
79
|
1021
|
-
80
|
1022
|
-
81
|
1023
|
-
82
|
1024
|
-
83
|
1025
|
-
84
|
1026
|
-
85
|
1027
|
-
86
|
1028
|
-
87
|
1029
|
-
88
|
1030
|
-
89
|
1031
|
-
90
|
1032
|
-
91
|
1033
|
-
92
|
1034
|
-
93
|
1035
|
-
94
|
1036
|
-
95
|
1037
|
-
96
|
1038
|
-
97
|
1039
|
-
98
|
1040
|
-
99
|
1041
|
-
100
|
1042
|
-
101
|
1043
|
-
102
|
1044
|
-
103
|
1045
|
-
104
|
1046
|
-
105
|
1047
|
-
106
|
1048
|
-
107
|
1049
|
-
108
|
1050
|
-
109
|
1051
|
-
110</pre>
|
1052
|
-
</td>
|
1053
|
-
<td>
|
1054
|
-
<pre class="code"><span class="info file"># File 'lib/genevalidator/validation_open_reading_frame.rb', line 76</span>
|
1055
|
-
|
1056
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
|
1057
|
-
<span class='kw'>begin</span>
|
1058
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>nucleotide</span><span class='tstring_end'>"</span></span>
|
1059
|
-
<span class='ivar'>@validation_report</span> <span class='op'>=</span> <span class='const'>ValidationReport</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:unapplicable</span><span class='rparen'>)</span>
|
1060
|
-
<span class='kw'>return</span> <span class='ivar'>@validation_report</span>
|
1061
|
-
<span class='kw'>end</span>
|
1062
|
-
|
1063
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotEnoughHitsError</span> <span class='kw'>unless</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'>5</span>
|
1064
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exception</span> <span class='kw'>unless</span> <span class='id identifier rubyid_prediction'>prediction</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Sequence</span> <span class='kw'>and</span>
|
1065
|
-
<span class='id identifier rubyid_hits'>hits</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Sequence</span>
|
1066
|
-
|
1067
|
-
<span class='id identifier rubyid_start'>start</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1068
|
-
<span class='id identifier rubyid_orfs'>orfs</span> <span class='op'>=</span> <span class='id identifier rubyid_get_orfs'>get_orfs</span>
|
1069
|
-
|
1070
|
-
<span class='comment'># check if longest ORF / prediction > 0.8 (ok)
|
1071
|
-
</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_raw_sequence'>raw_sequence</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
1072
|
-
<span class='id identifier rubyid_longest_orf'>longest_orf</span> <span class='op'>=</span> <span class='id identifier rubyid_orfs'>orfs</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_elem'>elem</span><span class='op'>|</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</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_orf'>orf</span><span class='op'>|</span> <span class='id identifier rubyid_orf'>orf</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_orf'>orf</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
|
1073
|
-
<span class='id identifier rubyid_ratio'>ratio</span> <span class='op'>=</span> <span class='id identifier rubyid_longest_orf'>longest_orf</span><span class='op'>/</span><span class='lparen'>(</span><span class='id identifier rubyid_prediction_len'>prediction_len</span> <span class='op'>+</span> <span class='float'>0.0</span><span class='rparen'>)</span>
|
1074
|
-
|
1075
|
-
<span class='id identifier rubyid_plot1'>plot1</span> <span class='op'>=</span> <span class='id identifier rubyid_plot_orfs'>plot_orfs</span><span class='lparen'>(</span><span class='id identifier rubyid_orfs'>orfs</span><span class='rparen'>)</span>
|
1076
|
-
|
1077
|
-
<span class='ivar'>@validation_report</span> <span class='op'>=</span> <span class='const'>ORFValidationOutput</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_orfs'>orfs</span><span class='comma'>,</span> <span class='id identifier rubyid_ratio'>ratio</span><span class='rparen'>)</span>
|
1078
|
-
<span class='ivar'>@running_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='id identifier rubyid_start'>start</span>
|
1079
|
-
|
1080
|
-
<span class='ivar'>@validation_report</span><span class='period'>.</span><span class='id identifier rubyid_plot_files'>plot_files</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_plot1'>plot1</span><span class='rparen'>)</span>
|
1081
|
-
<span class='kw'>return</span> <span class='ivar'>@validation_report</span>
|
1082
|
-
|
1083
|
-
<span class='kw'>rescue</span> <span class='const'>NotEnoughHitsError</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
1084
|
-
<span class='ivar'>@validation_report</span> <span class='op'>=</span> <span class='const'>ValidationReport</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Not enough evidence</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:warning</span><span class='rparen'>)</span>
|
1085
|
-
<span class='kw'>return</span> <span class='ivar'>@validation_report</span>
|
1086
|
-
<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
1087
|
-
<span class='ivar'>@validation_report</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='const'>OtherError</span>
|
1088
|
-
<span class='kw'>return</span> <span class='const'>ValidationReport</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unexpected error</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:error</span><span class='rparen'>)</span>
|
1089
|
-
<span class='kw'>end</span>
|
1090
|
-
<span class='kw'>end</span></pre>
|
1091
|
-
</td>
|
1092
|
-
</tr>
|
1093
|
-
</table>
|
1094
|
-
</div>
|
1095
|
-
|
1096
|
-
</div>
|
1097
|
-
|
1098
|
-
</div>
|
1099
|
-
|
1100
|
-
<div id="footer">
|
1101
|
-
Generated on Sat Sep 28 07:01:33 2013 by
|
1102
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1103
|
-
0.8.7.2 (ruby-1.9.3).
|
1104
|
-
</div>
|
1105
|
-
|
1106
|
-
</body>
|
1107
|
-
</html>
|