genevalidator 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.travis.yml +2 -0
  4. data/README.md +78 -30
  5. data/Rakefile +11 -8
  6. data/aux/app_template_footer.erb +1 -6
  7. data/aux/app_template_header.erb +12 -32
  8. data/aux/files/css/style.css +2 -8
  9. data/aux/files/js/plots.js +564 -576
  10. data/aux/files/js/script.js +10 -0
  11. data/aux/json_footer.erb +8 -0
  12. data/aux/json_header.erb +19 -0
  13. data/aux/json_query.erb +14 -0
  14. data/aux/template_footer.erb +9 -58
  15. data/aux/template_header.erb +18 -58
  16. data/aux/template_query.erb +8 -36
  17. data/bin/genevalidator +45 -32
  18. data/genevalidator.gemspec +11 -7
  19. data/lib/genevalidator.rb +75 -455
  20. data/lib/genevalidator/arg_validation.rb +78 -107
  21. data/lib/genevalidator/blast.rb +57 -60
  22. data/lib/genevalidator/clusterization.rb +15 -15
  23. data/lib/genevalidator/exceptions.rb +32 -5
  24. data/lib/genevalidator/get_raw_sequences.rb +70 -33
  25. data/lib/genevalidator/hsp.rb +1 -4
  26. data/lib/genevalidator/json_to_gv_results.rb +109 -0
  27. data/lib/genevalidator/output.rb +177 -185
  28. data/lib/genevalidator/pool.rb +2 -1
  29. data/lib/genevalidator/sequences.rb +3 -3
  30. data/lib/genevalidator/tabular_parser.rb +24 -18
  31. data/lib/genevalidator/validation.rb +279 -0
  32. data/lib/genevalidator/validation_alignment.rb +31 -47
  33. data/lib/genevalidator/validation_blast_reading_frame.rb +19 -18
  34. data/lib/genevalidator/validation_duplication.rb +23 -19
  35. data/lib/genevalidator/validation_gene_merge.rb +30 -65
  36. data/lib/genevalidator/validation_length_cluster.rb +14 -53
  37. data/lib/genevalidator/validation_length_rank.rb +10 -11
  38. data/lib/genevalidator/validation_open_reading_frame.rb +18 -19
  39. data/lib/genevalidator/validation_report.rb +2 -5
  40. data/lib/genevalidator/validation_test.rb +8 -4
  41. data/lib/genevalidator/version.rb +1 -1
  42. data/test/test_all_validations.rb +51 -66
  43. data/test/test_blast.rb +68 -51
  44. data/test/test_clusterization.rb +1 -1
  45. data/test/test_clusterization_2d.rb +19 -13
  46. data/test/test_extended_array_methods.rb +1 -1
  47. data/test/test_files/all_validations_mrna/mrna.blast_tab6 +1806 -0
  48. data/test/test_files/all_validations_mrna/mrna.blast_tab7 +1865 -0
  49. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml → mrna.blast_xml} +18642 -1
  50. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.index → mrna.blast_xml.index} +300 -0
  51. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta → mrna.fa} +0 -0
  52. data/test/test_files/all_validations_mrna/mrna.raw_seq +3970 -0
  53. data/test/test_files/all_validations_mrna/{all_validations_mrna.fasta.blast_xml.raw_seq.idx → mrna.raw_seq.idx} +901 -1
  54. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_tab → prot.blast_tab6} +416 -0
  55. data/test/test_files/all_validations_prot/prot.blast_tab7 +2400 -0
  56. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml → prot.blast_xml} +18299 -6723
  57. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.index → prot.blast_xml.index} +408 -0
  58. data/test/test_files/all_validations_prot/{all_validations_prot.fasta → prot.fa} +0 -0
  59. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq → prot.raw_seq} +2735 -0
  60. data/test/test_files/all_validations_prot/{all_validations_prot.fasta.blast_xml.raw_seq.idx → prot.raw_seq.idx} +3032 -1808
  61. data/test/test_sequences.rb +46 -41
  62. data/test/test_validation_open_reading_frame.rb +318 -202
  63. data/test/test_validations.rb +48 -32
  64. metadata +76 -102
  65. data/doc/AliasDuplicationError.html +0 -134
  66. data/doc/AlignmentValidation.html +0 -1687
  67. data/doc/AlignmentValidationOutput.html +0 -659
  68. data/doc/Blast.html +0 -1905
  69. data/doc/BlastRFValidationOutput.html +0 -545
  70. data/doc/BlastReadingFrameValidation.html +0 -370
  71. data/doc/BlastUtils.html +0 -875
  72. data/doc/ClasspathError.html +0 -134
  73. data/doc/Cluster.html +0 -1316
  74. data/doc/DuplciationValidationOutput.html +0 -564
  75. data/doc/DuplicationValidation.html +0 -920
  76. data/doc/DuplicationValidationOutput.html +0 -564
  77. data/doc/FileNotFoundException.html +0 -134
  78. data/doc/GeneMergeValidation.html +0 -935
  79. data/doc/GeneMergeValidationOutput.html +0 -652
  80. data/doc/HierarchicalClusterization.html +0 -994
  81. data/doc/Hsp.html +0 -1485
  82. data/doc/InconsistentTabularFormat.html +0 -135
  83. data/doc/LengthClusterValidation.html +0 -982
  84. data/doc/LengthClusterValidationOutput.html +0 -515
  85. data/doc/LengthRankValidation.html +0 -496
  86. data/doc/LengthRankValidationOutput.html +0 -517
  87. data/doc/NoInternetError.html +0 -135
  88. data/doc/NoMafftInstallationError.html +0 -134
  89. data/doc/NoPIdentError.html +0 -134
  90. data/doc/NoValidationError.html +0 -134
  91. data/doc/NotEnoughHitsError.html +0 -135
  92. data/doc/ORFValidationOutput.html +0 -593
  93. data/doc/OpenReadingFrameValidation.html +0 -1107
  94. data/doc/OtherError.html +0 -123
  95. data/doc/Output.html +0 -1540
  96. data/doc/Pair.html +0 -309
  97. data/doc/PairCluster.html +0 -767
  98. data/doc/Plot.html +0 -837
  99. data/doc/QueryError.html +0 -134
  100. data/doc/ReportClassError.html +0 -135
  101. data/doc/Sequence.html +0 -1299
  102. data/doc/SequenceTypeError.html +0 -135
  103. data/doc/TabularEntry.html +0 -837
  104. data/doc/TabularParser.html +0 -1104
  105. data/doc/Validation.html +0 -2147
  106. data/doc/ValidationClassError.html +0 -134
  107. data/doc/ValidationOutput.html +0 -460
  108. data/doc/ValidationReport.html +0 -940
  109. data/doc/ValidationTest.html +0 -939
  110. data/doc/_index.html +0 -449
  111. data/doc/class_list.html +0 -54
  112. data/doc/css/common.css +0 -1
  113. data/doc/css/full_list.css +0 -57
  114. data/doc/css/style.css +0 -338
  115. data/doc/file.README.html +0 -151
  116. data/doc/file_list.html +0 -56
  117. data/doc/frames.html +0 -26
  118. data/doc/index.html +0 -151
  119. data/doc/js/app.js +0 -214
  120. data/doc/js/full_list.js +0 -178
  121. data/doc/js/jquery.js +0 -4
  122. data/doc/method_list.html +0 -1505
  123. data/doc/top-level-namespace.html +0 -112
  124. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab +0 -967
  125. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.index +0 -967
  126. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq +0 -4929
  127. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_tab.raw_seq.idx +0 -1006
  128. data/test/test_files/all_validations_mrna/all_validations_mrna.fasta.blast_xml.raw_seq +0 -2075
  129. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.index +0 -1864
  130. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq +0 -42411
  131. data/test/test_files/all_validations_prot/all_validations_prot.fasta.blast_tab.raw_seq.idx +0 -3751
