bio-graphics 1.2 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. data/doc/classes/Bio.html +4 -26
  2. data/doc/classes/Bio/Feature.html +350 -0
  3. data/doc/classes/Bio/Feature.src/M000010.html +21 -0
  4. data/doc/classes/Bio/Feature.src/M000011.html +20 -0
  5. data/doc/classes/Bio/Feature.src/M000012.html +19 -0
  6. data/doc/classes/Bio/Feature.src/M000014.html +21 -0
  7. data/doc/classes/Bio/Feature.src/M000016.html +21 -0
  8. data/doc/classes/Bio/Feature.src/M000034.html +21 -0
  9. data/doc/classes/Bio/Feature.src/M000035.html +20 -0
  10. data/doc/classes/Bio/Feature.src/M000036.html +19 -0
  11. data/doc/classes/Bio/Feature.src/M000038.html +21 -0
  12. data/doc/classes/Bio/Feature.src/M000040.html +21 -0
  13. data/doc/classes/Bio/Feature.src/M000042.html +21 -0
  14. data/doc/classes/Bio/Feature.src/M000043.html +20 -0
  15. data/doc/classes/Bio/Feature.src/M000044.html +21 -0
  16. data/doc/classes/Bio/Feature.src/M000045.html +20 -0
  17. data/doc/classes/Bio/Feature.src/M000046.html +19 -0
  18. data/doc/classes/Bio/Feature.src/M000048.html +21 -0
  19. data/doc/classes/Bio/Feature.src/M000050.html +21 -0
  20. data/doc/classes/Bio/Feature.src/M000074.html +21 -0
  21. data/doc/classes/Bio/Feature.src/M000075.html +20 -0
  22. data/doc/classes/Bio/Feature.src/M000076.html +19 -0
  23. data/doc/classes/Bio/Feature.src/M000078.html +21 -0
  24. data/doc/classes/Bio/Feature.src/M000080.html +21 -0
  25. data/doc/classes/Bio/Feature/Qualifier.html +189 -0
  26. data/doc/classes/Bio/Feature/Qualifier.src/M000017.html +18 -0
  27. data/doc/classes/Bio/Feature/Qualifier.src/M000041.html +18 -0
  28. data/doc/classes/Bio/Feature/Qualifier.src/M000049.html +18 -0
  29. data/doc/classes/Bio/Feature/Qualifier.src/M000051.html +18 -0
  30. data/doc/classes/Bio/Feature/Qualifier.src/M000081.html +18 -0
  31. data/doc/classes/Bio/Features.html +329 -0
  32. data/doc/classes/Bio/Features.src/M000004.html +18 -0
  33. data/doc/classes/Bio/Features.src/M000005.html +19 -0
  34. data/doc/classes/Bio/Features.src/M000006.html +21 -0
  35. data/doc/classes/Bio/Features.src/M000007.html +18 -0
  36. data/doc/classes/Bio/Features.src/M000008.html +18 -0
  37. data/doc/classes/Bio/Features.src/M000009.html +18 -0
  38. data/doc/classes/Bio/Features.src/M000028.html +18 -0
  39. data/doc/classes/Bio/Features.src/M000029.html +19 -0
  40. data/doc/classes/Bio/Features.src/M000030.html +21 -0
  41. data/doc/classes/Bio/Features.src/M000031.html +18 -0
  42. data/doc/classes/Bio/Features.src/M000032.html +18 -0
  43. data/doc/classes/Bio/Features.src/M000033.html +18 -0
  44. data/doc/classes/Bio/Features.src/M000036.html +18 -0
  45. data/doc/classes/Bio/Features.src/M000037.html +19 -0
  46. data/doc/classes/Bio/Features.src/M000038.html +18 -0
  47. data/doc/classes/Bio/Features.src/M000039.html +19 -0
  48. data/doc/classes/Bio/Features.src/M000040.html +21 -0
  49. data/doc/classes/Bio/Features.src/M000041.html +18 -0
  50. data/doc/classes/Bio/Features.src/M000042.html +18 -0
  51. data/doc/classes/Bio/Features.src/M000043.html +18 -0
  52. data/doc/classes/Bio/Features.src/M000068.html +18 -0
  53. data/doc/classes/Bio/Features.src/M000069.html +19 -0
  54. data/doc/classes/Bio/Features.src/M000070.html +21 -0
  55. data/doc/classes/Bio/Features.src/M000071.html +18 -0
  56. data/doc/classes/Bio/Features.src/M000072.html +18 -0
  57. data/doc/classes/Bio/Features.src/M000073.html +18 -0
  58. data/doc/classes/Bio/Graphics.html +28 -42
  59. data/doc/classes/Bio/Graphics/{Panel/Track/Feature.html → Feature.html} +98 -125
  60. data/doc/classes/Bio/Graphics/Feature.src/M000020.html +51 -0
  61. data/doc/classes/Bio/Graphics/Feature.src/M000021.html +65 -0
  62. data/doc/classes/Bio/Graphics/Feature.src/M000022.html +55 -0
  63. data/doc/classes/Bio/Graphics/Feature.src/M000023.html +66 -0
  64. data/doc/classes/Bio/Graphics/Feature.src/M000024.html +51 -0
  65. data/doc/classes/Bio/Graphics/Feature.src/M000025.html +65 -0
  66. data/doc/classes/Bio/Graphics/Feature.src/M000026.html +55 -0
  67. data/doc/classes/Bio/Graphics/Feature.src/M000054.html +51 -0
  68. data/doc/classes/Bio/Graphics/Feature.src/M000055.html +65 -0
  69. data/doc/classes/Bio/Graphics/Feature.src/M000056.html +55 -0
  70. data/doc/classes/Bio/Graphics/Feature/SubFeature.html +348 -0
  71. data/doc/classes/Bio/Graphics/Feature/SubFeature.src/M000025.html +68 -0
  72. data/doc/classes/Bio/Graphics/Feature/SubFeature.src/M000026.html +67 -0
  73. data/doc/classes/Bio/Graphics/Glyph.html +178 -0
  74. data/doc/classes/Bio/Graphics/Glyph/Box.html +139 -0
  75. data/doc/classes/Bio/Graphics/Glyph/Box.src/M000004.html +24 -0
  76. data/doc/classes/Bio/Graphics/Glyph/Box.src/M000032.html +24 -0
  77. data/doc/classes/Bio/Graphics/Glyph/Common.html +187 -0
  78. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000004.html +18 -0
  79. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000005.html +18 -0
  80. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000006.html +24 -0
  81. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000007.html +24 -0
  82. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000033.html +18 -0
  83. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000034.html +24 -0
  84. data/doc/classes/Bio/Graphics/Glyph/Common.src/M000035.html +24 -0
  85. data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyph.html +139 -0
  86. data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyph.src/M000037.html +22 -0
  87. data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyphInFile.html +139 -0
  88. data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyphInFile.src/M000038.html +22 -0
  89. data/doc/classes/Bio/Graphics/Glyph/DirectedBox.html +139 -0
  90. data/doc/classes/Bio/Graphics/Glyph/DirectedBox.src/M000009.html +31 -0
  91. data/doc/classes/Bio/Graphics/Glyph/DirectedBox.src/M000039.html +31 -0
  92. data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.html +139 -0
  93. data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000011.html +26 -0
  94. data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000013.html +26 -0
  95. data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000043.html +26 -0
  96. data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.html +139 -0
  97. data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000008.html +40 -0
  98. data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000010.html +40 -0
  99. data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000040.html +40 -0
  100. data/doc/classes/Bio/Graphics/{Panel/Track/Feature/PixelRange.html → Glyph/Dot.html} +16 -19
  101. data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000013.html +22 -0
  102. data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000015.html +22 -0
  103. data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000045.html +22 -0
  104. data/doc/classes/Bio/Graphics/Glyph/Generic.html +139 -0
  105. data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000009.html +18 -0
  106. data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000011.html +18 -0
  107. data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000041.html +18 -0
  108. data/doc/classes/Bio/Graphics/Glyph/Line.html +139 -0
  109. data/doc/classes/Bio/Graphics/Glyph/Line.src/M000012.html +20 -0
  110. data/doc/classes/Bio/Graphics/Glyph/Line.src/M000014.html +20 -0
  111. data/doc/classes/Bio/Graphics/Glyph/Line.src/M000044.html +20 -0
  112. data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.html +139 -0
  113. data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000014.html +28 -0
  114. data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000016.html +28 -0
  115. data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000046.html +28 -0
  116. data/doc/classes/Bio/Graphics/Glyph/Spliced.html +139 -0
  117. data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000010.html +19 -0
  118. data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000012.html +19 -0
  119. data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000042.html +19 -0
  120. data/doc/classes/Bio/Graphics/Glyph/Transcript.html +113 -0
  121. data/doc/classes/Bio/Graphics/Glyph/Triangle.html +139 -0
  122. data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000007.html +21 -0
  123. data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000008.html +21 -0
  124. data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000036.html +21 -0
  125. data/doc/classes/{ImageMap.html → Bio/Graphics/ImageMap.html} +50 -16
  126. data/doc/classes/{ImageMap.src/M000001.html → Bio/Graphics/ImageMap.src/M000030.html} +3 -3
  127. data/doc/classes/Bio/Graphics/ImageMap.src/M000031.html +18 -0
  128. data/doc/classes/Bio/Graphics/ImageMap.src/M000032.html +18 -0
  129. data/doc/classes/Bio/Graphics/ImageMap.src/M000033.html +18 -0
  130. data/doc/classes/{ImageMap.src/M000002.html → Bio/Graphics/ImageMap.src/M000034.html} +7 -4
  131. data/doc/classes/Bio/Graphics/ImageMap.src/M000035.html +24 -0
  132. data/doc/classes/Bio/Graphics/ImageMap.src/M000062.html +18 -0
  133. data/doc/classes/Bio/Graphics/ImageMap.src/M000063.html +18 -0
  134. data/doc/classes/Bio/Graphics/ImageMap.src/M000064.html +27 -0
  135. data/doc/classes/Bio/Graphics/ImageMap.src/M000065.html +24 -0
  136. data/doc/classes/{ImageMap/ImageMapElement.html → Bio/Graphics/ImageMap/Element.html} +14 -14
  137. data/doc/classes/{ImageMap/ImageMapElement.src/M000003.html → Bio/Graphics/ImageMap/Element.src/M000034.html} +3 -3
  138. data/doc/classes/{ImageMap/ImageMapElement.src/M000004.html → Bio/Graphics/ImageMap/Element.src/M000035.html} +6 -4
  139. data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000036.html +19 -0
  140. data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000037.html +22 -0
  141. data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000066.html +19 -0
  142. data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000067.html +22 -0
  143. data/doc/classes/Bio/Graphics/Panel.html +70 -69
  144. data/doc/classes/Bio/Graphics/Panel.src/M000025.html +52 -0
  145. data/doc/classes/Bio/Graphics/Panel.src/M000026.html +20 -0
  146. data/doc/classes/Bio/Graphics/Panel.src/M000027.html +98 -0
  147. data/doc/classes/Bio/Graphics/Panel.src/M000028.html +20 -0
  148. data/doc/classes/Bio/Graphics/Panel.src/M000029.html +52 -0
  149. data/doc/classes/Bio/Graphics/Panel.src/M000030.html +20 -0
  150. data/doc/classes/Bio/Graphics/Panel.src/M000031.html +98 -0
  151. data/doc/classes/Bio/Graphics/Panel.src/M000059.html +52 -0
  152. data/doc/classes/Bio/Graphics/Panel.src/M000060.html +20 -0
  153. data/doc/classes/Bio/Graphics/Panel.src/M000061.html +98 -0
  154. data/doc/classes/Bio/Graphics/{Panel/Ruler.html → Ruler.html} +50 -21
  155. data/doc/classes/Bio/Graphics/Ruler.src/M000015.html +30 -0
  156. data/doc/classes/Bio/Graphics/Ruler.src/M000016.html +20 -0
  157. data/doc/classes/Bio/Graphics/Ruler.src/M000017.html +30 -0
  158. data/doc/classes/Bio/Graphics/Ruler.src/M000018.html +20 -0
  159. data/doc/classes/Bio/Graphics/Ruler.src/M000019.html +26 -0
  160. data/doc/classes/Bio/Graphics/Ruler.src/M000020.html +45 -0
  161. data/doc/classes/Bio/Graphics/Ruler.src/M000047.html +30 -0
  162. data/doc/classes/Bio/Graphics/Ruler.src/M000048.html +20 -0
  163. data/doc/classes/Bio/Graphics/Ruler.src/M000049.html +26 -0
  164. data/doc/classes/Bio/Graphics/Ruler.src/M000050.html +45 -0
  165. data/doc/classes/Bio/Graphics/SubFeature.html +348 -0
  166. data/doc/classes/Bio/Graphics/SubFeature.src/M000001.html +73 -0
  167. data/doc/classes/Bio/Graphics/SubFeature.src/M000002.html +69 -0
  168. data/doc/classes/Bio/Graphics/SubFeature.src/M000023.html +73 -0
  169. data/doc/classes/Bio/Graphics/SubFeature.src/M000024.html +69 -0
  170. data/doc/classes/Bio/Graphics/SubFeature.src/M000027.html +73 -0
  171. data/doc/classes/Bio/Graphics/SubFeature.src/M000028.html +69 -0
  172. data/doc/classes/Bio/Graphics/SubFeature.src/M000057.html +73 -0
  173. data/doc/classes/Bio/Graphics/SubFeature.src/M000058.html +69 -0
  174. data/doc/classes/Bio/Graphics/{Panel/Track.html → Track.html} +67 -69
  175. data/doc/classes/Bio/Graphics/Track.src/M000017.html +39 -0
  176. data/doc/classes/Bio/Graphics/Track.src/M000018.html +37 -0
  177. data/doc/classes/Bio/Graphics/Track.src/M000019.html +45 -0
  178. data/doc/classes/Bio/Graphics/Track.src/M000020.html +41 -0
  179. data/doc/classes/Bio/Graphics/Track.src/M000021.html +39 -0
  180. data/doc/classes/Bio/Graphics/Track.src/M000022.html +37 -0
  181. data/doc/classes/Bio/Graphics/Track.src/M000023.html +45 -0
  182. data/doc/classes/Bio/Graphics/Track.src/M000051.html +39 -0
  183. data/doc/classes/Bio/Graphics/Track.src/M000052.html +37 -0
  184. data/doc/classes/Bio/Graphics/Track.src/M000053.html +45 -0
  185. data/doc/classes/Range.html +129 -0
  186. data/doc/classes/String.html +167 -0
  187. data/doc/classes/String.src/M000001.html +18 -0
  188. data/doc/classes/String.src/M000002.html +18 -0
  189. data/doc/classes/String.src/M000003.html +23 -0
  190. data/doc/classes/String.src/M000029.html +18 -0
  191. data/doc/classes/String.src/M000030.html +18 -0
  192. data/doc/classes/String.src/M000031.html +23 -0
  193. data/doc/classes/TestCustomGlyph.html +137 -0
  194. data/doc/classes/TestCustomGlyph.src/M000025.html +25 -0
  195. data/doc/classes/TestCustomGlyphInFile.html +167 -0
  196. data/doc/classes/TestCustomGlyphInFile.src/M000026.html +19 -0
  197. data/doc/classes/TestCustomGlyphInFile.src/M000027.html +25 -0
  198. data/doc/classes/TestCustomGlyphInFile.src/M000028.html +18 -0
  199. data/doc/classes/TestExtensions.html +152 -0
  200. data/doc/classes/TestExtensions.src/M000015.html +22 -0
  201. data/doc/classes/TestExtensions.src/M000016.html +25 -0
  202. data/doc/classes/TestFeature.html +152 -0
  203. data/doc/classes/TestFeature.src/M000017.html +19 -0
  204. data/doc/classes/TestFeature.src/M000018.html +21 -0
  205. data/doc/classes/TestImageMap.html +182 -0
  206. data/doc/classes/TestImageMap.src/M000019.html +22 -0
  207. data/doc/classes/TestImageMap.src/M000020.html +56 -0
  208. data/doc/classes/TestImageMap.src/M000021.html +56 -0
  209. data/doc/classes/TestImageMap.src/M000022.html +20 -0
  210. data/doc/classes/TestPanel.html +276 -0
  211. data/doc/classes/TestPanel.src/M000001.html +18 -0
  212. data/doc/classes/TestPanel.src/M000002.html +61 -0
  213. data/doc/classes/TestPanel.src/M000003.html +35 -0
  214. data/doc/classes/TestPanel.src/M000004.html +54 -0
  215. data/doc/classes/TestPanel.src/M000005.html +54 -0
  216. data/doc/classes/TestPanel.src/M000006.html +41 -0
  217. data/doc/classes/TestPanel.src/M000007.html +36 -0
  218. data/doc/classes/TestPanel.src/M000008.html +20 -0
  219. data/doc/classes/TestPanel.src/M000009.html +26 -0
  220. data/doc/classes/TestPanel.src/M000010.html +21 -0
  221. data/doc/classes/TestRuler.html +152 -0
  222. data/doc/classes/TestRuler.src/M000013.html +22 -0
  223. data/doc/classes/TestRuler.src/M000014.html +31 -0
  224. data/doc/classes/TestSubFeature.html +152 -0
  225. data/doc/classes/TestSubFeature.src/M000023.html +21 -0
  226. data/doc/classes/TestSubFeature.src/M000024.html +18 -0
  227. data/doc/classes/TestTrack.html +152 -0
  228. data/doc/classes/TestTrack.src/M000011.html +19 -0
  229. data/doc/classes/TestTrack.src/M000012.html +23 -0
  230. data/doc/created.rid +1 -1
  231. data/doc/files/README_DEV.html +399 -70
  232. data/doc/files/TUTORIAL.html +188 -67
  233. data/doc/files/lib/bio-graphics_rb.html +3 -2
  234. data/doc/files/lib/bio/graphics/feature_rb.html +12 -6
  235. data/doc/files/lib/bio/graphics/glyphs/box_rb.html +113 -0
  236. data/doc/files/lib/bio/graphics/glyphs/common_rb.html +113 -0
  237. data/doc/files/lib/bio/graphics/glyphs/directed_box_rb.html +113 -0
  238. data/doc/files/lib/bio/graphics/glyphs/directed_generic_rb.html +113 -0
  239. data/doc/files/lib/bio/graphics/glyphs/directed_spliced_rb.html +113 -0
  240. data/doc/files/lib/bio/graphics/glyphs/dot_rb.html +113 -0
  241. data/doc/files/lib/bio/graphics/glyphs/generic_rb.html +113 -0
  242. data/doc/files/lib/bio/graphics/glyphs/line_rb.html +113 -0
  243. data/doc/files/lib/bio/graphics/glyphs/line_with_handles_rb.html +113 -0
  244. data/doc/files/lib/bio/graphics/glyphs/spliced_rb.html +113 -0
  245. data/doc/files/lib/bio/graphics/glyphs/transcript_rb.html +113 -0
  246. data/doc/files/lib/bio/graphics/glyphs/triangle_rb.html +113 -0
  247. data/doc/files/lib/bio/graphics/image_map_rb.html +3 -2
  248. data/doc/files/lib/bio/graphics/panel_rb.html +10 -2
  249. data/doc/files/lib/bio/graphics/ruler_rb.html +3 -2
  250. data/doc/files/lib/bio/graphics/subfeature_rb.html +114 -0
  251. data/doc/files/lib/bio/graphics/track_rb.html +3 -2
  252. data/doc/files/lib/feature_rb.html +101 -0
  253. data/doc/files/samples/arkdb_features_rb.html +101 -0
  254. data/doc/files/samples/glyph_showcase_rb.html +108 -0
  255. data/doc/files/samples/protein_domains_rb.html +115 -0
  256. data/doc/files/samples/subfeatures_rb.html +108 -0
  257. data/doc/files/scripts/gff2png_rb.html +154 -0
  258. data/doc/files/test/unit/custom_glyph_in_file_rb.html +101 -0
  259. data/doc/files/test/unit/test_class_extensions_rb.html +108 -0
  260. data/doc/files/test/unit/test_creation_rb.html +108 -0
  261. data/doc/files/test/unit/test_custom_glyph_rb.html +108 -0
  262. data/doc/files/test/unit/test_draw_rb.html +108 -0
  263. data/doc/files/test/unit/test_imagemap_rb.html +108 -0
  264. data/doc/files/test/unit/test_subfeatures_rb.html +108 -0
  265. data/doc/fr_class_index.html +24 -6
  266. data/doc/fr_file_index.html +14 -0
  267. data/doc/fr_method_index.html +51 -19
  268. data/doc/images/glyph_showcase.png +0 -0
  269. data/doc/images/terms.svg +146 -132
  270. data/images/glyph_showcase.png +0 -0
  271. data/lib/bio-graphics.rb +38 -6
  272. data/lib/bio/graphics/feature.rb +212 -440
  273. data/lib/bio/graphics/glyphs/box.rb +21 -0
  274. data/lib/bio/graphics/glyphs/common.rb +149 -0
  275. data/lib/bio/graphics/glyphs/directed_box.rb +28 -0
  276. data/lib/bio/graphics/glyphs/directed_generic.rb +23 -0
  277. data/lib/bio/graphics/glyphs/directed_spliced.rb +39 -0
  278. data/lib/bio/graphics/glyphs/dot.rb +21 -0
  279. data/lib/bio/graphics/glyphs/generic.rb +15 -0
  280. data/lib/bio/graphics/glyphs/line.rb +17 -0
  281. data/lib/bio/graphics/glyphs/line_with_handles.rb +25 -0
  282. data/lib/bio/graphics/glyphs/spliced.rb +16 -0
  283. data/lib/bio/graphics/glyphs/transcript.rb +12 -0
  284. data/lib/bio/graphics/glyphs/triangle.rb +18 -0
  285. data/lib/bio/graphics/image_map.rb +25 -4
  286. data/lib/bio/graphics/panel.rb +266 -209
  287. data/lib/bio/graphics/ruler.rb +95 -96
  288. data/lib/bio/graphics/subfeature.rb +187 -0
  289. data/lib/bio/graphics/track.rb +155 -156
  290. data/lib/feature.rb +204 -0
  291. data/samples/arkdb_features.rb +10 -8
  292. data/samples/glyph_showcase.rb +58 -22
  293. data/samples/protein_domains.rb +19 -0
  294. data/samples/subfeatures.rb +31 -0
  295. data/test/unit/custom_glyph_in_file.rb +12 -0
  296. data/test/unit/data.txt +32 -0
  297. data/test/unit/test_class_extensions.rb +23 -0
  298. data/test/unit/test_creation.rb +43 -13
  299. data/test/unit/test_custom_glyph.rb +50 -0
  300. data/test/unit/test_draw.rb +211 -0
  301. data/test/unit/test_imagemap.rb +134 -0
  302. data/test/unit/test_subfeatures.rb +17 -0
  303. metadata +396 -119
  304. data/doc/classes/Bio/Graphics/Panel.src/M000005.html +0 -29
  305. data/doc/classes/Bio/Graphics/Panel.src/M000006.html +0 -19
  306. data/doc/classes/Bio/Graphics/Panel.src/M000007.html +0 -68
  307. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000008.html +0 -20
  308. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000009.html +0 -28
  309. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000010.html +0 -54
  310. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000013.html +0 -20
  311. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000014.html +0 -20
  312. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000015.html +0 -28
  313. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000016.html +0 -59
  314. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000017.html +0 -20
  315. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000018.html +0 -28
  316. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000019.html +0 -59
  317. data/doc/classes/Bio/Graphics/Panel/Track.src/M000008.html +0 -26
  318. data/doc/classes/Bio/Graphics/Panel/Track.src/M000009.html +0 -42
  319. data/doc/classes/Bio/Graphics/Panel/Track.src/M000010.html +0 -52
  320. data/doc/classes/Bio/Graphics/Panel/Track.src/M000011.html +0 -23
  321. data/doc/classes/Bio/Graphics/Panel/Track.src/M000012.html +0 -43
  322. data/doc/classes/Bio/Graphics/Panel/Track.src/M000013.html +0 -259
  323. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000011.html +0 -65
  324. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000012.html +0 -39
  325. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000013.html +0 -27
  326. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000014.html +0 -225
  327. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000015.html +0 -48
  328. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000012.html +0 -18
  329. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000013.html +0 -18
  330. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000015.html +0 -18
  331. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000016.html +0 -18
