bio-svgenes 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/README.md +88 -0
  2. data/VERSION +1 -1
  3. data/bio-svgenes.gemspec +131 -8
  4. data/doc/classes/Bio.html +131 -0
  5. data/doc/classes/Bio/Graphics.html +142 -0
  6. data/doc/classes/Bio/Graphics/Glyph.html +987 -0
  7. data/doc/classes/Bio/Graphics/Glyph.src/M000001.html +26 -0
  8. data/doc/classes/Bio/Graphics/Glyph.src/M000002.html +27 -0
  9. data/doc/classes/Bio/Graphics/Glyph.src/M000003.html +32 -0
  10. data/doc/classes/Bio/Graphics/Glyph.src/M000004.html +27 -0
  11. data/doc/classes/Bio/Graphics/Glyph.src/M000005.html +25 -0
  12. data/doc/classes/Bio/Graphics/Glyph.src/M000006.html +29 -0
  13. data/doc/classes/Bio/Graphics/Glyph.src/M000007.html +107 -0
  14. data/doc/classes/Bio/Graphics/Glyph.src/M000008.html +51 -0
  15. data/doc/classes/Bio/Graphics/Glyph.src/M000009.html +23 -0
  16. data/doc/classes/Bio/Graphics/Glyph.src/M000010.html +18 -0
  17. data/doc/classes/Bio/Graphics/Glyph.src/M000011.html +75 -0
  18. data/doc/classes/Bio/Graphics/Glyph.src/M000012.html +51 -0
  19. data/doc/classes/Bio/Graphics/Glyph.src/M000013.html +23 -0
  20. data/doc/classes/Bio/Graphics/Glyph.src/M000014.html +26 -0
  21. data/doc/classes/Bio/Graphics/Glyph.src/M000015.html +27 -0
  22. data/doc/classes/Bio/Graphics/Glyph.src/M000016.html +32 -0
  23. data/doc/classes/Bio/Graphics/Glyph.src/M000017.html +27 -0
  24. data/doc/classes/Bio/Graphics/Glyph.src/M000018.html +25 -0
  25. data/doc/classes/Bio/Graphics/Glyph.src/M000019.html +29 -0
  26. data/doc/classes/Bio/Graphics/Glyph.src/M000020.html +107 -0
  27. data/doc/classes/Bio/Graphics/Glyph.src/M000021.html +51 -0
  28. data/doc/classes/Bio/Graphics/Glyph.src/M000022.html +23 -0
  29. data/doc/classes/Bio/Graphics/Glyph.src/M000023.html +18 -0
  30. data/doc/classes/Bio/Graphics/Glyph.src/M000024.html +75 -0
  31. data/doc/classes/Bio/Graphics/MiniFeature.html +243 -0
  32. data/doc/classes/Bio/Graphics/MiniFeature.src/M000001.html +25 -0
  33. data/doc/classes/Bio/Graphics/MiniFeature.src/M000003.html +25 -0
  34. data/doc/classes/Bio/Graphics/MiniFeature.src/M000024.html +25 -0
  35. data/doc/classes/Bio/Graphics/Page.html +705 -0
  36. data/doc/classes/Bio/Graphics/Page.src/M000010.html +35 -0
  37. data/doc/classes/Bio/Graphics/Page.src/M000011.html +83 -0
  38. data/doc/classes/Bio/Graphics/Page.src/M000012.html +24 -0
  39. data/doc/classes/Bio/Graphics/Page.src/M000013.html +29 -0
  40. data/doc/classes/Bio/Graphics/Page.src/M000014.html +24 -0
  41. data/doc/classes/Bio/Graphics/Page.src/M000015.html +20 -0
  42. data/doc/classes/Bio/Graphics/Page.src/M000016.html +20 -0
  43. data/doc/classes/Bio/Graphics/Page.src/M000017.html +18 -0
  44. data/doc/classes/Bio/Graphics/Page.src/M000018.html +18 -0
  45. data/doc/classes/Bio/Graphics/Page.src/M000019.html +18 -0
  46. data/doc/classes/Bio/Graphics/Page.src/M000020.html +18 -0
  47. data/doc/classes/Bio/Graphics/Page.src/M000021.html +18 -0
  48. data/doc/classes/Bio/Graphics/Page.src/M000022.html +18 -0
  49. data/doc/classes/Bio/Graphics/Page.src/M000023.html +18 -0
  50. data/doc/classes/Bio/Graphics/Page.src/M000024.html +18 -0
  51. data/doc/classes/Bio/Graphics/Page.src/M000025.html +35 -0
  52. data/doc/classes/Bio/Graphics/Page.src/M000026.html +83 -0
  53. data/doc/classes/Bio/Graphics/Page.src/M000027.html +24 -0
  54. data/doc/classes/Bio/Graphics/Page.src/M000028.html +29 -0
  55. data/doc/classes/Bio/Graphics/Page.src/M000029.html +24 -0
  56. data/doc/classes/Bio/Graphics/Page.src/M000030.html +20 -0
  57. data/doc/classes/Bio/Graphics/Page.src/M000031.html +20 -0
  58. data/doc/classes/Bio/Graphics/Page.src/M000032.html +18 -0
  59. data/doc/classes/Bio/Graphics/Page.src/M000033.html +18 -0
  60. data/doc/classes/Bio/Graphics/Page.src/M000034.html +18 -0
  61. data/doc/classes/Bio/Graphics/Page.src/M000035.html +18 -0
  62. data/doc/classes/Bio/Graphics/Page.src/M000036.html +18 -0
  63. data/doc/classes/Bio/Graphics/Page.src/M000037.html +18 -0
  64. data/doc/classes/Bio/Graphics/Page.src/M000038.html +18 -0
  65. data/doc/classes/Bio/Graphics/Page.src/M000039.html +18 -0
  66. data/doc/classes/Bio/Graphics/Page.src/M000040.html +107 -0
  67. data/doc/classes/Bio/Graphics/Page.src/M000041.html +18 -0
  68. data/doc/classes/Bio/Graphics/Page.src/M000042.html +23 -0
  69. data/doc/classes/Bio/Graphics/Page.src/M000043.html +18 -0
  70. data/doc/classes/Bio/Graphics/Page.src/M000044.html +18 -0
  71. data/doc/classes/Bio/Graphics/Primitive.html +204 -0
  72. data/doc/classes/Bio/Graphics/Primitive.src/M000001.html +21 -0
  73. data/doc/classes/Bio/Graphics/Primitive.src/M000002.html +20 -0
  74. data/doc/classes/Bio/Graphics/Primitive.src/M000008.html +21 -0
  75. data/doc/classes/Bio/Graphics/Primitive.src/M000009.html +20 -0
  76. data/doc/classes/Bio/Graphics/Primitive.src/M000022.html +21 -0
  77. data/doc/classes/Bio/Graphics/Primitive.src/M000023.html +20 -0
  78. data/doc/classes/Bio/Graphics/SVGEE.html +290 -0
  79. data/doc/classes/Bio/Graphics/SVGEE.src/M000002.html +24 -0
  80. data/doc/classes/Bio/Graphics/SVGEE.src/M000003.html +18 -0
  81. data/doc/classes/Bio/Graphics/SVGEE.src/M000004.html +24 -0
  82. data/doc/classes/Bio/Graphics/SVGEE.src/M000005.html +18 -0
  83. data/doc/classes/Bio/Graphics/SVGEE.src/M000006.html +18 -0
  84. data/doc/classes/Bio/Graphics/SVGEE.src/M000007.html +21 -0
  85. data/doc/classes/Bio/Graphics/SVGEE.src/M000008.html +27 -0
  86. data/doc/classes/Bio/Graphics/SVGEE.src/M000009.html +23 -0
  87. data/doc/classes/Bio/Graphics/SVGEE.src/M000016.html +24 -0
  88. data/doc/classes/Bio/Graphics/SVGEE.src/M000017.html +18 -0
  89. data/doc/classes/Bio/Graphics/SVGEE.src/M000018.html +18 -0
  90. data/doc/classes/Bio/Graphics/SVGEE.src/M000019.html +21 -0
  91. data/doc/classes/Bio/Graphics/SVGEE.src/M000020.html +27 -0
  92. data/doc/classes/Bio/Graphics/SVGEE.src/M000021.html +23 -0
  93. data/doc/classes/Bio/Graphics/Track.html +473 -0
  94. data/doc/classes/Bio/Graphics/Track.src/M000001.html +35 -0
  95. data/doc/classes/Bio/Graphics/Track.src/M000002.html +18 -0
  96. data/doc/classes/Bio/Graphics/Track.src/M000003.html +28 -0
  97. data/doc/classes/Bio/Graphics/Track.src/M000004.html +18 -0
  98. data/doc/classes/Bio/Graphics/Track.src/M000010.html +35 -0
  99. data/doc/classes/Bio/Graphics/Track.src/M000011.html +18 -0
  100. data/doc/classes/Bio/Graphics/Track.src/M000012.html +28 -0
  101. data/doc/classes/Bio/Graphics/Track.src/M000013.html +18 -0
  102. data/doc/created.rid +1 -9
  103. data/doc/files/lib/bio-svgenes_rb.html +131 -0
  104. data/doc/files/lib/bio/graphics/glyph_rb.html +101 -0
  105. data/doc/files/lib/bio/graphics/mini_feature_rb.html +101 -0
  106. data/doc/files/lib/bio/graphics/page_rb.html +111 -0
  107. data/doc/files/lib/bio/graphics/primitive_rb.html +101 -0
  108. data/doc/files/lib/bio/graphics/svgee_rb.html +101 -0
  109. data/doc/files/lib/bio/graphics/track_rb.html +101 -0
  110. data/doc/fr_class_index.html +34 -0
  111. data/doc/fr_file_index.html +33 -0
  112. data/doc/fr_method_index.html +70 -0
  113. data/doc/index.html +21 -91
  114. data/doc/manual/bootstrap/css/bootstrap-responsive.css +1109 -0
  115. data/doc/manual/bootstrap/css/bootstrap-responsive.min.css +9 -0
  116. data/doc/manual/bootstrap/css/bootstrap.css +6158 -0
  117. data/doc/manual/bootstrap/css/bootstrap.min.css +9 -0
  118. data/doc/manual/bootstrap/img/glyphicons-halflings-white.png +0 -0
  119. data/doc/manual/bootstrap/img/glyphicons-halflings.png +0 -0
  120. data/doc/manual/bootstrap/js/bootstrap.js +2276 -0
  121. data/doc/manual/bootstrap/js/bootstrap.min.js +6 -0
  122. data/doc/manual/img/circle.png +0 -0
  123. data/doc/manual/img/directed.png +0 -0
  124. data/doc/manual/img/down_triangle.png +0 -0
  125. data/doc/manual/img/histogram.png +0 -0
  126. data/doc/manual/img/span.png +0 -0
  127. data/doc/manual/img/transcript.png +0 -0
  128. data/doc/manual/img/up_triangle.png +0 -0
  129. data/doc/manual/manual.html +360 -0
  130. data/doc/manual/manual.md +307 -0
  131. data/doc/rdoc-style.css +208 -0
  132. data/examples/example.rb +12 -8
  133. data/examples/{make_example.rb → example2.rb} +5 -16
  134. data/lib/bio/graphics/glyph.rb +293 -126
  135. data/lib/bio/graphics/mini_feature.rb +24 -17
  136. data/lib/bio/graphics/page.rb +112 -54
  137. data/lib/bio/graphics/primitive.rb +12 -9
  138. data/lib/bio/graphics/svgee.rb +9 -11
  139. data/lib/bio/graphics/track.rb +92 -10
  140. metadata +132 -9
  141. data/README.rdoc +0 -19
  142. data/examples/annotate_snps.rb +0 -86
  143. data/examples/eg2.rb +0 -40
  144. data/examples/get_coverage_in_windows.rb +0 -176
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>parse_gff (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 111</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse_gff</span>(<span class="ruby-identifier">gff_file</span>)
15
+ <span class="ruby-identifier">require</span> <span class="ruby-value str">'bio'</span>
16
+ <span class="ruby-identifier">a</span> = []
17
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">gff_file</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
18
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^#/</span>
19
+ <span class="ruby-identifier">a</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">GFF</span><span class="ruby-operator">::</span><span class="ruby-constant">GFF3</span><span class="ruby-operator">::</span><span class="ruby-constant">Record</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">line</span>)
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-identifier">a</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>add_track (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 206</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_track</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-comment cmt">#sort out the colour/gradient options</span>
16
+ [<span class="ruby-identifier">:fill_color</span>, <span class="ruby-identifier">:exon_fill_color</span>, <span class="ruby-identifier">:utr_fill_color</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">colour_tag</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">gradients</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>])
18
+ <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">gradient</span>(<span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">gradient</span>(<span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>]))
19
+ <span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>] = <span class="ruby-node">&quot;url(##{args[colour_tag]})&quot;</span>
20
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>].<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Hash</span>)
21
+ <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">gradient</span>(<span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>])
22
+ <span class="ruby-identifier">args</span>[<span class="ruby-identifier">colour_tag</span>] = <span class="ruby-node">&quot;url(##{args[colour_tag][:id]})&quot;</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-ivar">@tracks</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Track</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
26
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">last</span>
27
+ <span class="ruby-keyword kw">end</span></pre>
28
+ </body>
29
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>get_limits (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 222</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_limits</span>
15
+ <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">track</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-identifier">lowest</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">features</span>.<span class="ruby-identifier">sort</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">y</span>.<span class="ruby-identifier">start</span> }.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">start</span>
17
+ <span class="ruby-identifier">highest</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">features</span>.<span class="ruby-identifier">sort</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">y</span>.<span class="ruby-identifier">end</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">end</span> }.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">end</span>
18
+ <span class="ruby-ivar">@scale_start</span> = <span class="ruby-identifier">lowest</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lowest</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@scale_start</span>
19
+ <span class="ruby-ivar">@scale_stop</span> = <span class="ruby-identifier">highest</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">highest</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@scale_stop</span>
20
+ <span class="ruby-ivar">@nt_per_px_x</span> = (<span class="ruby-ivar">@scale_stop</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@width</span>.<span class="ruby-identifier">to_f</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_scale (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 233</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_scale</span>
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">scale</span>(<span class="ruby-identifier">:start</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@scale_start</span>,
16
+ <span class="ruby-identifier">:stop</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@scale_stop</span>,
17
+ <span class="ruby-identifier">:number_of_intervals</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@num_intervals</span>, <span class="ruby-identifier">:page_width</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@width</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_label (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 241</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">label</span>(<span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:text</span>],
16
+ <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:x</span>],
17
+ <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:y</span>]).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_generic (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 248</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_generic</span>(<span class="ruby-identifier">args</span>) <span class="ruby-comment cmt">#remember presentation info comes from track@args when the track is defined</span>
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">generic</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_directed (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 252</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_directed</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">directed</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_circle (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 256</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_circle</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">circle</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_transcript (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 260</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_transcript</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">transcript</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_histogram (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 264</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_histogram</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">generic</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_up_triangle (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 268</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_up_triangle</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">up_triangle</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_down_triangle (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 272</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_down_triangle</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">down_triangle</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_span (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 276</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_span</span>(<span class="ruby-identifier">args</span>)
15
+ <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">span</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">g</span>) }
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,107 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw_features (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 284</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_features</span>(<span class="ruby-identifier">track</span>)
15
+ <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:histogram</span>, <span class="ruby-value str">&quot;histogram&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">track</span>.<span class="ruby-identifier">glyph</span>) <span class="ruby-comment cmt">#do different stuff for data tracks...</span>
16
+
17
+ <span class="ruby-identifier">y</span> = <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">track</span>.<span class="ruby-identifier">track_height</span>)
18
+ <span class="ruby-identifier">max</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">max_y</span> <span class="ruby-value">? </span><span class="ruby-identifier">track</span>.<span class="ruby-identifier">max_y</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">features</span>.<span class="ruby-identifier">sort</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">segment_height</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">segment_height</span> }.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">segment_height</span>
19
+ <span class="ruby-identifier">min</span> = <span class="ruby-value">0</span>
20
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">label</span>
21
+ <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+=</span> <span class="ruby-value">30</span>, <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">max</span>, <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">to_px</span>(<span class="ruby-ivar">@scale_stop</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">+</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>)
24
+ <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">min</span>, <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">to_px</span>(<span class="ruby-ivar">@scale_stop</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">+</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">track_height</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>)
25
+ <span class="ruby-identifier">data_interval</span> = <span class="ruby-identifier">max</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">min</span>
26
+ <span class="ruby-identifier">data_per_px</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">track_height</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">data_interval</span>.<span class="ruby-identifier">to_f</span>
27
+ <span class="ruby-identifier">track</span>.<span class="ruby-identifier">features</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
28
+ <span class="ruby-identifier">x</span> = <span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>)
29
+ <span class="ruby-identifier">width</span> = <span class="ruby-identifier">to_px</span>((<span class="ruby-identifier">f</span>.<span class="ruby-identifier">end</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">f</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>))
30
+ <span class="ruby-identifier">height</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">segment_height</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">data_per_px</span>
31
+ <span class="ruby-identifier">y</span> = <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">track_height</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">height</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>
32
+ <span class="ruby-comment cmt">#$stderr.puts f.segment_height, data_per_px, data_interval, max, min, &quot;------&quot;</span>
33
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;draw_#{track.glyph}&quot;</span>, {<span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">x</span>,
34
+ <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">y</span>,
35
+ <span class="ruby-identifier">:width</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">width</span>,
36
+ <span class="ruby-identifier">:height</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">height</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">track</span>.<span class="ruby-identifier">args</span>))
37
+ <span class="ruby-keyword kw">end</span>
38
+ <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">track</span>.<span class="ruby-identifier">track_height</span>) <span class="ruby-operator">+</span> <span class="ruby-value">20</span>
39
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">##following stuff for the features</span>
40
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">label</span>
41
+ <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+=</span> <span class="ruby-value">30</span>, <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>)
42
+ <span class="ruby-keyword kw">end</span>
43
+ <span class="ruby-identifier">track</span>.<span class="ruby-identifier">get_rows</span> <span class="ruby-comment cmt">##work out how many rows and which features belong in each row...</span>
44
+ <span class="ruby-identifier">track</span>.<span class="ruby-identifier">features</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
45
+ <span class="ruby-identifier">x</span> = <span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-comment cmt">#bottom left of feature</span>
46
+ <span class="ruby-identifier">all_sub_blocks</span> = []
47
+
48
+ <span class="ruby-comment cmt">#convert the exon and utr start stops to px start stops and px widths</span>
49
+ <span class="ruby-identifier">exons</span> = []
50
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">exons</span>
51
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">exons</span>.<span class="ruby-identifier">each_slice</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">exon</span><span class="ruby-operator">|</span>
52
+ <span class="ruby-identifier">all_sub_blocks</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">exon</span>
53
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exon</span>.<span class="ruby-identifier">nil?</span>
54
+ <span class="ruby-identifier">exons</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">exon</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>), <span class="ruby-identifier">to_px</span>((<span class="ruby-identifier">exon</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">exon</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>))]
55
+ <span class="ruby-keyword kw">end</span>
56
+ <span class="ruby-keyword kw">end</span>
57
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">exons</span> = <span class="ruby-identifier">exons</span>
58
+
59
+ <span class="ruby-identifier">utrs</span> = []
60
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">utrs</span>
61
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">utrs</span>.<span class="ruby-identifier">each_slice</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">utr</span><span class="ruby-operator">|</span>
62
+ <span class="ruby-identifier">all_sub_blocks</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">utr</span>
63
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">utr</span>.<span class="ruby-identifier">nil?</span>
64
+ <span class="ruby-identifier">utrs</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">utr</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>), <span class="ruby-identifier">to_px</span>((<span class="ruby-identifier">utr</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">utr</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>))]
65
+ <span class="ruby-keyword kw">end</span>
66
+ <span class="ruby-keyword kw">end</span>
67
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">utrs</span> = <span class="ruby-identifier">utrs</span>
68
+
69
+ <span class="ruby-comment cmt">#if there are any intron like gaps.. get where they would be</span>
70
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">all_sub_blocks</span>.<span class="ruby-identifier">empty?</span>
71
+ <span class="ruby-identifier">all_sub_blocks</span> = <span class="ruby-identifier">all_sub_blocks</span>.<span class="ruby-identifier">sort</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">first</span> }
72
+ <span class="ruby-identifier">all_sub_blocks</span>.<span class="ruby-identifier">each_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
73
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">all_sub_blocks</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">all_sub_blocks</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">last</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">all_sub_blocks</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">first</span> <span class="ruby-comment cmt">#skip if there is no gap</span>
74
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">block_gaps</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">all_sub_blocks</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">last</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>), <span class="ruby-identifier">to_px</span>((<span class="ruby-identifier">all_sub_blocks</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">all_sub_blocks</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">last</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>))]
75
+ <span class="ruby-keyword kw">end</span>
76
+ <span class="ruby-keyword kw">end</span>
77
+
78
+ <span class="ruby-identifier">width</span> = <span class="ruby-identifier">to_px</span>((<span class="ruby-identifier">f</span>.<span class="ruby-identifier">end</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">f</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scale_start</span>))
79
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">min_width</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">width</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">min_width</span>
80
+ <span class="ruby-identifier">width</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">min_width</span>
81
+ <span class="ruby-keyword kw">end</span>
82
+ <span class="ruby-identifier">y</span> = <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">track</span>.<span class="ruby-identifier">feature_rows</span>[<span class="ruby-identifier">index</span>] <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">feature_height</span>)
83
+
84
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;draw_#{track.glyph}&quot;</span>, {<span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">x</span>,
85
+ <span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">y</span>,
86
+ <span class="ruby-identifier">:width</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">width</span>,
87
+ <span class="ruby-identifier">:strand</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">strand</span>,
88
+ <span class="ruby-identifier">:exons</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">exons</span>,
89
+ <span class="ruby-identifier">:utrs</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">utrs</span>,
90
+ <span class="ruby-identifier">:block_gaps</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">block_gaps</span>,
91
+ <span class="ruby-identifier">:height</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">feature_height</span>
92
+ }.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">track</span>.<span class="ruby-identifier">args</span>))
93
+
94
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">id</span>
95
+ <span class="ruby-identifier">draw_label</span>(<span class="ruby-identifier">:y</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">y</span>, <span class="ruby-identifier">:x</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">width</span> <span class="ruby-value">+2</span>, <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">id</span>)
96
+ <span class="ruby-keyword kw">end</span>
97
+ <span class="ruby-keyword kw">end</span>
98
+ <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">track</span>.<span class="ruby-identifier">feature_height</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">number_rows</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-operator">+</span> <span class="ruby-value">20</span>
99
+ <span class="ruby-keyword kw">end</span>
100
+
101
+ <span class="ruby-ivar">@height</span> = <span class="ruby-ivar">@track_top</span> <span class="ruby-operator">+</span> <span class="ruby-value">100</span> <span class="ruby-comment cmt">#fudge...</span>
102
+ <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">update_height</span>(<span class="ruby-ivar">@height</span>)
103
+ <span class="ruby-comment cmt">#@svg.update_width(@width + 200)</span>
104
+
105
+ <span class="ruby-keyword kw">end</span></pre>
106
+ </body>
107
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>to_px (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 377</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_px</span>(<span class="ruby-identifier">num</span>)
15
+ (<span class="ruby-identifier">num</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@nt_per_px_x</span>.<span class="ruby-identifier">to_f</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>get_markup (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 382</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_markup</span>
15
+ <span class="ruby-identifier">get_limits</span>
16
+ <span class="ruby-identifier">draw_scale</span>
17
+ <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">track</span><span class="ruby-operator">|</span>
18
+ <span class="ruby-identifier">draw_features</span>(<span class="ruby-identifier">track</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-ivar">@svg</span>.<span class="ruby-identifier">draw</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw (Bio::Graphics::Page)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/page.rb, line 391</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>
15
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">get_markup</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>