UCSCBin 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/LICENSE +21 -0
  2. data/README.rdoc +46 -0
  3. data/Rakefile +51 -0
  4. data/UCSCBin.gemspec +92 -0
  5. data/VERSION +1 -0
  6. data/lib/UCSCBin.rb +144 -0
  7. data/rdoc/README_rdoc.html +170 -0
  8. data/rdoc/UCSCBin.html +185 -0
  9. data/rdoc/UCSCBin/BinRange.html +454 -0
  10. data/rdoc/UCSCBin/Utils.html +242 -0
  11. data/rdoc/created.rid +1 -0
  12. data/rdoc/images/brick.png +0 -0
  13. data/rdoc/images/brick_link.png +0 -0
  14. data/rdoc/images/bug.png +0 -0
  15. data/rdoc/images/bullet_black.png +0 -0
  16. data/rdoc/images/bullet_toggle_minus.png +0 -0
  17. data/rdoc/images/bullet_toggle_plus.png +0 -0
  18. data/rdoc/images/date.png +0 -0
  19. data/rdoc/images/find.png +0 -0
  20. data/rdoc/images/loadingAnimation.gif +0 -0
  21. data/rdoc/images/macFFBgHack.png +0 -0
  22. data/rdoc/images/package.png +0 -0
  23. data/rdoc/images/page_green.png +0 -0
  24. data/rdoc/images/page_white_text.png +0 -0
  25. data/rdoc/images/page_white_width.png +0 -0
  26. data/rdoc/images/plugin.png +0 -0
  27. data/rdoc/images/ruby.png +0 -0
  28. data/rdoc/images/tag_green.png +0 -0
  29. data/rdoc/images/wrench.png +0 -0
  30. data/rdoc/images/wrench_orange.png +0 -0
  31. data/rdoc/images/zoom.png +0 -0
  32. data/rdoc/index.html +79 -0
  33. data/rdoc/js/darkfish.js +116 -0
  34. data/rdoc/js/jquery.js +32 -0
  35. data/rdoc/js/quicksearch.js +114 -0
  36. data/rdoc/js/thickbox-compressed.js +10 -0
  37. data/rdoc/lib/UCSCBin_rb.html +82 -0
  38. data/rdoc/rdoc.css +696 -0
  39. data/sample/refseqgene.rb +35 -0
  40. data/spec/UCSCBin_BinRange_spec.rb +47 -0
  41. data/spec/UCSCBin_Utils_spec.rb +49 -0
  42. data/spec/spec.opts +1 -0
  43. data/spec/spec_helper.rb +9 -0
  44. metadata +132 -0
