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
@@ -3,7 +3,8 @@ require File.dirname(__FILE__) + '/../../lib/bio-graphics'
3
3
 
4
4
  class TestPanel < Test::Unit::TestCase
5
5
  def test_panel_creation
6
- panel = Bio::Graphics::Panel.new(1000, 500, false, 0, 1000)
6
+ panel = Bio::Graphics::Panel.new(1000, :width => 500, :clickable => false,
7
+ :display_range => 0..1000)
7
8
  assert_equal(1000, panel.length)
8
9
  assert_equal(500, panel.width)
9
10
  assert_equal(false, panel.clickable)
@@ -14,7 +15,8 @@ class TestPanel < Test::Unit::TestCase
14
15
  end
15
16
 
16
17
  def test_panel_creation_out_of_boundaries
17
- panel = Bio::Graphics::Panel.new(1000, 500, false, -7, 5000)
18
+ panel = Bio::Graphics::Panel.new(1000, :width => 500, :clickable => false,
19
+ :display_range => -7..5000)
18
20
  assert_same(0, panel.display_start)
19
21
  assert_same(1000, panel.display_stop)
20
22
  end
@@ -22,30 +24,58 @@ class TestPanel < Test::Unit::TestCase
22
24
  end
23
25
 
24
26
  class TestTrack < Test::Unit::TestCase
25
- def setup
26
- @panel = Bio::Graphics::Panel.new(1000, 500, false, 0, 1000)
27
+ def setup
28
+ @panel = Bio::Graphics::Panel.new(1000, :width => 500, :clickable => false,
29
+ :display_range => 0..1000)
27
30
  end
28
31
 
29
32
  def test_track_creation
30
- track = @panel.add_track('test_track', [1,0,0], 'generic')
33
+ track = @panel.add_track('test_track', :label => false, :glyph => :generic, :colour => [1,0,0])
31
34
  assert_equal('test_track', track.name)
32
- assert_equal([1,0,0], track.feature_colour)
33
- assert_equal('generic', track.feature_glyph)
35
+ assert_equal([1,0,0], track.colour)
36
+ assert_equal(:generic, track.glyph)
34
37
  assert_equal(1, @panel.tracks.length)
35
38
  assert_equal(0, track.features.length)
36
39
  end
37
40
  end
38
41
 
42
+ class TestRuler < Test::Unit::TestCase
43
+ def test_scaling_factor
44
+ panel = Bio::Graphics::Panel.new(1000, :width => 600, :display_range => 0..1000)
45
+ ruler = Bio::Graphics::Ruler.new(panel)
46
+ assert_equal(1,ruler.scaling_factor(5,1000/600))
47
+ assert_equal(2,ruler.scaling_factor(5,1000/500))
48
+ assert_equal(1,ruler.scaling_factor(5,500/500))
49
+ end
50
+
51
+ def test_drawing
52
+ panel = Bio::Graphics::Panel.new(375, :display_range => 100..370, :width => 600)
53
+ ruler = Bio::Graphics::Ruler.new(panel)
54
+
55
+ assert_equal(270.0/600.0,panel.rescale_factor)
56
+ assert_equal(1,ruler.scaling_factor)
57
+ assert_equal(5,ruler.minor_tick_distance)
58
+ assert_equal(50,ruler.major_tick_distance)
59
+ assert_equal(100,ruler.first_tick_position)
60
+
61
+ i = 0
62
+ ruler.first_tick_position.step(panel.display_stop, ruler.minor_tick_distance) do |tick|
63
+ assert(i*ruler.min_pixels_per_tick,(tick - panel.display_start) / panel.rescale_factor)
64
+ i += 1
65
+ end
66
+ end
67
+ end
68
+
39
69
  class TestFeature < Test::Unit::TestCase
40
70
  def setup
41
- @panel = Bio::Graphics::Panel.new(1000, 500, false, 0, 1000)
42
- @track = @panel.add_track('test_track', [1,0,0], 'generic')
71
+ @panel = Bio::Graphics::Panel.new(1000, :width => 500)
72
+ @track = @panel.add_track('test_track', :label => false, :glyph => :generic, :colour => [1,0,0])
43
73
  end
44
74
 
45
75
  def test_feature_creation
