UCSCBin 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +21 -0
- data/README.rdoc +46 -0
- data/Rakefile +51 -0
- data/UCSCBin.gemspec +92 -0
- data/VERSION +1 -0
- data/lib/UCSCBin.rb +144 -0
- data/rdoc/README_rdoc.html +170 -0
- data/rdoc/UCSCBin.html +185 -0
- data/rdoc/UCSCBin/BinRange.html +454 -0
- data/rdoc/UCSCBin/Utils.html +242 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +79 -0
- data/rdoc/js/darkfish.js +116 -0
- data/rdoc/js/jquery.js +32 -0
- data/rdoc/js/quicksearch.js +114 -0
- data/rdoc/js/thickbox-compressed.js +10 -0
- data/rdoc/lib/UCSCBin_rb.html +82 -0
- data/rdoc/rdoc.css +696 -0
- data/sample/refseqgene.rb +35 -0
- data/spec/UCSCBin_BinRange_spec.rb +47 -0
- data/spec/UCSCBin_Utils_spec.rb +49 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +132 -0
data/rdoc/UCSCBin.html
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: UCSCBin</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="module">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="file-metadata">
|
26
|
+
<div id="file-list-section" class="section">
|
27
|
+
<h3 class="section-header">In Files</h3>
|
28
|
+
<div class="section-body">
|
29
|
+
<ul>
|
30
|
+
|
31
|
+
<li><a href="./lib/UCSCBin_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="lib/UCSCBin.rb">lib/UCSCBin.rb</a></li>
|
33
|
+
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="class-metadata">
|
42
|
+
|
43
|
+
<!-- Parent Class -->
|
44
|
+
|
45
|
+
|
46
|
+
<!-- Namespace Contents -->
|
47
|
+
|
48
|
+
<div id="namespace-list-section" class="section">
|
49
|
+
<h3 class="section-header">Namespace</h3>
|
50
|
+
<ul class="link-list">
|
51
|
+
|
52
|
+
<li><span class="type">CLASS</span> <a href="UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
|
53
|
+
|
54
|
+
<li><span class="type">CLASS</span> <a href="UCSCBin/Utils.html">UCSCBin::Utils</a></li>
|
55
|
+
|
56
|
+
</ul>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
|
60
|
+
<!-- Method Quickref -->
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Included Modules -->
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div id="project-metadata">
|
68
|
+
|
69
|
+
|
70
|
+
<div id="fileindex-section" class="section project-section">
|
71
|
+
<h3 class="section-header">Files</h3>
|
72
|
+
<ul>
|
73
|
+
|
74
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<div id="classindex-section" class="section project-section">
|
81
|
+
<h3 class="section-header">Class Index
|
82
|
+
<span class="search-toggle"><img src="./images/find.png"
|
83
|
+
height="16" width="16" alt="[+]"
|
84
|
+
title="show/hide quicksearch" /></span></h3>
|
85
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
86
|
+
<fieldset>
|
87
|
+
<legend>Quicksearch</legend>
|
88
|
+
<input type="text" name="quicksearch" value=""
|
89
|
+
class="quicksearch-field" />
|
90
|
+
</fieldset>
|
91
|
+
</form>
|
92
|
+
|
93
|
+
<ul class="link-list">
|
94
|
+
|
95
|
+
<li><a href="./UCSCBin.html">UCSCBin</a></li>
|
96
|
+
|
97
|
+
<li><a href="./UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
|
98
|
+
|
99
|
+
<li><a href="./UCSCBin/Utils.html">UCSCBin::Utils</a></li>
|
100
|
+
|
101
|
+
</ul>
|
102
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="documentation">
|
110
|
+
<h1 class="module">UCSCBin</h1>
|
111
|
+
|
112
|
+
<div id="description">
|
113
|
+
<h1><a href="UCSCBin.html">UCSCBin</a></h1>
|
114
|
+
<table>
|
115
|
+
<tr><td valign="top">Author:</td><td>Hiroyuki Mishima
|
116
|
+
|
117
|
+
</td></tr>
|
118
|
+
<tr><td valign="top">Copyright:</td><td>Hiroyuki Mishima, 2010
|
119
|
+
|
120
|
+
</td></tr>
|
121
|
+
<tr><td valign="top">Licence:</td><td>the MIT/X11 licence. See the LICENCE file.
|
122
|
+
|
123
|
+
</td></tr>
|
124
|
+
</table>
|
125
|
+
<p>
|
126
|
+
Original program in C by Jim Kent, 2002
|
127
|
+
</p>
|
128
|
+
<p>
|
129
|
+
Util: convert between 0-based half-open interval and 1-based full-close
|
130
|
+
intervals.
|
131
|
+
</p>
|
132
|
+
<p>
|
133
|
+
BinRange: Calculate Bin number from genomic physical position according to
|
134
|
+
UCSC’s Bin Indexing System.
|
135
|
+
</p>
|
136
|
+
<p>
|
137
|
+
See also <a
|
138
|
+
href="http://genomewiki.ucsc.edu/index.php/Bin_indexing_system">genomewiki.ucsc.edu/index.php/Bin_indexing_system</a>,
|
139
|
+
a paper Kent, et. al. Genome Research 2002.12:996-1006, and
|
140
|
+
src/lib/binRange.c in the kent source tree.
|
141
|
+
</p>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<!-- Constants -->
|
146
|
+
|
147
|
+
<div id="constants-list" class="section">
|
148
|
+
<h3 class="section-header">Constants</h3>
|
149
|
+
<dl>
|
150
|
+
|
151
|
+
<dt><a name="Version">Version</a></dt>
|
152
|
+
|
153
|
+
<dd class="description"><p>
|
154
|
+
<a href="UCSCBin.html#Version">Version</a> = “0.1.0“ # 20100714
|
155
|
+
</p></dd>
|
156
|
+
|
157
|
+
|
158
|
+
</dl>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
<!-- Attributes -->
|
163
|
+
|
164
|
+
|
165
|
+
<!-- Methods -->
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
172
|
+
|
173
|
+
<p>Disabled; run with --debug to generate this.</p>
|
174
|
+
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div id="validator-badges">
|
178
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
179
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
180
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
</body>
|
184
|
+
</html>
|
185
|
+
|
@@ -0,0 +1,454 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: UCSCBin::BinRange</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="file-metadata">
|
26
|
+
<div id="file-list-section" class="section">
|
27
|
+
<h3 class="section-header">In Files</h3>
|
28
|
+
<div class="section-body">
|
29
|
+
<ul>
|
30
|
+
|
31
|
+
<li><a href="../lib/UCSCBin_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="lib/UCSCBin.rb">lib/UCSCBin.rb</a></li>
|
33
|
+
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="class-metadata">
|
42
|
+
|
43
|
+
<!-- Parent Class -->
|
44
|
+
|
45
|
+
<div id="parent-class-section" class="section">
|
46
|
+
<h3 class="section-header">Parent</h3>
|
47
|
+
|
48
|
+
<p class="link">Object</p>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<!-- Namespace Contents -->
|
54
|
+
|
55
|
+
|
56
|
+
<!-- Method Quickref -->
|
57
|
+
|
58
|
+
<div id="method-list-section" class="section">
|
59
|
+
<h3 class="section-header">Methods</h3>
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="#M000003">::bin_all</a></li>
|
63
|
+
|
64
|
+
<li><a href="#M000007">::bin_all_extended</a></li>
|
65
|
+
|
66
|
+
<li><a href="#M000006">::bin_all_standard</a></li>
|
67
|
+
|
68
|
+
<li><a href="#M000002">::bin_from_range</a></li>
|
69
|
+
|
70
|
+
<li><a href="#M000005">::bin_from_range_extended</a></li>
|
71
|
+
|
72
|
+
<li><a href="#M000004">::bin_from_range_standard</a></li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Included Modules -->
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
|
84
|
+
|
85
|
+
<div id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Files</h3>
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<div id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class Index
|
97
|
+
<span class="search-toggle"><img src="../images/find.png"
|
98
|
+
height="16" width="16" alt="[+]"
|
99
|
+
title="show/hide quicksearch" /></span></h3>
|
100
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
101
|
+
<fieldset>
|
102
|
+
<legend>Quicksearch</legend>
|
103
|
+
<input type="text" name="quicksearch" value=""
|
104
|
+
class="quicksearch-field" />
|
105
|
+
</fieldset>
|
106
|
+
</form>
|
107
|
+
|
108
|
+
<ul class="link-list">
|
109
|
+
|
110
|
+
<li><a href="../UCSCBin.html">UCSCBin</a></li>
|
111
|
+
|
112
|
+
<li><a href="../UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
|
113
|
+
|
114
|
+
<li><a href="../UCSCBin/Utils.html">UCSCBin::Utils</a></li>
|
115
|
+
|
116
|
+
</ul>
|
117
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div id="documentation">
|
125
|
+
<h1 class="class">UCSCBin::BinRange</h1>
|
126
|
+
|
127
|
+
<div id="description">
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<!-- Constants -->
|
132
|
+
|
133
|
+
<div id="constants-list" class="section">
|
134
|
+
<h3 class="section-header">Constants</h3>
|
135
|
+
<dl>
|
136
|
+
|
137
|
+
<dt><a name="BINRANGE_MAXEND_512M">BINRANGE_MAXEND_512M</a></dt>
|
138
|
+
|
139
|
+
<dd class="description missing-docs">(Not documented)</dd>
|
140
|
+
|
141
|
+
|
142
|
+
<dt><a name="BIN_OFFSETS_EXTENDED">BIN_OFFSETS_EXTENDED</a></dt>
|
143
|
+
|
144
|
+
<dd class="description missing-docs">(Not documented)</dd>
|
145
|
+
|
146
|
+
|
147
|
+
<dt><a name="BIN_OFFSETS">BIN_OFFSETS</a></dt>
|
148
|
+
|
149
|
+
<dd class="description missing-docs">(Not documented)</dd>
|
150
|
+
|
151
|
+
|
152
|
+
<dt><a name="BIN_OFFSET_OLD_TO_EXTENDED">BIN_OFFSET_OLD_TO_EXTENDED</a></dt>
|
153
|
+
|
154
|
+
<dd class="description missing-docs">(Not documented)</dd>
|
155
|
+
|
156
|
+
|
157
|
+
<dt><a name="BIN_FIRST_SHIFT">BIN_FIRST_SHIFT</a></dt>
|
158
|
+
|
159
|
+
<dd class="description"><p>
|
160
|
+
How much to shift to get to finest bin.
|
161
|
+
</p></dd>
|
162
|
+
|
163
|
+
|
164
|
+
<dt><a name="BIN_NEXT_SHIFT">BIN_NEXT_SHIFT</a></dt>
|
165
|
+
|
166
|
+
<dd class="description"><p>
|
167
|
+
How much to shift to get to next larger bin.
|
168
|
+
</p></dd>
|
169
|
+
|
170
|
+
|
171
|
+
</dl>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
|
175
|
+
<!-- Attributes -->
|
176
|
+
|
177
|
+
|
178
|
+
<!-- Methods -->
|
179
|
+
|
180
|
+
<div id="public-class-method-details" class="method-section section">
|
181
|
+
<h3 class="section-header">Public Class Methods</h3>
|
182
|
+
|
183
|
+
|
184
|
+
<div id="bin-all-method" class="method-detail ">
|
185
|
+
<a name="M000003"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
|
189
|
+
<span class="method-name">bin_all</span><span
|
190
|
+
class="method-args">(p_start, p_end)</span>
|
191
|
+
<span class="method-click-advice">click to toggle source</span>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
|
197
|
+
<p>
|
198
|
+
Return an Array of BINs which are all bins containing whole the
|
199
|
+
interval/range. Thus, it always contains “0” indicating a bin
|
200
|
+
containing whole of a chromosome.
|
201
|
+
</p>
|
202
|
+
<p>
|
203
|
+
extended bin index for positions >= 512M is not supported yet Do you need
|
204
|
+
it? Please email me.
|
205
|
+
</p>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-source-code"
|
210
|
+
id="bin-all-source">
|
211
|
+
<pre>
|
212
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 89</span>
|
213
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_all</span>(<span class="ruby-identifier">p_start</span>, <span class="ruby-identifier">p_end</span>)
|
214
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p_end</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">BINRANGE_MAXEND_512M</span>
|
215
|
+
<span class="ruby-identifier">bin_all_standard</span>(<span class="ruby-identifier">p_start</span>, <span class="ruby-identifier">p_end</span>)
|
216
|
+
<span class="ruby-keyword kw">else</span>
|
217
|
+
<span class="ruby-identifier">bin_all_extended</span>(<span class="ruby-identifier">p_start</span>, <span class="ruby-identifier">p_end</span>)
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
<span class="ruby-keyword kw">end</span></pre>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div id="bin-from-range-method" class="method-detail ">
|
229
|
+
<a name="M000002"></a>
|
230
|
+
|
231
|
+
<div class="method-heading">
|
232
|
+
|
233
|
+
<span class="method-name">bin_from_range</span><span
|
234
|
+
class="method-args">(bin_start, bin_end)</span>
|
235
|
+
<span class="method-click-advice">click to toggle source</span>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div class="method-description">
|
240
|
+
|
241
|
+
<p>
|
242
|
+
Return a Integer of a BIN which is the smallest/finest bin containing whole
|
243
|
+
the interval/range.
|
244
|
+
</p>
|
245
|
+
<p>
|
246
|
+
Extended bin index for positions >= 512M is not supported yet Do you need
|
247
|
+
it? Please email me.
|
248
|
+
</p>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
<div class="method-source-code"
|
253
|
+
id="bin-from-range-source">
|
254
|
+
<pre>
|
255
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 72</span>
|
256
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_from_range</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
257
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin_end</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">BINRANGE_MAXEND_512M</span>
|
258
|
+
<span class="ruby-identifier">bin_from_range_standard</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
259
|
+
<span class="ruby-keyword kw">else</span>
|
260
|
+
<span class="ruby-identifier">bin_from_range_extended</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
261
|
+
<span class="ruby-keyword kw">end</span>
|
262
|
+
<span class="ruby-keyword kw">end</span></pre>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
<div id="private-class-method-details" class="method-section section">
|
274
|
+
<h3 class="section-header">Private Class Methods</h3>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="bin-all-extended-method" class="method-detail ">
|
278
|
+
<a name="M000007"></a>
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
|
282
|
+
<span class="method-name">bin_all_extended</span><span
|
283
|
+
class="method-args">(bin_start, bin_end)</span>
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
<p class="missing-docs">(Not documented)</p>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
<div class="method-source-code"
|
295
|
+
id="bin-all-extended-source">
|
296
|
+
<pre>
|
297
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 140</span>
|
298
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_all_extended</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
299
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">"Extended bins are not supported yet"</span>
|
300
|
+
<span class="ruby-keyword kw">end</span></pre>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
</div>
|
304
|
+
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
<div id="bin-all-standard-method" class="method-detail ">
|
310
|
+
<a name="M000006"></a>
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
|
314
|
+
<span class="method-name">bin_all_standard</span><span
|
315
|
+
class="method-args">(bin_start, bin_end)</span>
|
316
|
+
<span class="method-click-advice">click to toggle source</span>
|
317
|
+
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method-description">
|
321
|
+
|
322
|
+
<p class="missing-docs">(Not documented)</p>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<div class="method-source-code"
|
327
|
+
id="bin-all-standard-source">
|
328
|
+
<pre>
|
329
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 123</span>
|
330
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_all_standard</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
331
|
+
<span class="ruby-identifier">bin_start_orig</span> = <span class="ruby-identifier">bin_start</span>
|
332
|
+
<span class="ruby-identifier">bin_end_orig</span> = <span class="ruby-identifier">bin_end</span>
|
333
|
+
<span class="ruby-identifier">results</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
334
|
+
|
335
|
+
<span class="ruby-identifier">bin_start</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_FIRST_SHIFT</span>
|
336
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
337
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_FIRST_SHIFT</span>
|
338
|
+
|
339
|
+
<span class="ruby-constant">BIN_OFFSETS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">offset</span><span class="ruby-operator">|</span>
|
340
|
+
<span class="ruby-identifier">results</span>.<span class="ruby-identifier">concat</span>(((<span class="ruby-identifier">offset</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bin_start</span>)<span class="ruby-operator">..</span>(<span class="ruby-identifier">offset</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bin_end</span>)).<span class="ruby-identifier">to_a</span>)
|
341
|
+
<span class="ruby-identifier">bin_start</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_NEXT_SHIFT</span>
|
342
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_NEXT_SHIFT</span>
|
343
|
+
<span class="ruby-keyword kw">end</span>
|
344
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
|
345
|
+
<span class="ruby-keyword kw">end</span></pre>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</div>
|
349
|
+
|
350
|
+
|
351
|
+
</div>
|
352
|
+
|
353
|
+
|
354
|
+
<div id="bin-from-range-extended-method" class="method-detail ">
|
355
|
+
<a name="M000005"></a>
|
356
|
+
|
357
|
+
<div class="method-heading">
|
358
|
+
|
359
|
+
<span class="method-name">bin_from_range_extended</span><span
|
360
|
+
class="method-args">(bin_start, bin_end)</span>
|
361
|
+
<span class="method-click-advice">click to toggle source</span>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
<div class="method-description">
|
366
|
+
|
367
|
+
<p class="missing-docs">(Not documented)</p>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
<div class="method-source-code"
|
372
|
+
id="bin-from-range-extended-source">
|
373
|
+
<pre>
|
374
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 119</span>
|
375
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_from_range_extended</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
376
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">"Extended bins are not supported yet"</span>
|
377
|
+
<span class="ruby-keyword kw">end</span></pre>
|
378
|
+
</div>
|
379
|
+
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
|
386
|
+
<div id="bin-from-range-standard-method" class="method-detail ">
|
387
|
+
<a name="M000004"></a>
|
388
|
+
|
389
|
+
<div class="method-heading">
|
390
|
+
|
391
|
+
<span class="method-name">bin_from_range_standard</span><span
|
392
|
+
class="method-args">(bin_start, bin_end)</span>
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
<div class="method-description">
|
398
|
+
|
399
|
+
<p class="missing-docs">(Not documented)</p>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
<div class="method-source-code"
|
404
|
+
id="bin-from-range-standard-source">
|
405
|
+
<pre>
|
406
|
+
<span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 99</span>
|
407
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bin_from_range_standard</span>(<span class="ruby-identifier">bin_start</span>, <span class="ruby-identifier">bin_end</span>)
|
408
|
+
<span class="ruby-comment cmt"># Given start,end in chromosome coordinates assign it</span>
|
409
|
+
<span class="ruby-comment cmt"># a bin. There's a bin for each 128k segment, for each</span>
|
410
|
+
<span class="ruby-comment cmt"># 1M segment, for each 8M segment, for each 64M segment,</span>
|
411
|
+
<span class="ruby-comment cmt"># and for each chromosome (which is assumed to be less than</span>
|
412
|
+
<span class="ruby-comment cmt"># 512M.) A range goes into the smallest bin it will fit in.</span>
|
413
|
+
|
414
|
+
<span class="ruby-identifier">bin_start</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_FIRST_SHIFT</span>
|
415
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
416
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_FIRST_SHIFT</span>
|
417
|
+
|
418
|
+
<span class="ruby-constant">BIN_OFFSETS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">offset</span><span class="ruby-operator">|</span>
|
419
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">offset</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bin_start</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin_start</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">bin_end</span>
|
420
|
+
<span class="ruby-identifier">bin_start</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_NEXT_SHIFT</span>
|
421
|
+
<span class="ruby-identifier">bin_end</span> <span class="ruby-operator">>>=</span> <span class="ruby-constant">BIN_NEXT_SHIFT</span>
|
422
|
+
<span class="ruby-keyword kw">end</span>
|
423
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RangeError</span>, \
|
424
|
+
<span class="ruby-node">"start #{bin_start}, end #{bin_end} out of range in findBin (max is 512M)"</span>
|
425
|
+
<span class="ruby-keyword kw">end</span></pre>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
</div>
|
429
|
+
|
430
|
+
|
431
|
+
</div>
|
432
|
+
|
433
|
+
|
434
|
+
</div>
|
435
|
+
|
436
|
+
|
437
|
+
</div>
|
438
|
+
|
439
|
+
|
440
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
441
|
+
|
442
|
+
<p>Disabled; run with --debug to generate this.</p>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div id="validator-badges">
|
447
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
448
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
449
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
</body>
|
453
|
+
</html>
|
454
|
+
|