@@ -0,0 +1,242 @@
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::Utils</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&amp;height=550&amp;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="#M000001">::one_to_zero</a></li>
63
+
64
+ <li><a href="#M000000">::zero_to_one</a></li>
65
+
66
+ </ul>
67
+ </div>
68
+
69
+
70
+ <!-- Included Modules -->
71
+
72
+ </div>
73
+
74
+ <div id="project-metadata">
75
+
76
+
77
+ <div id="fileindex-section" class="section project-section">
78
+ <h3 class="section-header">Files</h3>
79
+ <ul>
80
+
81
+ <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
82
+
83
+ </ul>
84
+ </div>
85
+
86
+
87
+ <div id="classindex-section" class="section project-section">
88
+ <h3 class="section-header">Class Index
89
+ <span class="search-toggle"><img src="../images/find.png"
90
+ height="16" width="16" alt="[+]"
91
+ title="show/hide quicksearch" /></span></h3>
92
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
93
+ <fieldset>
94
+ <legend>Quicksearch</legend>
95
+ <input type="text" name="quicksearch" value=""
96
+ class="quicksearch-field" />
97
+ </fieldset>
98
+ </form>
99
+
100
+ <ul class="link-list">
101
+
102
+ <li><a href="../UCSCBin.html">UCSCBin</a></li>
103
+
104
+ <li><a href="../UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
105
+
106
+ <li><a href="../UCSCBin/Utils.html">UCSCBin::Utils</a></li>
107
+
108
+ </ul>
109
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
110
+ </div>
111
+
112
+
113
+ </div>
114
+ </div>
115
+
116
+ <div id="documentation">
117
+ <h1 class="class">UCSCBin::Utils</h1>
118
+
119
+ <div id="description">
120
+
121
+ </div>
122
+
123
+ <!-- Constants -->
124
+
125
+
126
+ <!-- Attributes -->
127
+
128
+
129
+ <!-- Methods -->
130
+
131
+ <div id="public-class-method-details" class="method-section section">
132
+ <h3 class="section-header">Public Class Methods</h3>
133
+
134
+
135
+ <div id="one-to-zero-method" class="method-detail ">
136
+ <a name="M000001"></a>
137
+
138
+ <div class="method-heading">
139
+
140
+ <span class="method-name">one_to_zero</span><span
141
+ class="method-args">(one_start, one_end)</span>
142
+ <span class="method-click-advice">click to toggle source</span>
143
+
144
+ </div>
145
+
146
+ <div class="method-description">
147
+
148
+ <p>
149
+ &#8216;one_start&#8217; and &#8216;one_end&#8217; are 1-based full-close
150
+ used in UCSC genome browser&#8217;s human interface and most of other
151
+ formats the first one base in a chromosome is [1, 1] Positions must be
152
+ start<=end
153
+ </p>
154
+
155
+
156
+
157
+ <div class="method-source-code"
158
+ id="one-to-zero-source">
159
+ <pre>
160
+ <span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 45</span>
161
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">one_to_zero</span>(<span class="ruby-identifier">one_start</span>, <span class="ruby-identifier">one_end</span>)
162
+ <span class="ruby-keyword kw">case</span>
163
+ <span class="ruby-keyword kw">when</span> (<span class="ruby-identifier">one_start</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">one_end</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1</span>)
164
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;positions must be &gt;=1&quot;</span>
165
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">one_start</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">one_end</span>
166
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;positions must be start&lt;=end&quot;</span>
167
+ <span class="ruby-keyword kw">end</span>
168
+
169
+ [<span class="ruby-identifier">one_start</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> , <span class="ruby-identifier">one_end</span>]
170
+ <span class="ruby-keyword kw">end</span></pre>
171
+ </div>
172
+
173
+ </div>
174
+
175
+
176
+ </div>
177
+
178
+
179
+ <div id="zero-to-one-method" class="method-detail ">
180
+ <a name="M000000"></a>
181
+
182
+ <div class="method-heading">
183
+
184
+ <span class="method-name">zero_to_one</span><span
185
+ class="method-args">(zero_start, zero_end)</span>
186
+ <span class="method-click-advice">click to toggle source</span>
187
+
188
+ </div>
189
+
190
+ <div class="method-description">
191
+
192
+ <p>
193
+ &#8216;zero_start&#8217; and &#8216;zero_end&#8217; are 0-based half-open
194
+ used in UCSC MySQL database and the BED format. the first one base in a
195
+ chromosome is [0, 1) Positions must be start<end
196
+ </p>
197
+
198
+
199
+
200
+ <div class="method-source-code"
201
+ id="zero-to-one-source">
202
+ <pre>
203
+ <span class="ruby-comment cmt"># File lib/UCSCBin.rb, line 30</span>
204
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zero_to_one</span>(<span class="ruby-identifier">zero_start</span>, <span class="ruby-identifier">zero_end</span>)
205
+ <span class="ruby-keyword kw">case</span>
206
+ <span class="ruby-keyword kw">when</span> (<span class="ruby-identifier">zero_start</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">zero_end</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>)
207
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;positions must be &gt;=0&quot;</span>
208
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">zero_start</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">zero_end</span>
209
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;positions must be start&lt;end&quot;</span>
210
+ <span class="ruby-keyword kw">end</span>
211
+
212
+ [<span class="ruby-identifier">zero_start</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">zero_end</span>]
213
+ <span class="ruby-keyword kw">end</span></pre>
214
+ </div>
215
+
216
+ </div>
217
+
218
+
219
+ </div>
220
+
221
+
222
+ </div>
223
+
224
+
225
+ </div>
226
+
227
+
228
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
229
+
230
+ <p>Disabled; run with --debug to generate this.</p>
231
+
232
+ </div>
233
+
234
+ <div id="validator-badges">
235
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
236
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
237
+ Rdoc Generator</a> 1.1.6</small>.</p>
238
+ </div>
239
+
240
+ </body>
241
+ </html>
242
+
@@ -0,0 +1 @@
1
+ Thu, 28 Oct 2010 14:18:51 +0900
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,79 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>UCSCBin 0.2.0
10
+ </title>
11
+
12
+ <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
13
+
14
+ <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
16
+ <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
17
+ <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
18
+
19
+ </head>
20
+ <body class="indexpage">
21
+
22
+
23
+ <h1>UCSCBin 0.2.0
24
+ </h1>
25
+
26
+
27
+ <p>This is the API documentation for 'UCSCBin 0.2.0
28
+ '.</p>
29
+
30
+
31
+
32
+
33
+ <h2>Files</h2>
34
+ <ul>
35
+
36
+ <li class="file"><a href="README_rdoc.html">README.rdoc</a></li>
37
+
38
+ </ul>
39
+
40
+
41
+ <h2>Classes/Modules</h2>
42
+ <ul>
43
+
44
+ <li class="module"><a href="UCSCBin.html">UCSCBin</a></li>
45
+
46
+ <li class="class"><a href="UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
47
+
48
+ <li class="class"><a href="UCSCBin/Utils.html">UCSCBin::Utils</a></li>
49
+
50
+ </ul>
51
+
52
+ <h2>Methods</h2>
53
+ <ul>
54
+
55
+ <li><a href="UCSCBin/BinRange.html#M000003">::bin_all &mdash; UCSCBin::BinRange</a></li>
56
+
57
+ <li><a href="UCSCBin/BinRange.html#M000007">::bin_all_extended &mdash; UCSCBin::BinRange</a></li>
58
+
59
+ <li><a href="UCSCBin/BinRange.html#M000006">::bin_all_standard &mdash; UCSCBin::BinRange</a></li>
60
+
61
+ <li><a href="UCSCBin/BinRange.html#M000002">::bin_from_range &mdash; UCSCBin::BinRange</a></li>
62
+
63
+ <li><a href="UCSCBin/BinRange.html#M000005">::bin_from_range_extended &mdash; UCSCBin::BinRange</a></li>
64
+
65
+ <li><a href="UCSCBin/BinRange.html#M000004">::bin_from_range_standard &mdash; UCSCBin::BinRange</a></li>
66
+
67
+ <li><a href="UCSCBin/Utils.html#M000001">::one_to_zero &mdash; UCSCBin::Utils</a></li>
68
+
69
+ <li><a href="UCSCBin/Utils.html#M000000">::zero_to_one &mdash; UCSCBin::Utils</a></li>
70
+
71
+ </ul>
72
+
73
+ <div id="validator-badges">
74
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
75
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
76
+ Rdoc Generator</a> 1.1.6</small>.</p>
77
+ </div>
78
+ </body>
79
+ </html>
@@ -0,0 +1,116 @@
1
+ /**
2
+ *
3
+ * Darkfish Page Functions
4
+ * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $
5
+ *
6
+ * Author: Michael Granger <mgranger@laika.com>
7
+ *
8
+ */
9
+
10
+ /* Provide console simulation for firebug-less environments */
11
+ if (!("console" in window) || !("firebug" in console)) {
12
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
13
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
14
+
15
+ window.console = {};
16
+ for (var i = 0; i < names.length; ++i)
17
+ window.console[names[i]] = function() {};
18
+ };
19
+
20
+
21
+ /**
22
+ * Unwrap the first element that matches the given @expr@ from the targets and return them.
23
+ */
24
+ $.fn.unwrap = function( expr ) {
25
+ return this.each( function() {
26
+ $(this).parents( expr ).eq( 0 ).after( this ).remove();
27
+ });
28
+ };
29
+
30
+
31
+ function showSource( e ) {
32
+ var target = e.target;
33
+ var codeSections = $(target).
34
+ parents('.method-detail').
35
+ find('.method-source-code');
36
+
37
+ $(target).
38
+ parents('.method-detail').
39
+ find('.method-source-code').
40
+ slideToggle();
41
+ };
42
+
43
+ function hookSourceViews() {
44
+ $('.method-description,.method-heading').click( showSource );
45
+ };
46
+
47
+ function toggleDebuggingSection() {
48
+ $('.debugging-section').slideToggle();
49
+ };
50
+
51
+ function hookDebuggingToggle() {
52
+ $('#debugging-toggle img').click( toggleDebuggingSection );
53
+ };
54
+
55
+ function hookQuickSearch() {
56
+ $('.quicksearch-field').each( function() {
57
+ var searchElems = $(this).parents('.section').find( 'li' );
58
+ var toggle = $(this).parents('.section').find('h3 .search-toggle');
59
+ // console.debug( "Toggle is: %o", toggle );
60
+ var qsbox = $(this).parents('form').get( 0 );
61
+
62
+ $(this).quicksearch( this, searchElems, {
63
+ noSearchResultsIndicator: 'no-class-search-results',
64
+ focusOnLoad: false
65
+ });
66
+ $(toggle).click( function() {
67
+ // console.debug( "Toggling qsbox: %o", qsbox );
68
+ $(qsbox).toggle();
69
+ });
70
+ });
71
+ };
72
+
73
+ function highlightTarget( anchor ) {
74
+ console.debug( "Highlighting target '%s'.", anchor );
75
+
76
+ $("a[name=" + anchor + "]").each( function() {
77
+ if ( !$(this).parent().parent().hasClass('target-section') ) {
78
+ console.debug( "Wrapping the target-section" );
79
+ $('div.method-detail').unwrap( 'div.target-section' );
80
+ $(this).parent().wrap( '<div class="target-section"></div>' );
81
+ } else {
82
+ console.debug( "Already wrapped." );
83
+ }
84
+ });
85
+ };
86
+
87
+ function highlightLocationTarget() {
88
+ console.debug( "Location hash: %s", window.location.hash );
89
+ if ( ! window.location.hash || window.location.hash.length == 0 ) return;
90
+
91
+ var anchor = window.location.hash.substring(1);
92
+ console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
93
+
94
+ highlightTarget( anchor );
95
+ };
96
+
97
+ function highlightClickTarget( event ) {
98
+ console.debug( "Highlighting click target for event %o", event.target );
99
+ try {
100
+ var anchor = $(event.target).attr( 'href' ).substring(1);
101
+ console.debug( "Found target anchor: %s", anchor );
102
+ highlightTarget( anchor );
103
+ } catch ( err ) {
104
+ console.error( "Exception while highlighting: %o", err );
105
+ };
106
+ };
107
+
108
+
109
+ $(document).ready( function() {
110
+ hookSourceViews();
111
+ hookDebuggingToggle();
112
+ hookQuickSearch();
113
+ highlightLocationTarget();
114
+
115
+ $('ul.link-list a').bind( "click", highlightClickTarget );
116
+ });