46
- feature = @track.add_feature('test_feature', '123..456')
76
+ feature = @track.add_feature(Bio::Feature.new('type', '123..456'), :label => 'test_feature')
47
77
  assert_equal('test_feature', feature.name)
48
- assert_equal(123, feature.location[0].from)
49
- assert_equal(456, feature.location[-1].to)
78
+ assert_equal(123, feature.locations[0].from)
79
+ assert_equal(456, feature.locations[-1].to)
50
80
  end
51
- end
81
+ end
@@ -0,0 +1,50 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../../lib/bio-graphics'
3
+
4
+ module Bio::Graphics::Glyph
5
+ class Bio::Graphics::Glyph::CustomTestGlyph < Bio::Graphics::Glyph::Common
6
+
7
+ def draw
8
+ @feature_context.move_to(self.left_pixel,0)
9
+ @feature_context.line_to(self.right_pixel,Bio::Graphics::FEATURE_HEIGHT)
10
+ @feature_context.move_to(self.right_pixel,0)
11
+ @feature_context.line_to(self.left_pixel,Bio::Graphics::FEATURE_HEIGHT)
12
+ @feature_context.close_path.stroke
13
+ end
14
+ end
15
+ end
16
+
17
+ class TestCustomGlyph < Test::Unit::TestCase
18
+ def test_draw
19
+ panel = Bio::Graphics::Panel.new(500, :width => 250, :clickable => false,
20
+ :display_range => 0..1000)
21
+ track = panel.add_track('test_track', :label => false, :glyph => :custom_test_glyph, :colour => [0,0,1])
22
+ track.add_feature(Bio::Feature.new('type', '123..456'), :label => 'test_feature')
23
+
24
+ panel.draw('output.png')
25
+ system("display output.png & sleep 2 && kill $!")
26
+ File.delete('output.png')
27
+ end
28
+ end
29
+
30
+ class TestCustomGlyphInFile < Test::Unit::TestCase
31
+ def setup
32
+ system("cp custom_glyph_in_file.rb ../../lib/bio/graphics/glyphs/")
33
+ require File.dirname(__FILE__) + '/../../lib/bio/graphics/glyphs/custom_glyph_in_file.rb'
34
+ end
35
+
36
+ def test_draw
37
+ panel = Bio::Graphics::Panel.new(500, :width => 250, :clickable => false,
38
+ :display_range => 0..1000)
39
+ track = panel.add_track('test_track', :label => false, :glyph => :custom_test_glyph_in_file, :colour => [0,0,1])
40
+ track.add_feature(Bio::Feature.new('type', '123..456'), :label =>'test_feature')
41
+
42
+ panel.draw('output.png')
43
+ system("display output.png & sleep 2 && kill $!")
44
+ File.delete('output.png')
45
+ end
46
+
47
+ def teardown
48
+ File.delete(File.dirname(__FILE__) + '/../../lib/bio/graphics/glyphs/custom_glyph_in_file.rb')
49
+ end
50
+ end
@@ -0,0 +1,211 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../../lib/bio-graphics'
3
+
4
+ class TestPanel < Test::Unit::TestCase
5
+ def setup
6
+ @generated_pictures = Array.new
7
+ end
8
+
9
+ def test_draw_showcase
10
+ my_panel = Bio::Graphics::Panel.new(500, :width => 1000)
11
+
12
+ generic_track = my_panel.add_track('generic', :label => false)
13
+ line_track = my_panel.add_track('line', :label => false, :glyph => :line, :colour => [0,0,1])
14
+ line_with_handles_track = my_panel.add_track('line with handles', :label => false, :glyph => :line_with_handles, :colour => [0,0,1])
15
+ directed_track = my_panel.add_track('directed', :label => false, :glyph => :directed_generic, :colour => [0,1,0])
16
+ triangle_track = my_panel.add_track('triangle', :label => false, :glyph => :triangle, :colour => [1,0,0])
17
+ dot_track = my_panel.add_track('dot', :label => false, :glyph => :dot, :colour => [0,1,1])
18
+ spliced_track = my_panel.add_track('spliced', :label => false, :glyph => :spliced, :colour => [1,0,0])
19
+ directed_spliced_track = my_panel.add_track('directed_spliced', :label => false, :glyph => :directed_spliced, :colour => [1,0,1])
20
+
21
+ generic_track.add_feature(Bio::Feature.new('clone', '250..375'), :label => 'clone1', :link => 'http://www.newsforge.com')
22
+ generic_track.add_feature(Bio::Feature.new('clone', '54..124'), :label => 'clone2', :link => 'http://www.thearkdb.org')
23
+ generic_track.add_feature(Bio::Feature.new('clone', '100..449'), :label => 'clone3', :link => 'http://www.google.com')
24
+
25
+ line_track.add_feature(Bio::Feature.new('primer', 'complement(200..320)'), :label => 'primer1')
26
+ line_track.add_feature(Bio::Feature.new('primer', '355..480'), :label => 'primer2', :link => 'http://www.zdnet.co.uk')
27
+
28
+ line_with_handles_track.add_feature(Bio::Feature.new('primer', 'complement(200..320)'), :label => 'primer1')
29
+ line_with_handles_track.add_feature(Bio::Feature.new('primer', '355..480'), :label => 'primer2', :link => 'http://www.zdnet.co.uk')
30
+
31
+ directed_track.add_feature(Bio::Feature.new('marker', '50..60'), :label => 'marker1', :link => 'http://www.google.com')
32
+ directed_track.add_feature(Bio::Feature.new('marker','complement(80..120)'), :label => 'marker2', :link => 'http://www.sourceforge.net')
33
+
34
+ triangle_track.add_feature(Bio::Feature.new('marker', '56'), :label => 'snp1')
35
+ triangle_track.add_feature(Bio::Feature.new('marker', '103'), :label => 'snp2', :link => 'http://digg.com')
36
+
37
+ dot_track.add_feature(Bio::Feature.new('marker', '56'), :label => 'thing1')
38
+ dot_track.add_feature(Bio::Feature.new('marker', '57'), :label => 'thing3')
39
+ dot_track.add_feature(Bio::Feature.new('marker', '114'), :label => 'thing2', :link => 'http://digg.com')
40
+
41
+ spliced_track.add_feature(Bio::Feature.new('gene','join(34..52,109..183)'), :label => 'gene1', :link => 'http://news.bbc.co.uk')
42
+ spliced_track.add_feature(Bio::Feature.new('gene','complement(join(170..231,264..299,350..360,409..445))'), :label => 'gene2')
43
+ spliced_track.add_feature(Bio::Feature.new('gene','join(134..152,209..283)'), :label => 'gene3')
44
+
45
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','join(34..52,109..183)'), :label => 'gene4', :link => 'http://www.vrtnieuws.net')
46
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','complement(join(170..231,264..299,350..360,409..445))'), :label => 'gene5', :link => 'http://bioinformatics.roslin.ac.uk')
47
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','join(134..152,209..283)'), :label => 'gene6')
48
+
49
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
50
+ @generated_pictures.push(output_file)
51
+
52
+ my_panel.draw(output_file)
53
+ system("display " + output_file + "& sleep 2 && kill $!")
54
+ end
55
+
56
+ def test_outside_border
57
+ my_panel = Bio::Graphics::Panel.new(500, :width => 1000, :display_range => 100..400)
58
+
59
+ spliced_track = my_panel.add_track('spliced', :label => false, :glyph => :spliced, :colour => [1,0,0])
60
+ directed_spliced_track = my_panel.add_track('directed_spliced', :label => false, :glyph => :directed_spliced, :colour => [1,0,1])
61
+
62
+ spliced_track.add_feature(Bio::Feature.new('gene','join(34..52,109..183)'), :label => 'gene1',:link => 'http://news.bbc.co.uk')
63
+ spliced_track.add_feature(Bio::Feature.new('gene','complement(join(170..231,264..299,350..360,409..445))'), :label => 'gene2')
64
+ spliced_track.add_feature(Bio::Feature.new('gene','join(134..152,209..283)'), :label => 'gene3')
65
+
66
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','join(34..52,109..183)'), :label => 'gene4', :link => 'http://www.vrtnieuws.net')
67
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','complement(join(170..231,264..299,350..360,409..445))'), :label => 'gene5', :link => 'http://bioinformatics.roslin.ac.uk')
68
+ directed_spliced_track.add_feature(Bio::Feature.new('gene','join(134..152,209..283)'), :label => 'gene6')
69
+
70
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
71
+ @generated_pictures.push(output_file)
72
+
73
+ my_panel.draw(output_file)
74
+ system("display " + output_file + "& sleep 2 && kill $!")
75
+ end
76
+
77
+ def test_arkdb_features
78
+ my_panel = Bio::Graphics::Panel.new(4173015, :width => 600, :vertical => true)
79
+
80
+ #Create and configure tracks
81
+ scaffold_track = my_panel.add_track('scaffold', :label => false)
82
+ marker_track = my_panel.add_track('marker', :label => true)
83
+ clone_track = my_panel.add_track('clone', :label => false)
84
+
85
+ scaffold_track.colour = [1,0,0]
86
+ marker_track.colour = [0,1,0]
87
+ marker_track.glyph = :triangle
88
+ clone_track.colour = [0,0,1]
89
+
90
+ # Add data to tracks
91
+ File.open(File.dirname(__FILE__) + '/data.txt').each do |line|
92
+ line.chomp!
93
+ accession, type, start, stop = line.split(/\t/)
94
+ if type == 'scaffold'
95
+ if start.nil?
96
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', '1..4173015'), :label => accession)
97
+ else
98
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', start + '..' + stop), :label => accession, :link => 'http://www.google.com')
99
+ end
100
+
101
+ elsif type == 'marker'
102
+ marker_track.add_feature(Bio::Feature.new('marker', ((start.to_i + stop.to_i)/2).to_s), :label => accession, :link => 'http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=' + accession)
103
+ elsif type == 'clone'
104
+ clone_track.add_feature(Bio::Feature.new('clone', start + '..' + stop), :label => accession)
105
+ end
106
+ end
107
+
108
+ # And draw
109
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
110
+ @generated_pictures.push(output_file)
111
+
112
+ my_panel.draw(output_file)
113
+
114
+ system("display " + output_file + "& sleep 2 && kill $!")
115
+ end
116
+
117
+ def test_subregion
118
+ my_panel = Bio::Graphics::Panel.new(4173015, :display_range => 2500000..3500000, :width => 600)
119
+
120
+ #Create and configure tracks
121
+ scaffold_track = my_panel.add_track('scaffold', :label => false)
122
+ marker_track = my_panel.add_track('marker', :label => true)
123
+ clone_track = my_panel.add_track('clone', :label => false)
124
+
125
+ scaffold_track.colour = [1,0,0]
126
+ marker_track.colour = [0,1,0]
127
+ marker_track.glyph = :triangle
128
+ clone_track.colour = [0,0,1]
129
+
130
+ # Add data to tracks
131
+ File.open(File.dirname(__FILE__) + '/data.txt').each do |line|
132
+ line.chomp!
133
+ accession, type, start, stop = line.split(/\t/)
134
+ if type == 'scaffold'
135
+ if start.nil?
136
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', '1..4173015'), :label => accession)
137
+ else
138
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', start + '..' + stop), :label => accession, :link => 'http://www.google.com')
139
+ end
140
+
141
+ elsif type == 'marker'
142
+ marker_track.add_feature(Bio::Feature.new('marker', ((start.to_i + stop.to_i)/2).to_s), :label => accession, :link => 'http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=' + accession)
143
+ elsif type == 'clone'
144
+ clone_track.add_feature(Bio::Feature.new('clone', start + '..' + stop), :label => accession)
145
+ end
146
+ end
147
+
148
+ # And draw
149
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
150
+ @generated_pictures.push(output_file)
151
+
152
+ my_panel.draw(output_file)
153
+
154
+ system("display " + output_file + "& sleep 2 && kill $!")
155
+ end
156
+
157
+ def test_subfeatures
158
+ my_panel = Bio::Graphics::Panel.new(500, :width => 600)
159
+
160
+ track = my_panel.add_track('mrna')
161
+
162
+ track.colour = [1,0,0]
163
+ track.glyph = :spliced
164
+
165
+ # Add data to tracks
166
+ utr5 = Bio::Feature.new('utr', '100..150')
167
+ cds = Bio::Feature.new('cds', 'join(150..225, 250..275, 310..330)')
168
+ utr3 = Bio::Feature.new('utr', '330..375')
169
+
170
+ transcript = Bio::Feature.new('transcript', 'join(100..225, 250..275, 310..375)', [], nil, [utr5, cds, utr3])
171
+
172
+ transcript_graphic = track.add_feature(transcript, :label => 'my_transcript')
173
+ transcript_graphic.glyph = { 'utr' => :line, 'cds' => :spliced }
174
+
175
+ # And draw
176
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
177
+ @generated_pictures.push(output_file)
178
+
179
+ my_panel.draw(output_file)
180
+
181
+ system("display " + output_file + "& sleep 2 && kill $!")
182
+ end
183
+
184
+ def test_feature_specific_colouring
185
+ my_panel = Bio::Graphics::Panel.new(375, :display_range => 100..370, :width => 600)
186
+
187
+ track = my_panel.add_track('mrna')
188
+
189
+ track.colour = [1,0,0]
190
+ track.glyph = :spliced
191
+
192
+ # Add data to tracks
193
+ track.add_feature(Bio::Feature.new('cds', 'join(100..200, 225..350)'), :label => 'red_spliced')
194
+ track.add_feature(Bio::Feature.new('cds', 'join(100..200, 225..350)'), :label => 'green_spliced', :colour => [0,1,0])
195
+ track.add_feature(Bio::Feature.new('cds', 'join(100..200, 225..350)'), :label => 'blue_generic', :colour => [0,0,1])
196
+
197
+ # And draw
198
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
199
+ @generated_pictures.push(output_file)
200
+
201
+ my_panel.draw(output_file)
202
+
203
+ system("display " + output_file + "& sleep 2 && kill $!")
204
+ end
205
+
206
+ def teardown
207
+ @generated_pictures.each do |p|
208
+ File.delete(p)
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,134 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../../lib/bio-graphics'
3
+
4
+ class TestImageMap < Test::Unit::TestCase
5
+ def setup
6
+ @generated_files = Array.new
7
+
8
+ @horizontal_imagemap = <<END_OF_STRING
9
+ <html>
10
+ <body>
11
+ <map name="image_map" border="1">
12
+ <area shape="rect" coords="209.075452640357 82 252.5194373852 92" href="http://www.google.com"/>
13
+ <area shape="rect" coords="253.957390519804 82 451.51613401821 92" href="http://www.google.com"/>
14
+ <area shape="rect" coords="132.966578121574 137 142.966578121574 147" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049788"/>
15
+ <area shape="rect" coords="135.392018720278 167 145.392018720278 177" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00033347"/>
16
+ <area shape="rect" coords="181.068633829497 197 191.068633829497 207" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049753"/>
17
+ <area shape="rect" coords="205.969047559139 227 215.969047559139 237" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049743"/>
18
+ <area shape="rect" coords="217.47799253058 257 227.47799253058 267" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00050962"/>
19
+ <area shape="rect" coords="430.77140269086 137 440.77140269086 147" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049746"/>
20
+ </map>
21
+ <img border='1' src='./test_horizontal_imagemap.png' usemap='#image_map' />
22
+ </body>
23
+ </html>
24
+ END_OF_STRING
25
+
26
+ @vertical_imagemap = <<END_OF_STRING
27
+ <html>
28
+ <body>
29
+ <map name="image_map" border="1">
30
+ <area shape="rect" coords="82 347.4805626148 92 390.924547359643" href="http://www.google.com"/>
31
+ <area shape="rect" coords="82 148.48386598179 92 346.042609480196" href="http://www.google.com"/>
32
+ <area shape="rect" coords="137 457.033421878426 147 467.033421878426" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049788"/>
33
+ <area shape="rect" coords="167 454.607981279722 177 464.607981279722" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00033347"/>
34
+ <area shape="rect" coords="197 408.931366170503 207 418.931366170503" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049753"/>
35
+ <area shape="rect" coords="227 384.030952440861 237 394.030952440861" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049743"/>
36
+ <area shape="rect" coords="257 372.52200746942 267 382.52200746942" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00050962"/>
37
+ <area shape="rect" coords="137 159.22859730914 147 169.22859730914" href="http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=ARKMKR00049746"/>
38
+ </map>
39
+ <img border='1' src='./test_vertical_imagemap.png' usemap='#image_map' />
40
+ </body>
41
+ </html>
42
+ END_OF_STRING
43
+ end
44
+
45
+ def test_horizontal_imagemap
46
+ my_panel = Bio::Graphics::Panel.new(4173015, :width => 600, :clickable => true)
47
+
48
+ #Create and configure tracks
49
+ scaffold_track = my_panel.add_track('scaffold', :label => false)
50
+ marker_track = my_panel.add_track('marker', :label => true)
51
+ clone_track = my_panel.add_track('clone', :label => false)
52
+
53
+ scaffold_track.colour = [1,0,0]
54
+ marker_track.colour = [0,1,0]
55
+ marker_track.glyph = :triangle
56
+ clone_track.colour = [0,0,1]
57
+
58
+ # Add data to tracks
59
+ File.open(File.dirname(__FILE__) + '/data.txt').each do |line|
60
+ line.chomp!
61
+ accession, type, start, stop = line.split(/\t/)
62
+ if type == 'scaffold'
63
+ if start.nil?
64
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', '1..4173015'), :label => accession)
65
+ else
66
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', start + '..' + stop), :label => accession, :link => 'http://www.google.com')
67
+ end
68
+
69
+ elsif type == 'marker'
70
+ marker_track.add_feature(Bio::Feature.new('marker', ((start.to_i + stop.to_i)/2).to_s), :label => accession, :link => 'http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=' + accession)
71
+ elsif type == 'clone'
72
+ clone_track.add_feature(Bio::Feature.new('clone', start + '..' + stop), :label => accession)
73
+ end
74
+ end
75
+
76
+ # And draw
77
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
78
+ html_file = output_file.sub(/\.png$/, '.html')
79
+ @generated_files.push(output_file)
80
+ @generated_files.push(html_file)
81
+
82
+ my_panel.draw(output_file)
83
+
84
+ assert_equal(@horizontal_imagemap, File.read(html_file))
85
+ end
86
+
87
+ def test_vertical_imagemap
88
+ my_panel = Bio::Graphics::Panel.new(4173015, :width => 600, :clickable => true, :vertical => true)
89
+
90
+ #Create and configure tracks
91
+ scaffold_track = my_panel.add_track('scaffold', :label => false)
92
+ marker_track = my_panel.add_track('marker', :label => true)
93
+ clone_track = my_panel.add_track('clone', :label => false)
94
+
95
+ scaffold_track.colour = [1,0,0]
96
+ marker_track.colour = [0,1,0]
97
+ marker_track.glyph = :triangle
98
+ clone_track.colour = [0,0,1]
99
+
100
+ # Add data to tracks
101
+ File.open(File.dirname(__FILE__) + '/data.txt').each do |line|
102
+ line.chomp!
103
+ accession, type, start, stop = line.split(/\t/)
104
+ if type == 'scaffold'
105
+ if start.nil?
106
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', '1..4173015'), :label => accession)
107
+ else
108
+ scaffold_track.add_feature(Bio::Feature.new('scaffold', start + '..' + stop), :label => accession, :link => 'http://www.google.com')
109
+ end
110
+
111
+ elsif type == 'marker'
112
+ marker_track.add_feature(Bio::Feature.new('marker', ((start.to_i + stop.to_i)/2).to_s), :label => accession, :link => 'http://www.thearkdb.org/arkdb/do/getMarkerDetail?accession=' + accession)
113
+ elsif type == 'clone'
114
+ clone_track.add_feature(Bio::Feature.new('clone', start + '..' + stop), :label => accession)
115
+ end
116
+ end
117
+
118
+ # And draw
119
+ output_file = File.dirname(__FILE__) + '/' + @method_name + '.png'
120
+ html_file = output_file.sub(/\.png$/, '.html')
121
+ @generated_files.push(output_file)
122
+ @generated_files.push(html_file)
123
+
124
+ my_panel.draw(output_file)
125
+
126
+ assert_equal(@vertical_imagemap, File.read(html_file))
127
+ end
128
+
129
+ def teardown
130
+ @generated_files.each do |p|
131
+ File.delete(p)
132
+ end
133
+ end
134
+ end