@@ -1,309 +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: Pair
8
-
9
- &mdash; Documentation by YARD 0.8.7.2
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="_index.html">Index (P)</a> &raquo;
35
-
36
-
37
- <span class="title">Pair</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: Pair
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">Struct</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">Struct</li>
82
-
83
- <li class="next">Pair</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/clusterization.rb</dd>
100
-
101
- </dl>
102
- <div class="clear"></div>
103
-
104
-
105
-
106
-
107
-
108
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
109
- <ul class="summary">
110
-
111
- <li class="public ">
112
- <span class="summary_signature">
113
-
114
- <a href="#x-instance_method" title="#x (instance method)">- (Object) <strong>x</strong> </a>
115
-
116
-
117
-
118
- </span>
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <span class="summary_desc"><div class='inline'>
132
- <p>Returns the value of attribute x.</p>
133
- </div></span>
134
-
135
- </li>
136
-
137
-
138
- <li class="public ">
139
- <span class="summary_signature">
140
-
141
- <a href="#y-instance_method" title="#y (instance method)">- (Object) <strong>y</strong> </a>
142
-
143
-
144
-
145
- </span>
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
- <span class="summary_desc"><div class='inline'>
159
- <p>Returns the value of attribute y.</p>
160
- </div></span>
161
-
162
- </li>
163
-
164
-
165
- </ul>
166
-
167
-
168
-
169
-
170
-
171
-
172
- <div id="instance_attr_details" class="attr_details">
173
- <h2>Instance Attribute Details</h2>
174
-
175
-
176
- <span id="x=-instance_method"></span>
177
- <div class="method_details first">
178
- <h3 class="signature first" id="x-instance_method">
179
-
180
- - (<tt>Object</tt>) <strong>x</strong>
181
-
182
-
183
-
184
-
185
-
186
- </h3><div class="docstring">
187
- <div class="discussion">
188
-
189
- <p>Returns the value of attribute x</p>
190
-
191
-
192
- </div>
193
- </div>
194
- <div class="tags">
195
-
196
- <p class="tag_title">Returns:</p>
197
- <ul class="return">
198
-
199
- <li>
200
-
201
-
202
- <span class='type'>(<tt>Object</tt>)</span>
203
-
204
-
205
-
206
- &mdash;
207
- <div class='inline'>
208
- <p>the current value of x</p>
209
- </div>
210
-
211
- </li>
212
-
213
- </ul>
214
-
215
- </div><table class="source_code">
216
- <tr>
217
- <td>
218
- <pre class="lines">
219
-
220
-
221
- 3
222
- 4
223
- 5</pre>
224
- </td>
225
- <td>
226
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 3</span>
227
-
228
- <span class='kw'>def</span> <span class='id identifier rubyid_x'>x</span>
229
- <span class='ivar'>@x</span>
230
- <span class='kw'>end</span></pre>
231
- </td>
232
- </tr>
233
- </table>
234
- </div>
235
-
236
-
237
- <span id="y=-instance_method"></span>
238
- <div class="method_details ">
239
- <h3 class="signature " id="y-instance_method">
240
-
241
- - (<tt>Object</tt>) <strong>y</strong>
242
-
243
-
244
-
245
-
246
-
247
- </h3><div class="docstring">
248
- <div class="discussion">
249
-
250
- <p>Returns the value of attribute y</p>
251
-
252
-
253
- </div>
254
- </div>
255
- <div class="tags">
256
-
257
- <p class="tag_title">Returns:</p>
258
- <ul class="return">
259
-
260
- <li>
261
-
262
-
263
- <span class='type'>(<tt>Object</tt>)</span>
264
-
265
-
266
-
267
- &mdash;
268
- <div class='inline'>
269
- <p>the current value of y</p>
270
- </div>
271
-
272
- </li>
273
-
274
- </ul>
275
-
276
- </div><table class="source_code">
277
- <tr>
278
- <td>
279
- <pre class="lines">
280
-
281
-
282
- 3
283
- 4
284
- 5</pre>
285
- </td>
286
- <td>
287
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 3</span>
288
-
289
- <span class='kw'>def</span> <span class='id identifier rubyid_y'>y</span>
290
- <span class='ivar'>@y</span>
291
- <span class='kw'>end</span></pre>
292
- </td>
293
- </tr>
294
- </table>
295
- </div>
296
-
297
- </div>
298
-
299
-
300
- </div>
301
-
302
- <div id="footer">
303
- Generated on Sat Sep 28 07:01:32 2013 by
304
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
305
- 0.8.7.2 (ruby-1.9.3).
306
- </div>
307
-
308
- </body>
309
- </html>
@@ -1,767 +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: PairCluster
8
-
9
- &mdash; Documentation by YARD 0.8.7.2
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="_index.html">Index (P)</a> &raquo;
35
-
36
-
37
- <span class="title">PairCluster</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: PairCluster
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Object</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">PairCluster</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/genevalidator/clusterization.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
-
103
-
104
-
105
-
106
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
- <ul class="summary">
108
-
109
- <li class="public ">
110
- <span class="summary_signature">
111
-
112
- <a href="#objects-instance_method" title="#objects (instance method)">- (Object) <strong>objects</strong> </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- <span class="summary_desc"><div class='inline'>
130
- <p>a hash map containing the pair (object, no_occurences).</p>
131
- </div></span>
132
-
133
- </li>
134
-
135
-
136
- </ul>
137
-
138
-
139
-
140
-
141
-
142
- <h2>
143
- Instance Method Summary
144
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
145
- </h2>
146
-
147
- <ul class="summary">
148
-
149
- <li class="public ">
150
- <span class="summary_signature">
151
-
152
- <a href="#add-instance_method" title="#add (instance method)">- (Object) <strong>add</strong>(cluster) </a>
153
-
154
-
155
-
156
- </span>
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
- <span class="summary_desc"><div class='inline'>
167
- <p>Merges the current cluster with the one given as parameter
168
- <tt>clusters</tt> vector of Cluster objects.</p>
169
- </div></span>
170
-
171
- </li>
172
-
173
-
174
- <li class="public ">
175
- <span class="summary_signature">
176
-
177
- <a href="#density-instance_method" title="#density (instance method)">- (Object) <strong>density</strong> </a>
178
-
179
-
180
-
181
- </span>
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
- <span class="summary_desc"><div class='inline'>
192
- <p>Returns the density of the cluster: how many values it contains.</p>
193
- </div></span>
194
-
195
- </li>
196
-
197
-
198
- <li class="public ">
199
- <span class="summary_signature">
200
-
201
- <a href="#distance-instance_method" title="#distance (instance method)">- (Object) <strong>distance</strong>(cluster, method = 0) </a>
202
-
203
-
204
-
205
- </span>
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
- <span class="summary_desc"><div class='inline'>
216
- <p>Returns the euclidian distance between the current cluster and the one
217
- given as parameter Params: <tt>cluster</tt>: Cluster object
218
- <tt>method</tt>: 0 or 1 method = 0: do not into condseideration duplicate
219
- values method = 1: average linkage clusterization.</p>
220
- </div></span>
221
-
222
- </li>
223
-
224
-
225
- <li class="public ">
226
- <span class="summary_signature">
227
-
228
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (PairCluster) <strong>initialize</strong>(objects) </a>
229
-
230
-
231
-
232
- </span>
233
-
234
-
235
- <span class="note title constructor">constructor</span>
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
- <span class="summary_desc"><div class='inline'>
245
- <p>A new instance of PairCluster.</p>
246
- </div></span>
247
-
248
- </li>
249
-
250
-
251
- <li class="public ">
252
- <span class="summary_signature">
253
-
254
- <a href="#mean-instance_method" title="#mean (instance method)">- (Object) <strong>mean</strong> </a>
255
-
256
-
257
-
258
- </span>
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
- <span class="summary_desc"><div class='inline'>
269
- <p>Returns the weighted mean value of the cluster.</p>
270
- </div></span>
271
-
272
- </li>
273
-
274
-
275
- <li class="public ">
276
- <span class="summary_signature">
277
-
278
- <a href="#print-instance_method" title="#print (instance method)">- (Object) <strong>print</strong> </a>
279
-
280
-
281
-
282
- </span>
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- <span class="summary_desc"><div class='inline'></div></span>
293
-
294
- </li>
295
-
296
-
297
- <li class="public ">
298
- <span class="summary_signature">
299
-
300
- <a href="#wss-instance_method" title="#wss (instance method)">- (Object) <strong>wss</strong>(objects = nil) </a>
301
-
302
-
303
-
304
- </span>
305
-
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
- <span class="summary_desc"><div class='inline'>
315
- <p>Returns within cluster sum of squares.</p>
316
- </div></span>
317
-
318
- </li>
319
-
320
-
321
- </ul>
322
-
323
-
324
- <div id="constructor_details" class="method_details_list">
325
- <h2>Constructor Details</h2>
326
-
327
- <div class="method_details first">
328
- <h3 class="signature first" id="initialize-instance_method">
329
-
330
- - (<tt><span class='object_link'><a href="" title="PairCluster (class)">PairCluster</a></span></tt>) <strong>initialize</strong>(objects)
331
-
332
-
333
-
334
-
335
-
336
- </h3><div class="docstring">
337
- <div class="discussion">
338
-
339
- <p>Returns a new instance of PairCluster</p>
340
-
341
-
342
- </div>
343
- </div>
344
- <div class="tags">
345
-
346
-
347
- </div><table class="source_code">
348
- <tr>
349
- <td>
350
- <pre class="lines">
351
-
352
-
353
- 70
354
- 71
355
- 72</pre>
356
- </td>
357
- <td>
358
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 70</span>
359
-
360
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_objects'>objects</span><span class='rparen'>)</span>
361
- <span class='ivar'>@objects</span> <span class='op'>=</span> <span class='id identifier rubyid_objects'>objects</span>
362
- <span class='kw'>end</span></pre>
363
- </td>
364
- </tr>
365
- </table>
366
- </div>
367
-
368
- </div>
369
-
370
- <div id="instance_attr_details" class="attr_details">
371
- <h2>Instance Attribute Details</h2>
372
-
373
-
374
- <span id="objects=-instance_method"></span>
375
- <div class="method_details first">
376
- <h3 class="signature first" id="objects-instance_method">
377
-
378
- - (<tt>Object</tt>) <strong>objects</strong>
379
-
380
-
381
-
382
-
383
-
384
- </h3><div class="docstring">
385
- <div class="discussion">
386
-
387
- <p>a hash map containing the pair (object, no_occurences)</p>
388
-
389
-
390
- </div>
391
- </div>
392
- <div class="tags">
393
-
394
-
395
- </div><table class="source_code">
396
- <tr>
397
- <td>
398
- <pre class="lines">
399
-
400
-
401
- 68
402
- 69
403
- 70</pre>
404
- </td>
405
- <td>
406
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 68</span>
407
-
408
- <span class='kw'>def</span> <span class='id identifier rubyid_objects'>objects</span>
409
- <span class='ivar'>@objects</span>
410
- <span class='kw'>end</span></pre>
411
- </td>
412
- </tr>
413
- </table>
414
- </div>
415
-
416
- </div>
417
-
418
-
419
- <div id="instance_method_details" class="method_details_list">
420
- <h2>Instance Method Details</h2>
421
-
422
-
423
- <div class="method_details first">
424
- <h3 class="signature first" id="add-instance_method">
425
-
426
- - (<tt>Object</tt>) <strong>add</strong>(cluster)
427
-
428
-
429
-
430
-
431
-
432
- </h3><div class="docstring">
433
- <div class="discussion">
434
-
435
- <p>Merges the current cluster with the one given as parameter
436
- <tt>clusters</tt> vector of Cluster objects</p>
437
-
438
-
439
- </div>
440
- </div>
441
- <div class="tags">
442
-
443
-
444
- </div><table class="source_code">
445
- <tr>
446
- <td>
447
- <pre class="lines">
448
-
449
-
450
- 154
451
- 155
452
- 156
453
- 157
454
- 158</pre>
455
- </td>
456
- <td>
457
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 154</span>
458
-
459
- <span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_cluster'>cluster</span><span class='rparen'>)</span>
460
- <span class='id identifier rubyid_cluster'>cluster</span><span class='period'>.</span><span class='id identifier rubyid_objects'>objects</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_elem'>elem</span><span class='op'>|</span>
461
- <span class='id identifier rubyid_objects'>objects</span><span class='lbracket'>[</span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
462
- <span class='kw'>end</span>
463
- <span class='kw'>end</span></pre>
464
- </td>
465
- </tr>
466
- </table>
467
- </div>
468
-
469
- <div class="method_details ">
470
- <h3 class="signature " id="density-instance_method">
471
-
472
- - (<tt>Object</tt>) <strong>density</strong>
473
-
474
-
475
-
476
-
477
-
478
- </h3><div class="docstring">
479
- <div class="discussion">
480
-
481
- <p>Returns the density of the cluster: how many values it contains</p>
482
-
483
-
484
- </div>
485
- </div>
486
- <div class="tags">
487
-
488
-
489
- </div><table class="source_code">
490
- <tr>
491
- <td>
492
- <pre class="lines">
493
-
494
-
495
- 99
496
- 100
497
- 101
498
- 102
499
- 103
500
- 104
501
- 105
502
- 106</pre>
503
- </td>
504
- <td>
505
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 99</span>
506
-
507
- <span class='kw'>def</span> <span class='id identifier rubyid_density'>density</span>
508
- <span class='id identifier rubyid_d'>d</span> <span class='op'>=</span> <span class='int'>0</span>
509
- <span class='id identifier rubyid_objects'>objects</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_elem'>elem</span><span class='op'>|</span>
510
- <span class='id identifier rubyid_d'>d</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>
511
- <span class='kw'>end</span>
512
- <span class='id identifier rubyid_d'>d</span>
513
-
514
- <span class='kw'>end</span></pre>
515
- </td>
516
- </tr>
517
- </table>
518
- </div>
519
-
520
- <div class="method_details ">
521
- <h3 class="signature " id="distance-instance_method">
522
-
523
- - (<tt>Object</tt>) <strong>distance</strong>(cluster, method = 0)
524
-
525
-
526
-
527
-
528
-
529
- </h3><div class="docstring">
530
- <div class="discussion">
531
-
532
- <p>Returns the euclidian distance between the current cluster and the one
533
- given as parameter Params: <tt>cluster</tt>: Cluster object
534
- <tt>method</tt>: 0 or 1 method = 0: do not into condseideration duplicate
535
- values method = 1: average linkage clusterization</p>
536
-
537
-
538
- </div>
539
- </div>
540
- <div class="tags">
541
-
542
-
543
- </div><table class="source_code">
544
- <tr>
545
- <td>
546
- <pre class="lines">
547
-
548
-
549
- 114
550
- 115
551
- 116
552
- 117
553
- 118
554
- 119
555
- 120
556
- 121
557
- 122
558
- 123
559
- 124
560
- 125
561
- 126
562
- 127
563
- 128
564
- 129
565
- 130
566
- 131
567
- 132
568
- 133</pre>
569
- </td>
570
- <td>
571
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 114</span>
572
-
573
- <span class='kw'>def</span> <span class='id identifier rubyid_distance'>distance</span><span class='lparen'>(</span><span class='id identifier rubyid_cluster'>cluster</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
574
- <span class='id identifier rubyid_d'>d</span> <span class='op'>=</span> <span class='int'>0</span>
575
- <span class='id identifier rubyid_norm'>norm</span> <span class='op'>=</span> <span class='int'>0</span>
576
-
577
- <span class='id identifier rubyid_cluster'>cluster</span><span class='period'>.</span><span class='id identifier rubyid_objects'>objects</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_elem1'>elem1</span><span class='op'>|</span>
578
- <span class='id identifier rubyid_objects'>objects</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_elem2'>elem2</span><span class='op'>|</span>
579
- <span class='kw'>if</span> <span class='id identifier rubyid_method'>method</span> <span class='op'>==</span> <span class='int'>1</span>
580
- <span class='id identifier rubyid_d'>d</span> <span class='op'>+=</span> <span class='id identifier rubyid_elem1'>elem1</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>*</span> <span class='id identifier rubyid_elem2'>elem2</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_elem1'>elem1</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_elem2'>elem2</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_abs'>abs</span>
581
- <span class='id identifier rubyid_norm'>norm</span> <span class='op'>+=</span> <span class='id identifier rubyid_elem1'>elem1</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>*</span> <span class='id identifier rubyid_elem2'>elem2</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
582
- <span class='kw'>else</span>
583
- <span class='id identifier rubyid_d'>d</span> <span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_elem1'>elem1</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_elem2'>elem2</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_abs'>abs</span>
584
- <span class='id identifier rubyid_norm'>norm</span> <span class='op'>=</span> <span class='id identifier rubyid_cluster'>cluster</span><span class='period'>.</span><span class='id identifier rubyid_objects'>objects</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>*</span> <span class='id identifier rubyid_objects'>objects</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
585
- <span class='kw'>end</span>
586
- <span class='kw'>end</span>
587
- <span class='kw'>end</span>
588
-
589
- <span class='comment'>#group average distance
590
- </span> <span class='id identifier rubyid_d'>d</span> <span class='op'>/=</span> <span class='lparen'>(</span><span class='id identifier rubyid_norm'>norm</span> <span class='op'>+</span> <span class='float'>0.0</span><span class='rparen'>)</span>
591
-
592
- <span class='kw'>end</span></pre>
593
- </td>
594
- </tr>
595
- </table>
596
- </div>
597
-
598
- <div class="method_details ">
599
- <h3 class="signature " id="mean-instance_method">
600
-
601
- - (<tt>Object</tt>) <strong>mean</strong>
602
-
603
-
604
-
605
-
606
-
607
- </h3><div class="docstring">
608
- <div class="discussion">
609
-
610
- <p>Returns the weighted mean value of the cluster</p>
611
-
612
-
613
- </div>
614
- </div>
615
- <div class="tags">
616
-
617
-
618
- </div><table class="source_code">
619
- <tr>
620
- <td>
621
- <pre class="lines">
622
-
623
-
624
- 83
625
- 84
626
- 85
627
- 86
628
- 87
629
- 88
630
- 89
631
- 90
632
- 91
633
- 92
634
- 93
635
- 94
636
- 95</pre>
637
- </td>
638
- <td>
639
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 83</span>
640
-
641
- <span class='kw'>def</span> <span class='id identifier rubyid_mean'>mean</span>
642
- <span class='id identifier rubyid_mean'>mean</span> <span class='op'>=</span> <span class='const'>Pair</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>0</span><span class='rparen'>)</span>
643
- <span class='id identifier rubyid_weight'>weight</span> <span class='op'>=</span> <span class='int'>0</span>
644
-
645
- <span class='id identifier rubyid_objects'>objects</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_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
646
- <span class='id identifier rubyid_object'>object</span> <span class='op'>*</span> <span class='id identifier rubyid_n'>n</span>
647
- <span class='id identifier rubyid_mean'>mean</span> <span class='op'>+</span> <span class='id identifier rubyid_object'>object</span>
648
- <span class='id identifier rubyid_weight'>weight</span> <span class='op'>+=</span> <span class='id identifier rubyid_n'>n</span>
649
- <span class='kw'>end</span>
650
- <span class='id identifier rubyid_mean'>mean</span> <span class='op'>/</span> <span class='id identifier rubyid_weight'>weight</span>
651
- <span class='kw'>return</span> <span class='id identifier rubyid_mean'>mean</span>
652
-
653
- <span class='kw'>end</span></pre>
654
- </td>
655
- </tr>
656
- </table>
657
- </div>
658
-
659
- <div class="method_details ">
660
- <h3 class="signature " id="print-instance_method">
661
-
662
- - (<tt>Object</tt>) <strong>print</strong>
663
-
664
-
665
-
666
-
667
-
668
- </h3><table class="source_code">
669
- <tr>
670
- <td>
671
- <pre class="lines">
672
-
673
-
674
- 74
675
- 75
676
- 76
677
- 77
678
- 78
679
- 79</pre>
680
- </td>
681
- <td>
682
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 74</span>
683
-
684
- <span class='kw'>def</span> <span class='id identifier rubyid_print'>print</span>
685
- <span class='id identifier rubyid_objects'>objects</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_elem'>elem</span><span class='op'>|</span>
686
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='rbrace'>}</span><span class='tstring_content'>,</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbrace'>}</span><span class='tstring_content'>): </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
687
- <span class='kw'>end</span>
688
-
689
- <span class='kw'>end</span></pre>
690
- </td>
691
- </tr>
692
- </table>
693
- </div>
694
-
695
- <div class="method_details ">
696
- <h3 class="signature " id="wss-instance_method">
697
-
698
- - (<tt>Object</tt>) <strong>wss</strong>(objects = nil)
699
-
700
-
701
-
702
-
703
-
704
- </h3><div class="docstring">
705
- <div class="discussion">
706
-
707
- <p>Returns within cluster sum of squares</p>
708
-
709
-
710
- </div>
711
- </div>
712
- <div class="tags">
713
-
714
-
715
- </div><table class="source_code">
716
- <tr>
717
- <td>
718
- <pre class="lines">
719
-
720
-
721
- 137
722
- 138
723
- 139
724
- 140
725
- 141
726
- 142
727
- 143
728
- 144
729
- 145
730
- 146
731
- 147
732
- 148
733
- 149</pre>
734
- </td>
735
- <td>
736
- <pre class="code"><span class="info file"># File 'lib/genevalidator/clusterization.rb', line 137</span>
737
-
738
- <span class='kw'>def</span> <span class='id identifier rubyid_wss'>wss</span><span class='lparen'>(</span><span class='id identifier rubyid_objects'>objects</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
739
- <span class='kw'>if</span> <span class='id identifier rubyid_objects'>objects</span> <span class='op'>==</span> <span class='kw'>nil</span>
740
- <span class='id identifier rubyid_objects'>objects</span> <span class='op'>=</span> <span class='ivar'>@objects</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_a'>a</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span><span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
741
- <span class='kw'>end</span>
742
-
743
- <span class='id identifier rubyid_cluster_mean'>cluster_mean</span> <span class='op'>=</span> <span class='id identifier rubyid_mean'>mean</span>
744
- <span class='id identifier rubyid_ss'>ss</span> <span class='op'>=</span> <span class='int'>0</span>
745
- <span class='id identifier rubyid_objects'>objects</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_object'>object</span><span class='op'>|</span>
746
- <span class='id identifier rubyid_ss'>ss</span> <span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_cluster_mean'>cluster_mean</span> <span class='op'>-</span> <span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_cluster_mean'>cluster_mean</span> <span class='op'>-</span> <span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
747
- <span class='kw'>end</span>
748
- <span class='id identifier rubyid_ss'>ss</span>
749
-
750
- <span class='kw'>end</span></pre>
751
- </td>
752
- </tr>
753
- </table>
754
- </div>
755
-
756
- </div>
757
-
758
- </div>
759
-
760
- <div id="footer">
761
- Generated on Sat Sep 28 07:01:32 2013 by
762
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
763
- 0.8.7.2 (ruby-1.9.3).
764
- </div>
765
-
766
- </body>
767
- </html>