@@ -1,65 +0,0 @@
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>new (Bio::Graphics::Panel::Track::Feature)</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/feature.rb, line 38</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">track</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">location</span> = <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Locations</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'1..'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_s</span>), <span class="ruby-identifier">link</span> = <span class="ruby-keyword kw">nil</span>)
15
- <span class="ruby-ivar">@track</span> = <span class="ruby-identifier">track</span>
16
- <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
17
- <span class="ruby-ivar">@location</span> = <span class="ruby-identifier">location</span>
18
- <span class="ruby-ivar">@start</span> = <span class="ruby-identifier">location</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span>}.<span class="ruby-identifier">min</span>.<span class="ruby-identifier">to_i</span>
19
- <span class="ruby-ivar">@stop</span> = <span class="ruby-identifier">location</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span>}.<span class="ruby-identifier">max</span>.<span class="ruby-identifier">to_i</span>
20
- <span class="ruby-ivar">@strand</span> = <span class="ruby-identifier">location</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strand</span>.<span class="ruby-identifier">to_i</span>
21
- <span class="ruby-ivar">@link</span> = <span class="ruby-identifier">link</span>
22
- <span class="ruby-ivar">@pixel_range_collection</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
23
- <span class="ruby-ivar">@chopped_at_start</span> = <span class="ruby-keyword kw">false</span>
24
- <span class="ruby-ivar">@chopped_at_stop</span> = <span class="ruby-keyword kw">false</span>
25
- <span class="ruby-ivar">@hidden_subfeatures_at_start</span> = <span class="ruby-keyword kw">false</span>
26
- <span class="ruby-ivar">@hidden_subfeatures_at_stop</span> = <span class="ruby-keyword kw">false</span>
27
-
28
- <span class="ruby-comment cmt"># Get all pixel ranges for the subfeatures
29
- <span class="ruby-identifier">location</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
30
- <span class="ruby-comment cmt"># xxxxxx [ ]
31
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
32
- <span class="ruby-ivar">@hidden_subfeatures_at_start</span> = <span class="ruby-keyword kw">true</span>
33
- <span class="ruby-keyword kw">next</span>
34
- <span class="ruby-comment cmt"># [ ] xxxxx
35
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>
36
- <span class="ruby-ivar">@hidden_subfeatures_at_stop</span> = <span class="ruby-keyword kw">true</span>
37
- <span class="ruby-keyword kw">next</span>
38
- <span class="ruby-comment cmt"># xxxx[xxx ]
39
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
40
- <span class="ruby-identifier">start_pixel</span> = <span class="ruby-value">1</span>
41
- <span class="ruby-identifier">stop_pixel</span> = ( <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> ).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
42
- <span class="ruby-ivar">@chopped_at_start</span> = <span class="ruby-keyword kw">true</span>
43
- <span class="ruby-comment cmt"># [ xxxx]xxxx
44
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>
45
- <span class="ruby-identifier">start_pixel</span> = ( <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> ).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
46
- <span class="ruby-identifier">stop_pixel</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>
47
- <span class="ruby-ivar">@chopped_at_stop</span> = <span class="ruby-keyword kw">true</span>
48
- <span class="ruby-comment cmt"># xxxx[xxxxxxxxxx]xxxx
49
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>
50
- <span class="ruby-identifier">start_pixel</span> = <span class="ruby-value">1</span>
51
- <span class="ruby-identifier">stop_pixel</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>
52
- <span class="ruby-ivar">@chopped_at_start</span> = <span class="ruby-keyword kw">true</span>
53
- <span class="ruby-ivar">@chopped_at_stop</span> = <span class="ruby-keyword kw">true</span>
54
- <span class="ruby-comment cmt"># [ xxxxx ]
55
- <span class="ruby-keyword kw">else</span>
56
- <span class="ruby-identifier">start_pixel</span> = ( <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> ).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
57
- <span class="ruby-identifier">stop_pixel</span> = ( <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span> ).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
58
- <span class="ruby-keyword kw">end</span>
59
-
60
- <span class="ruby-ivar">@pixel_range_collection</span>.<span class="ruby-identifier">push</span>(<span class="ruby-constant">PixelRange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">stop_pixel</span>))
61
-
62
- <span class="ruby-keyword kw">end</span>
63
- <span class="ruby-keyword kw">end</span></pre>
64
- </body>
65
- </html>
@@ -1,39 +0,0 @@
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>arrow (Bio::Graphics::Panel::Track::Feature)</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/feature.rb, line 129</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track</span>,<span class="ruby-identifier">direction</span>,<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">size</span>)
15
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">direction</span>
16
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:right</span>
17
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>)
18
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
19
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
20
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
21
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:left</span>
22
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>)
23
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
24
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
25
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
26
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:north</span>
27
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">x</span><span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">+</span><span class="ruby-identifier">size</span>)
28
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-operator">-</span><span class="ruby-identifier">size</span>)
29
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
30
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
31
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:south</span>
32
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">x</span><span class="ruby-operator">-</span><span class="ruby-identifier">size</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">-</span><span class="ruby-identifier">size</span>)
33
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-identifier">size</span>)
34
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-identifier">size</span>,<span class="ruby-operator">-</span><span class="ruby-identifier">size</span>)
35
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
36
- <span class="ruby-keyword kw">end</span>
37
- <span class="ruby-keyword kw">end</span></pre>
38
- </body>
39
- </html>
@@ -1,27 +0,0 @@
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>connector (Bio::Graphics::Panel::Track::Feature)</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/feature.rb, line 156</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connector</span>(<span class="ruby-identifier">track</span>,<span class="ruby-identifier">from</span>,<span class="ruby-identifier">to</span>,<span class="ruby-identifier">top</span>, <span class="ruby-identifier">color</span>)
15
- <span class="ruby-identifier">line_width</span> = <span class="ruby-identifier">track</span>.<span class="ruby-identifier">line_width</span>
16
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">set_source_rgb</span>([<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>])
17
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">set_line_width</span>(<span class="ruby-value">0</span><span class="ruby-value">.5</span>)
18
- <span class="ruby-identifier">middle</span> = <span class="ruby-identifier">from</span> <span class="ruby-operator">+</span> ((<span class="ruby-identifier">to</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">from</span>)<span class="ruby-operator">/</span><span class="ruby-value">2</span>)
19
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">top</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>)
20
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">middle</span>, <span class="ruby-identifier">top</span><span class="ruby-operator">+</span><span class="ruby-value">7</span>)
21
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">top</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>)
22
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">stroke</span>
23
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">set_line_width</span>(<span class="ruby-identifier">line_width</span>)
24
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">set_source_rgb</span>(<span class="ruby-identifier">color</span>)
25
- <span class="ruby-keyword kw">end</span></pre>
26
- </body>
27
- </html>
@@ -1,225 +0,0 @@
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::Panel::Track::Feature)</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/feature.rb, line 178</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">track_drawing</span>)
15
- <span class="ruby-comment cmt"># We have to check if we want to change the glyph type from directed to
16
- <span class="ruby-comment cmt"># undirected
17
- <span class="ruby-comment cmt"># There are 2 cases where we don't want to draw arrows on
18
- <span class="ruby-comment cmt"># features:
19
- <span class="ruby-comment cmt"># (a) when the picture is really zoomed out, features are
20
- <span class="ruby-comment cmt"># so small that the arrow itself is too big
21
- <span class="ruby-comment cmt"># (b) if a directed feature on the fw strand extends beyond
22
- <span class="ruby-comment cmt"># the end of the picture, the arrow is out of view. This
23
- <span class="ruby-comment cmt"># is the same as considering the feature as undirected.
24
- <span class="ruby-comment cmt"># The same obviously goes for features on the reverse
25
- <span class="ruby-comment cmt"># strand that extend beyond the left side of the image.
26
- <span class="ruby-comment cmt">#
27
- <span class="ruby-comment cmt"># (a) Zoomed out
28
- <span class="ruby-identifier">replace_directed_with_undirected</span> = <span class="ruby-keyword kw">false</span>
29
- <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stop</span> <span class="ruby-operator">-</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>).<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">2</span>
30
- <span class="ruby-identifier">replace_directed_with_undirected</span> = <span class="ruby-keyword kw">true</span>
31
- <span class="ruby-keyword kw">end</span>
32
- <span class="ruby-comment cmt"># (b) Extending beyond borders picture
33
- <span class="ruby-keyword kw">if</span> ( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">chopped_at_stop</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">strand</span> = <span class="ruby-value">1</span> ) <span class="ruby-keyword kw">or</span> ( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">chopped_at_start</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">strand</span> = <span class="ruby-value">-1</span> )
34
- <span class="ruby-identifier">replace_directed_with_undirected</span> = <span class="ruby-keyword kw">true</span>
35
- <span class="ruby-keyword kw">end</span>
36
-
37
- <span class="ruby-identifier">local_feature_glyph</span> = <span class="ruby-keyword kw">nil</span>
38
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">glyph</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:directed_generic</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">replace_directed_with_undirected</span>
39
- <span class="ruby-identifier">local_feature_glyph</span> = <span class="ruby-identifier">:generic</span>
40
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">glyph</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:directed_spliced</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">replace_directed_with_undirected</span>
41
- <span class="ruby-identifier">local_feature_glyph</span> = <span class="ruby-identifier">:spliced</span>
42
- <span class="ruby-keyword kw">else</span>
43
- <span class="ruby-identifier">local_feature_glyph</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">glyph</span>
44
- <span class="ruby-keyword kw">end</span>
45
-
46
- <span class="ruby-comment cmt"># And draw the thing.
47
- <span class="ruby-identifier">row</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_row</span>
48
- <span class="ruby-identifier">top_pixel_of_feature</span> = <span class="ruby-constant">FEATURE_V_DISTANCE</span> <span class="ruby-operator">+</span> (<span class="ruby-constant">FEATURE_HEIGHT</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_V_DISTANCE</span>)<span class="ruby-operator">*</span><span class="ruby-identifier">row</span>
49
- <span class="ruby-identifier">bottom_pixel_of_feature</span> = <span class="ruby-identifier">top_pixel_of_feature</span> <span class="ruby-operator">+</span> <span class="ruby-constant">FEATURE_HEIGHT</span>
50
-
51
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">local_feature_glyph</span>
52
- <span class="ruby-comment cmt"># triangles are typical for features which have a 1 bp position (start == stop)
53
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:triangle</span>
54
- <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Start and stop are not the same (necessary if you want triangle glyphs)&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stop</span>
55
-
56
- <span class="ruby-comment cmt"># Need to get this for the imagemap
57
- <span class="ruby-identifier">left_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>
58
- <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">stop_pixel</span> <span class="ruby-operator">+</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>
59
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:north</span>,<span class="ruby-identifier">left_pixel_of_feature</span> <span class="ruby-operator">+</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
60
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">stroke</span>
61
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:line</span>
62
- <span class="ruby-identifier">left_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
63
- <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
64
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">left_pixel_of_feature</span>,<span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
65
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">right_pixel_of_feature</span>,<span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
66
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">stroke</span>
67
-
68
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">set_source_rgb</span>([<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>])
69
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:right</span>,<span class="ruby-identifier">left_pixel_of_feature</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
70
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">stroke</span>
71
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:left</span>,<span class="ruby-identifier">right_pixel_of_feature</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
72
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">stroke</span>
73
-
74
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">set_source_rgb</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">colour</span>)
75
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:directed_generic</span>
76
- <span class="ruby-comment cmt"># Need to get this for the imagemap
77
- <span class="ruby-identifier">left_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
78
- <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
79
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">strand</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span> <span class="ruby-comment cmt"># Reverse strand
80
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">left_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-identifier">right_pixel_of_feature</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">left_pixel_of_feature</span> <span class="ruby-operator">-</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
81
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:left</span>,<span class="ruby-identifier">left_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
82
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
83
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">#default is forward strand
84
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">left_pixel_of_feature</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-identifier">right_pixel_of_feature</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">left_pixel_of_feature</span> <span class="ruby-operator">-</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
85
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:right</span>,<span class="ruby-identifier">right_pixel_of_feature</span><span class="ruby-operator">-</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
86
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
87
- <span class="ruby-keyword kw">end</span>
88
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:spliced</span>
89
- <span class="ruby-identifier">gap_starts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
90
- <span class="ruby-identifier">gap_stops</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
91
-
92
- <span class="ruby-comment cmt"># Need to get this for the imagemap
93
- <span class="ruby-identifier">left_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
94
- <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
95
-
96
- <span class="ruby-comment cmt"># First draw the parts
97
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span>
98
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, (<span class="ruby-identifier">pr</span>.<span class="ruby-identifier">stop_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>), <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
99
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>.<span class="ruby-identifier">stop_pixel</span>)
100
- <span class="ruby-identifier">gap_stops</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>)
101
- <span class="ruby-keyword kw">end</span>
102
-
103
- <span class="ruby-comment cmt"># And then draw the connections in the gaps
104
- <span class="ruby-comment cmt"># Start with removing the very first start and the very last stop.
105
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">sort!</span>.<span class="ruby-identifier">pop</span>
106
- <span class="ruby-identifier">gap_stops</span>.<span class="ruby-identifier">sort!</span>.<span class="ruby-identifier">shift</span>
107
-
108
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gap_number</span><span class="ruby-operator">|</span>
109
- <span class="ruby-identifier">connector</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">gap_starts</span>[<span class="ruby-identifier">gap_number</span>].<span class="ruby-identifier">to_f</span>,<span class="ruby-identifier">gap_stops</span>[<span class="ruby-identifier">gap_number</span>].<span class="ruby-identifier">to_f</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-identifier">track</span>.<span class="ruby-identifier">colour</span>)
110
- <span class="ruby-keyword kw">end</span>
111
-
112
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hidden_subfeatures_at_stop</span>
113
- <span class="ruby-identifier">from</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
114
- <span class="ruby-identifier">to</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>
115
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)
116
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)
117
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">stroke</span>
118
- <span class="ruby-keyword kw">end</span>
119
-
120
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hidden_subfeatures_at_start</span>
121
- <span class="ruby-identifier">from</span> = <span class="ruby-value">1</span>
122
- <span class="ruby-identifier">to</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
123
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)
124
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)
125
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">stroke</span>
126
- <span class="ruby-keyword kw">end</span>
127
-
128
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:directed_spliced</span>
129
- <span class="ruby-identifier">gap_starts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
130
- <span class="ruby-identifier">gap_stops</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
131
- <span class="ruby-comment cmt"># First draw the parts
132
- <span class="ruby-identifier">locations</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">from</span>}
133
-
134
- <span class="ruby-comment cmt"># Need to get this for the imagemap
135
- <span class="ruby-identifier">left_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
136
- <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
137
-
138
- <span class="ruby-comment cmt"># Start with the one with the arrow
139
- <span class="ruby-identifier">pixel_ranges</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}
140
- <span class="ruby-identifier">range_with_arrow</span> = <span class="ruby-keyword kw">nil</span>
141
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">strand</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span> <span class="ruby-comment cmt"># reverse strand =&gt; box with arrow is first one
142
- <span class="ruby-identifier">range_with_arrow</span> = <span class="ruby-identifier">pixel_ranges</span>.<span class="ruby-identifier">shift</span>
143
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>((<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span>)<span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">stop_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
144
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:left</span>,<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
145
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
146
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># forward strand =&gt; box with arrow is last one
147
- <span class="ruby-identifier">range_with_arrow</span> = <span class="ruby-identifier">pixel_ranges</span>.<span class="ruby-identifier">pop</span>
148
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">stop_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
149
- <span class="ruby-identifier">arrow</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">:right</span>,<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">stop_pixel</span><span class="ruby-operator">-</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>, <span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
150
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">close_path</span>.<span class="ruby-identifier">fill</span>
151
- <span class="ruby-keyword kw">end</span>
152
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">stop_pixel</span>)
153
- <span class="ruby-identifier">gap_stops</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">range_with_arrow</span>.<span class="ruby-identifier">start_pixel</span>)
154
-
155
- <span class="ruby-comment cmt"># And then add the others
156
- <span class="ruby-identifier">pixel_ranges</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">range</span><span class="ruby-operator">|</span>
157
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">range</span>.<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, <span class="ruby-identifier">range</span>.<span class="ruby-identifier">stop_pixel</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">start_pixel</span>, <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
158
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">range</span>.<span class="ruby-identifier">stop_pixel</span>)
159
- <span class="ruby-identifier">gap_stops</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">range</span>.<span class="ruby-identifier">start_pixel</span>)
160
- <span class="ruby-keyword kw">end</span>
161
-
162
- <span class="ruby-comment cmt"># And then draw the connections in the gaps
163
- <span class="ruby-comment cmt"># Start with removing the very first start and the very last stop.
164
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">sort!</span>.<span class="ruby-identifier">pop</span>
165
- <span class="ruby-identifier">gap_stops</span>.<span class="ruby-identifier">sort!</span>.<span class="ruby-identifier">shift</span>
166
-
167
- <span class="ruby-identifier">gap_starts</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gap_number</span><span class="ruby-operator">|</span>
168
- <span class="ruby-identifier">connector</span>(<span class="ruby-identifier">track_drawing</span>,<span class="ruby-identifier">gap_starts</span>[<span class="ruby-identifier">gap_number</span>].<span class="ruby-identifier">to_f</span>,<span class="ruby-identifier">gap_stops</span>[<span class="ruby-identifier">gap_number</span>].<span class="ruby-identifier">to_f</span>,<span class="ruby-identifier">top_pixel_of_feature</span>,<span class="ruby-identifier">track</span>.<span class="ruby-identifier">colour</span>)
169
- <span class="ruby-keyword kw">end</span>
170
-
171
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hidden_subfeatures_at_stop</span>
172
- <span class="ruby-identifier">from</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">-1</span>].<span class="ruby-identifier">stop_pixel</span>
173
- <span class="ruby-identifier">to</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>
174
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
175
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
176
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">stroke</span>
177
- <span class="ruby-keyword kw">end</span>
178
-
179
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hidden_subfeatures_at_start</span>
180
- <span class="ruby-identifier">from</span> = <span class="ruby-value">1</span>
181
- <span class="ruby-identifier">to</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">start_pixel</span>}[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>
182
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
183
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">top_pixel_of_feature</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_ARROW_LENGTH</span>)
184
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">stroke</span>
185
- <span class="ruby-keyword kw">end</span>
186
-
187
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">#treat as 'generic'
188
- <span class="ruby-identifier">left_pixel_of_feature</span>, <span class="ruby-identifier">right_pixel_of_feature</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_pixel</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pixel_range_collection</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">stop_pixel</span>
189
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">rectangle</span>(<span class="ruby-identifier">left_pixel_of_feature</span>, <span class="ruby-identifier">top_pixel_of_feature</span>, (<span class="ruby-identifier">right_pixel_of_feature</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">left_pixel_of_feature</span>), <span class="ruby-constant">FEATURE_HEIGHT</span>).<span class="ruby-identifier">fill</span>
190
- <span class="ruby-keyword kw">end</span>
191
-
192
- <span class="ruby-comment cmt"># Add the label for the feature
193
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">show_label</span>
194
- <span class="ruby-identifier">pango_layout</span> = <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">create_pango_layout</span>
195
- <span class="ruby-identifier">pango_layout</span>.<span class="ruby-identifier">text</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>
196
- <span class="ruby-identifier">fdesc</span> = <span class="ruby-constant">Pango</span><span class="ruby-operator">::</span><span class="ruby-constant">FontDescription</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'Sans Serif'</span>)
197
- <span class="ruby-identifier">fdesc</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-value">8</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Pango</span><span class="ruby-operator">::</span><span class="ruby-constant">SCALE</span>)
198
- <span class="ruby-identifier">pango_layout</span>.<span class="ruby-identifier">font_description</span> = <span class="ruby-identifier">fdesc</span>
199
-
200
- <span class="ruby-identifier">text_range</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>.<span class="ruby-identifier">floor</span><span class="ruby-operator">..</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>.<span class="ruby-identifier">floor</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">pango_layout</span>.<span class="ruby-identifier">pixel_size</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">*</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>)
201
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>].<span class="ruby-identifier">nil?</span>
202
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
203
- <span class="ruby-keyword kw">end</span>
204
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">text_range</span>)
205
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">text_range</span>)
206
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">left_pixel_of_feature</span>, <span class="ruby-identifier">top_pixel_of_feature</span> <span class="ruby-operator">+</span> <span class="ruby-constant">TRACK_HEADER_HEIGHT</span>)
207
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">set_source_rgb</span>(<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>)
208
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">show_pango_layout</span>(<span class="ruby-identifier">pango_layout</span>)
209
- <span class="ruby-identifier">track_drawing</span>.<span class="ruby-identifier">set_source_rgb</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">colour</span>)
210
- <span class="ruby-keyword kw">end</span>
211
-
212
-
213
- <span class="ruby-comment cmt"># And add the region to the image map
214
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">clickable</span>
215
- <span class="ruby-comment cmt"># Comment: we have to add the vertical_offset and TRACK_HEADER_HEIGHT!
216
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">image_map</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">push</span>(<span class="ruby-constant">ImageMap</span><span class="ruby-operator">::</span><span class="ruby-constant">ImageMapElement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">left_pixel_of_feature</span>,
217
- <span class="ruby-identifier">top_pixel_of_feature</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">vertical_offset</span> <span class="ruby-operator">+</span> <span class="ruby-constant">TRACK_HEADER_HEIGHT</span>,
218
- <span class="ruby-identifier">right_pixel_of_feature</span>,
219
- <span class="ruby-identifier">bottom_pixel_of_feature</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">vertical_offset</span> <span class="ruby-operator">+</span> <span class="ruby-constant">TRACK_HEADER_HEIGHT</span>,
220
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">link</span>
221
- ))
222
- <span class="ruby-keyword kw">end</span>
223
- <span class="ruby-keyword kw">end</span></pre>
224
- </body>
225
- </html>
@@ -1,48 +0,0 @@
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>find_row (Bio::Graphics::Panel::Track::Feature)</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/feature.rb, line 396</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_row</span>
15
- <span class="ruby-identifier">row_found</span> = <span class="ruby-keyword kw">false</span>
16
-
17
- <span class="ruby-comment cmt"># We've got to find out what row to draw the feature on. If two
18
- <span class="ruby-comment cmt"># features overlap, one of them has to be 'bumped' down. So we'll
19
- <span class="ruby-comment cmt"># first try to draw a new feature at the top of the track. If
20
- <span class="ruby-comment cmt"># it however would overlap with another one, we'll bump it down
21
- <span class="ruby-comment cmt"># to the next row.
22
- <span class="ruby-identifier">feature_range</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>.<span class="ruby-identifier">floor</span><span class="ruby-operator">..</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stop</span>.<span class="ruby-identifier">ceil</span>)
23
- <span class="ruby-identifier">row</span> = <span class="ruby-value">1</span>
24
- <span class="ruby-identifier">row_available</span> = <span class="ruby-keyword kw">true</span>
25
- <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">row_found</span>
26
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">nil?</span>
27
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">covered</span><span class="ruby-operator">|</span>
28
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">feature_range</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">covered</span>.<span class="ruby-identifier">first</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">covered</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">feature_range</span>.<span class="ruby-identifier">first</span>)
29
- <span class="ruby-identifier">row_available</span> = <span class="ruby-keyword kw">false</span>
30
- <span class="ruby-keyword kw">end</span>
31
- <span class="ruby-keyword kw">end</span>
32
- <span class="ruby-keyword kw">end</span>
33
-
34
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">row_available</span>
35
- <span class="ruby-identifier">row</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
36
- <span class="ruby-identifier">row_available</span> = <span class="ruby-keyword kw">true</span>
37
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># We've found the place where to draw the feature.
38
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">nil?</span>
39
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
40
- <span class="ruby-keyword kw">end</span>
41
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track</span>.<span class="ruby-identifier">grid</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">push</span>(<span class="ruby-identifier">feature_range</span>)
42
- <span class="ruby-identifier">row_found</span> = <span class="ruby-keyword kw">true</span>
43
- <span class="ruby-keyword kw">end</span>
44
- <span class="ruby-keyword kw">end</span>
45
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">row</span>
46
- <span class="ruby-keyword kw">end</span></pre>
47
- </body>
48
- </html>
@@ -1,18 +0,0 @@
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>new (Bio::Graphics::Panel::Track::Feature::PixelRange)</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/feature.rb, line 127</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">stop_pixel</span>)
15
- <span class="ruby-ivar">@start_pixel</span>, <span class="ruby-ivar">@stop_pixel</span> = <span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">stop_pixel</span>
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,18 +0,0 @@
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>new (Bio::Graphics::Panel::Track::Feature::PixelRange)</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/feature.rb, line 337</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">stop_pixel</span>)
15
- <span class="ruby-ivar">@start_pixel</span>, <span class="ruby-ivar">@stop_pixel</span> = <span class="ruby-identifier">start_pixel</span>, <span class="ruby-identifier">stop_pixel</span>
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>