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 +1 @@
1
- Thu Oct 18 18:24:47 +0100 2007
1
+ Thu, 24 Jan 2008 20:03:24 +0000
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Oct 18 14:49:59 +0100 2007</td>
59
+ <td>Thu Jan 24 20:01:38 +0000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -69,15 +69,75 @@
69
69
  <div id="contextContent">
70
70
 
71
71
  <div id="description">
72
- <p>
73
- Copyright (C) 2007 Jan Aerts &lt;jan.aerts@bbsrc.ac.uk&gt;
72
+ <pre>
73
+ #
74
+ # = README.DEV - Information for developers
75
+ #
76
+ # Copyright:: Copyright (C) 2007, 2008
77
+ # Jan Aerts &lt;jan.aerts@bbsrc.ac.uk&gt;
78
+ # License:: The Ruby License
79
+ #
80
+ </pre>
81
+ <h1>README for developers</h1>
82
+ <p>
83
+ This README is mainly meant to explain (a) how the code works (rather than
84
+ how to <em>use</em> the library), and (b) how to contribute to the project.
85
+ </p>
86
+ <h2>ABOUT ARGUMENTS</h2>
87
+ <p>
88
+ As there can be a host of optional arguments for several of the methods
89
+ (e.g. Track#add_feature), it becomes unwieldy to have them all defined
90
+ using the standard ruby way. The Track#add_feature method for example would
91
+ then have been defined like this:
92
+ </p>
93
+ <pre>
94
+ def add_feature(feature_object, label = 'anonymous', link = nil, glyph = @glyph, colour = @colour)
95
+ ...
96
+ end
97
+ </pre>
98
+ <p>
99
+ So if the user would like to use all default settings except for the
100
+ colour, he&#8216;d have to specify all those defaults:
101
+ </p>
102
+ <pre>
103
+ my_track.add_feature(my_feature_object, 'anonymous', nil, my_track.glyph, [0,1,1])
104
+ </pre>
105
+ <p>
106
+ To make the library a bit more userfriendly, I&#8216;ve decided to use
107
+ keyword arguments for all optional arguments. The above line then becomes:
108
+ </p>
109
+ <pre>
110
+ my_track.add_feature(my_feature_object, :colour =&gt; [0,1,1])
111
+ </pre>
112
+ <p>
113
+ The construct you&#8216;ll see for this is as follows (for Track#new):
74
114
  </p>
75
- <h2>README for developers</h2>
115
+ <pre>
116
+ def initialize(panel, name, opts = {})
117
+ @panel = panel
118
+ @name = name
119
+
120
+ opts = {
121
+ :label =&gt; true,
122
+ :glyph =&gt; :generic,
123
+ :colour =&gt; [0,0,1]
124
+ }.merge(opts)
125
+
126
+ @show_label = opts[:label]
127
+ @glyph = opts[:glyph]
128
+ @colour = opts[:colour]
129
+
130
+ ...
131
+ end
132
+ </pre>
76
133
  <p>
77
- This README is mainly meant to explain how the code works (rather than how
78
- to <em>use</em> the library). It should help if you&#8216;re interested in
79
- contributing, or if you think you found a bug.
134
+ Basically, this means that the &#8216;panel&#8217; and &#8216;name&#8217;
135
+ arguments are mandatory and the other ones are optional. Which optional
136
+ arguments are excepted should be listed in the description comments just
137
+ above the method code. The Hash#merge that&#8216;s used here just assigns
138
+ default values for each arguments that is not mentioned.
80
139
  </p>
140
+ <h2>A. FLOW OF THE CODE</h2>
81
141
  <h3>Overview</h3>
82
142
  <p>
83
143
  I&#8216;ve tried to document as much as possible in the code itself, see
@@ -87,43 +147,29 @@ However, the bigger picture can not be explained that way.
87
147
  </p>
88
148
  <h3>The files</h3>
89
149
  <p>
90
- There&#8216;s one file for each class: panel, track, feature, ruler and
91
- image_map. See the tutorial on a breakdown what each of these do. All of
92
- these except the image_map make up a picture. The image_map is used to
93
- describe the HTML map that can be created to make a picture clickable.
150
+ There&#8216;s one file for each class: panel, track, feature, subfeature,
151
+ ruler and image_map. See the tutorial on a breakdown what each of these do.
152
+ All of these except the image_map make up a picture. The image_map is used
153
+ to describe the HTML map that can be created to make a picture clickable.
94
154
  </p>
95
155
  <p>
96
- Classes are embedded in each other: instead of
156
+ Classes are:
97
157
  </p>
98
158
  <pre>
99
159
  Bio::Graphics::Panel
100
160
  Bio::Graphics::Ruler
101
161
  Bio::Graphics::Track
102
162
  Bio::Graphics::Feature
163
+ Bio::Graphics::SubFeature
164
+ several Bio::Graphics::Glyph::&lt;something&gt;
103
165
  </pre>
104
- <p>
105
- we have:
106
- </p>
107
- <pre>
108
- Bio::Graphics::Panel
109
- Bio::Graphics::Panel::Ruler
110
- Bio::Graphics::Panel::Track
111
- Bio::Graphics::Panel::Track::Feature
112
- </pre>
113
- <p>
114
- There&#8216;s a reason for this. A track can only exist within the confines
115
- of a panel (i.e. a panel is a container for tracks), and a feature can only
116
- exist within the confines of a track. In addition, there are quite some
117
- instances where information from the panel is necessary for the track, and
118
- from the track for the features.
119
- </p>
120
166
  <h3>The workflow</h3>
121
167
  <h4>1. Creating the panel</h4>
122
168
  <p>
123
169
  The user has to start with a
124
170
  </p>
125
171
  <pre>
126
- my_panel = Bio::Graphics::Panel.new(length, width, clickable, display_start, display_stop)
172
+ my_panel = Bio::Graphics::Panel.new(length, width, clickable, display_start, display_stop, verticle)
127
173
  </pre>
128
174
  <p>
129
175
  When this happens, among other things, the instance variable @tracks is
@@ -157,16 +203,27 @@ own, they can only be created by using a Panel method rather than a Track
157
203
  method.
158
204
  </p>
159
205
  <pre>
160
- my_track_1 = my_panel.add_track(name, label = false, feature_colour = [0,0,1], feature_glyph = 'generic')
206
+ my_track_1 = my_panel.add_track(name, label = false, feature_glyph = :generic, feature_colour = [0,0,1])
161
207
  </pre>
162
208
  <p>
209
+ Feature_glyph and feature_colour are the default values to use for all
210
+ features in this track.
211
+ </p>
212
+ <p>
213
+ The feature_glyph can either be one of the approved symbols (:generic,
214
+ :spliced, &#8230;; see documentation Bio::Graphics::Panel#add_track) or a
215
+ hash. The keys of the hash refer to the types of subfeature; the values are
216
+ these symbols again. For how that&#8216;s used, see below (5. Drawing the
217
+ thing).
218
+ </p>
219
+ <p>
163
220
  This creates a new Track object and adds it to the @tracks array of the
164
221
  Panel object. Several instance variables are set for the Track object,
165
222
  including @features (which is an array of Feature objects for that track)
166
223
  and @number_of_feature_rows. Every time a feature cannot be drawn because
167
224
  it would overlap with another one, it will be &#8216;bumped&#8217; down
168
225
  until it can be drawn. This effectively results in <em>rows</em> that
169
- contain the features. The @number_of_feature_rows is just the number of
226
+ contain the features. The @number_of_feature_rows is just this number of
170
227
  rows (to be able to calculate the height of the track afterwards).
171
228
  </p>
172
229
  <pre>
@@ -182,14 +239,17 @@ latter has to be accessible to be able to assign features to it.
182
239
  <h4>3. Adding features to a track</h4>
183
240
  <p>
184
241
  Same thing as adding a track to a panel: the feature can only be added by
185
- the user by using the Track#add_feature method. Parameters are the name of
186
- the feature, the location and the link.
242
+ the user by using the Track#add_feature method. Arguments are a <a
243
+ href="../classes/Bio/Feature.html">Bio::Feature</a> object (which itself
244
+ has a type and location), a label, and the glyph and colour. The glyph can
245
+ either be one of the approved symbols, or a hash (see 2. Adding tracks to
246
+ the panel).
187
247
  </p>
188
248
  <p>
189
- The location of a feature can be something like
190
- &#8216;complement(join(10..20,50..70))&#8217;. To be able to parse this, I
191
- use the Bio::Locations object from bioruby (see <a
192
- href="http://www.bioruby.org">www.bioruby.org</a>). A Bio::Locations
249
+ The location of a <a href="../classes/Bio/Feature.html">Bio::Feature</a>
250
+ object can be something like &#8216;complement(join(10..20,50..70))&#8217;.
251
+ To be able to parse this, I use the Bio::Locations object from bioruby (see
252
+ <a href="http://www.bioruby.org">www.bioruby.org</a>). A Bio::Locations
193
253
  (plural) object contains one or more Bio::Location (singular) objects,
194
254
  which are the subfeatures: 10..20 and 50..70. It&#8216;s these
195
255
  Bio::Location objects we use to calculate the ultimate start and stop of
@@ -201,7 +261,20 @@ The Track#add_feature method returns the Track object itself.
201
261
  <p>
202
262
  Now let&#8216;s look at the other end: the Feature object that gets
203
263
  created. In the Feature#initialize method, you&#8216;ll notice, apart from
204
- the obvious variables, the following instances variables:
264
+ the obvious variables, the following instances variables: @subfeatures,
265
+ @left_pixel_of_subfeatures and @right_pixel_of_subfeatures. The
266
+ @subfeatures thing is quite important. In some cases (e.g. mRNAs that
267
+ consist of 5&#8216;UTR, CDS and 3&#8216;UTR), we will want to make a
268
+ distinction between the UTRs and the CDS for drawing (see TUTORIAL). To
269
+ make this possible, we will have Feature#new always create an Array of
270
+ SubFeature objects. Often this array will only contain one object. Drawing
271
+ of the glyphs is done on a subfeature-by-subfeature basis. The
272
+ @left_pixel_of_subfeatures and @right_pixel_of_subfeatures just represent
273
+ the outermost pixels for this feature.
274
+ </p>
275
+ <h4>4. Creating subfeatures (done automatically by Feature#new)</h4>
276
+ <p>
277
+ For each subfeature#new several instance variables are created:
205
278
  @pixel_range_collection, @chopped_at_start, @chopped_at_stop,
206
279
  @hidden_subfeatures_at_start and @hidden_subfeatures_at_stop. Let&#8216;s
207
280
  take these one by one:
@@ -220,8 +293,9 @@ picture but actually extends outwith the view, the start pixel will become
220
293
  </p>
221
294
  <p>
222
295
  These start and stop positions are used to create
223
- Bio::Graphics::Panel::Track::PixelRange objects. Unspliced objects will
224
- have an array @pixel_range_collection with just one element.
296
+ Bio::Graphics::Panel::Track::Feature::SubFeature::PixelRange objects.
297
+ Unspliced objects will have an array @pixel_range_collection with just one
298
+ element.
225
299
  </p>
226
300
  <h5>@chopped_at_start and @chopped_at_stop</h5>
227
301
  <p>
@@ -229,7 +303,7 @@ Suppose you&#8216;ve got a directed feature (so one with an arrow), and the
229
303
  3&#8217; end falls outside of the view. What would happen, is that the
230
304
  3&#8217; end that&#8216;s out of view would be chopped of (that&#8216;s
231
305
  good), but also that the end of the glyph (which is <em>not</em> the end of
232
- the feature) becomes an arrow. I don&#8216;t want that. Instead, the arrow
306
+ the feature) becomes an arrow. We don&#8216;t want that; instead, the arrow
233
307
  should be removed.
234
308
  </p>
235
309
  <p>
@@ -247,12 +321,13 @@ However, if an exon is outside of the viewing area, this line is not drawn.
247
321
  The @hidden_subfeatures_at_start and @hidden_subfeatures_at_stop are just
248
322
  flags to capture this.
249
323
  </p>
250
- <h4>4. Drawing the thing</h4>
324
+ <h4>5. Drawing the thing</h4>
251
325
  <p>
252
- The Cairo library (<a
253
- href="http://cairographics.org">cairographics.org</a>) is used for the
254
- actual drawing. The main concepts in the Cairo drawing model are (please
255
- also see <a
326
+ The Cairo and Pango libraries (<a
327
+ href="http://cairographics.org">cairographics.org</a>, <a
328
+ href="http://www.pango.org">www.pango.org</a>) are used for the actual
329
+ drawing. The main concepts in the Cairo drawing model are (please also see
330
+ <a
256
331
  href="http://cairographics.org/tutorial">cairographics.org/tutorial</a>):
257
332
  </p>
258
333
  <ul>
@@ -280,7 +355,7 @@ have to do: create a Cairo::ImageSurface and connect a Cairo::Context to
280
355
  it.
281
356
  </p>
282
357
  <p>
283
- Now let&#8216;s walk through the code itself&#8230;
358
+ Now let&#8216;s walk through the drawing code itself&#8230;
284
359
  </p>
285
360
  <p>
286
361
  When a user draws a panel, the first thing that happens, is the creation of
@@ -318,19 +393,21 @@ the height of the numbers.
318
393
  <h5>Drawing the tracks</h5>
319
394
  <p>
320
395
  Drawing each track starts out with the general header: a line above it and
321
- the title. Obviously, the more challenging part is drawing the features
322
- themselves.
396
+ the title. We also &#8216;translate&#8217; the track down to not let it
397
+ overlap with previously drawn tracks. Obviously, the more challenging part
398
+ is drawing the features themselves.
323
399
  </p>
400
+ <h5>Drawing the (sub)features.</h5>
324
401
  <p>
325
402
  First thing we have to do, is figure out what the <b>vertical</b>
326
403
  <b>coordinates</b> of the glyph should be (i.e. the row). To keep track of
327
404
  what parts of the screen are already occupied by features (so that we know
328
- when a new feature has to be bumped down), I make use of a <b>grid</b>. The
329
- grid is basically a hash with the keys being the row number, and the values
330
- arrays of ranges. (These ranges use basepair units rather than pixels, but
331
- that&#8216;s completely arbitrary.) For each feature, we first check if we
332
- can draw it at the top of the track (i.e. row 1) and if we can&#8216;t move
333
- it down a row at a time until there&#8216;s room for it.
405
+ when a new feature has to be bumped down), we make use of a <b>grid</b>.
406
+ The grid is basically a hash with the keys being the row number, and the
407
+ values arrays of ranges. (These ranges use basepair units rather than
408
+ pixels, but that&#8216;s completely arbitrary.) For each feature, we first
409
+ check if we can draw it at the top of the track (i.e. row 1) and if we
410
+ can&#8216;t move it down a row at a time until there&#8216;s room for it.
334
411
  </p>
335
412
  <p>
336
413
  So for example, suppose we&#8216;ve already drawn two features that have
@@ -351,28 +428,38 @@ like:
351
428
  2 =&gt; [(125..175)] }
352
429
  </pre>
353
430
  <p>
354
- So now we know what the vertical coordinates of the glyph should be. Next
355
- step is to check if there&#8216;s reasons we would like to <b>change</b>
356
- <b>the</b> <b>requested</b> <b>glyph</b> <b>type</b> <b>from</b>
357
- <b>directed</b> <b>to</b> <b>undirected</b>. If the user asks for directed
358
- glyphs (i.e. ones with an arrow at the end), but the view is zoomed
359
- <em>way</em> out, there&#8216;s no way the arrow will be visible. If
431
+ So now we know what the vertical coordinates of the glyph should be. But
432
+ the <a
433
+ href="../classes/Bio/Graphics/Feature.html">Bio::Graphics::Feature</a> does
434
+ not do the drawing&#8230; The reason for this is that a Feature can have
435
+ SubFeatures (e.g. a transcript feature can have UTR and CDS subfeatures).
436
+ If that&#8216;s not the case, the Feature is seen as having one SubFeature.
437
+ </p>
438
+ <p>
439
+ Next step is to check if there&#8216;s reasons we would like to
440
+ <b>change</b> <b>the</b> <b>requested</b> <b>glyph</b> <b>type</b>
441
+ <b>from</b> <b>directed</b> <b>to</b> <b>undirected</b>. If the user asks
442
+ for directed glyphs (i.e. ones with an arrow at the end), but the view is
443
+ zoomed <em>way</em> out, there&#8216;s no way the arrow will be visible. If
360
444
  we&#8216;d try to draw that arrow anyway, it would become bigger than the
361
445
  feature itself. Another reason would be if the feature&#8216;s 3&#8217; end
362
446
  extends outwith the picture.
363
447
  </p>
364
448
  <p>
365
- Finally, we can <b>draw</b>. The actual drawing bit should be quite
366
- self-explanatory (<em>move_to</em>, <em>line_to</em>, &#8230;).
449
+ Finally, we can <b>draw</b>. As there are several types of glyphs, this is
450
+ handled by a Glyph object. These are defined in the lib/bio/graphics/glyphs
451
+ directory. These files are automatically read when requiring
452
+ lib/bio-graphics. The actual drawing bit should be quite self-explanatory
453
+ (<em>move_to</em>, <em>line_to</em>, &#8230;).
367
454
  </p>
368
455
  <p>
369
- For the spliced features (<em>spliced</em> itself and
370
- <em>directed_spliced</em>), we first draw the components (i.e. the exons)
371
- keeping track of the start and stop positions of the gaps (i.e. introns).
372
- We then add the connections in those gaps. In addition, we draw a line that
373
- extends to the side of the picture if there are exons out of view. This
374
- flag was set when the feature was created (see above:
375
- @hidden_subfeatures_at_start and @hidden_subfeatures_at_stop).
456
+ For the spliced features (:spliced and :directed_spliced), we first draw
457
+ the components (i.e. the exons) keeping track of the start and stop
458
+ positions of the gaps (i.e. introns). We then add the connections in those
459
+ gaps. In addition, we draw a line that extends to the side of the picture
460
+ if there are exons out of view. This flag was set when the feature was
461
+ created (see above: @hidden_subfeatures_at_start and
462
+ @hidden_subfeatures_at_stop).
376
463
  </p>
377
464
  <p>
378
465
  When the user wants a clickable map, we also have to record that this
@@ -392,6 +479,248 @@ panel as a source to be transferred on that new destination.
392
479
  <p>
393
480
  And we just write the PNG to a file. If the user wanted a clickable map,
394
481
  also create the HTML file.
482
+ </p>
483
+ <h2>B. CONTRIBUTING TO THE PROJECT</h2>
484
+ <p>
485
+ (This text is adapted from the bioruby README.DEV)
486
+ </p>
487
+ <p>
488
+ There are many possible ways to contribute to the <a
489
+ href="../classes/Bio/Graphics.html">Bio::Graphics</a> project, such as:
490
+ </p>
491
+ <ul>
492
+ <li>Join the discussion on the BioRuby mailing list
493
+
494
+ </li>
495
+ <li>Send a bug report or write a bug fix patch
496
+
497
+ </li>
498
+ <li>Add and correct documentation
499
+
500
+ </li>
501
+ <li>Develop code for new features, etc.
502
+
503
+ </li>
504
+ </ul>
505
+ <p>
506
+ All of these are welcome! However, this document describes the last option,
507
+ how to contribute your code to <a
508
+ href="../classes/Bio/Graphics.html">Bio::Graphics</a>.
509
+ </p>
510
+ <h2>Coding style</h2>
511
+ <p>
512
+ You will need to follow the typical coding styles of the BioRuby modules:
513
+ </p>
514
+ <h3>Use the following naming conventions</h3>
515
+ <ul>
516
+ <li>CamelCase for module and class names
517
+
518
+ </li>
519
+ <li>&#8216;_&#8217;-separated_lowercase for method names
520
+
521
+ </li>
522
+ <li>&#8216;_&#8217;-separated_lowercase for variable names
523
+
524
+ </li>
525
+ <li>all UPPERCASE for constants
526
+
527
+ </li>
528
+ </ul>
529
+ <h3>Indentation must not include tabs</h3>
530
+ <ul>
531
+ <li>Use 2 spaces for indentation.
532
+
533
+ </li>
534
+ <li>Don&#8216;t replace spaces to tabs.
535
+
536
+ </li>
537
+ </ul>
538
+ <h3>Comments</h3>
539
+ <p>
540
+ Don&#8216;t use <tt>=begin</tt> and <tt>=end</tt> blocks for comments. If
541
+ you need to add comments, include it in the RDoc documentation.
542
+ </p>
543
+ <h3>Tutorials</h3>
544
+ <p>
545
+ Additional tutorial documentation and working examples are encouraged with
546
+ your contribution. You may use the header part of the file for this
547
+ purpose.
548
+ </p>
549
+ <h3>Standard documentation</h3>
550
+ <h4>of files</h4>
551
+ <p>
552
+ Each file should start with a header, which covers the following topics:
553
+ </p>
554
+ <ul>
555
+ <li>copyright
556
+
557
+ </li>
558
+ <li>license
559
+
560
+ </li>
561
+ <li>description of the file (<em>not</em> the classes; see below)
562
+
563
+ </li>
564
+ <li>any references, if appropriate
565
+
566
+ </li>
567
+ </ul>
568
+ <p>
569
+ The header should be formatted as follows:
570
+ </p>
571
+ <pre>
572
+ #
573
+ # = bio/graphics/ruler - class to draw ruler
574
+ #
575
+ # Copyright:: Copyright (C) 2001, 2003-2005 Bio R. Hacker &lt;brh@example.org&gt;,
576
+ # Copyright:: Copyright (C) 2006 Chem R. Hacker &lt;crh@example.org&gt;
577
+ #
578
+ # License:: The Ruby License
579
+ #
580
+ # == Description
581
+ #
582
+ # This file contains classes that implement the ruler of a graphic.
583
+ #
584
+ module Bio
585
+ module Graphics
586
+ class Ruler
587
+
588
+ end
589
+ end
590
+ end
591
+ </pre>
592
+ <h4>of classes and methods within those files</h4>
593
+ <p>
594
+ Classes and methods should be documented in a standardized format, as in
595
+ the following example (from bioruby&#8216;s lib/bio/graphics/sequence.rb):
596
+ </p>
597
+ <pre>
598
+ # == Description
599
+ #
600
+ # Bio::Sequence objects represent annotated sequences in bioruby.
601
+ # A Bio::Sequence object is a wrapper around the actual sequence,
602
+ # represented as either a Bio::Sequence::NA or a Bio::Sequence::AA object.
603
+ # For most users, this encapsulation will be completely transparent.
604
+ # Bio::Sequence responds to all methods defined for Bio::Sequence::NA/AA
605
+ # objects using the same arguments and returning the same values (even though
606
+ # these methods are not documented specifically for Bio::Sequence).
607
+ #
608
+ # == Usage
609
+ #
610
+ # require 'bio'
611
+ #
612
+ # # Create a nucleic or amino acid sequence
613
+ # dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA')
614
+ # rna = Bio::Sequence.auto('augcaugcaugcaugcaaaa')
615
+ # aa = Bio::Sequence.auto('ACDEFGHIKLMNPQRSTVWYU')
616
+ #
617
+ # # Print in FASTA format
618
+ # puts dna.output(:fasta)
619
+ #
620
+ # # Print all codons
621
+ # dna.window_search(3,3) do |codon|
622
+ # puts codon
623
+ # end
624
+ #
625
+ class Sequence
626
+
627
+ # Create a new Bio::Sequence object
628
+ #
629
+ # s = Bio::Sequence.new('atgc')
630
+ # puts s # =&gt; 'atgc'
631
+ #
632
+ # Note that this method does not intialize the contained sequence
633
+ # as any kind of bioruby object, only as a simple string
634
+ #
635
+ # puts s.seq.class # =&gt; String
636
+ #
637
+ # See Bio::Sequence#na, Bio::Sequence#aa, and Bio::Sequence#auto
638
+ # for methods to transform the basic String of a just created
639
+ # Bio::Sequence object to a proper bioruby object
640
+ # ---
641
+ # *Arguments*:
642
+ # * (required) _str_: String or Bio::Sequence::NA/AA object
643
+ # *Returns*:: Bio::Sequence object
644
+ def initialize(str)
645
+ @seq = str
646
+ end
647
+
648
+ # The sequence identifier. For example, for a sequence
649
+ # of Genbank origin, this is the accession number.
650
+ attr_accessor :entry_id
651
+
652
+ # An Array of Bio::Feature objects
653
+ attr_accessor :features
654
+ end # Sequence
655
+ </pre>
656
+ <p>
657
+ Preceding the class definition (<tt>class Sequence</tt>), there is at least
658
+ a description and a usage example. Please use the <tt>Description</tt> and
659
+ <tt>Usage</tt> headings. If appropriate, refer to other classes that
660
+ interact with or are related to the class.
661
+ </p>
662
+ <p>
663
+ The code in the usage example should, if possible, be in a format that a
664
+ user can copy-and-paste into a new script to run. It should illustrate the
665
+ most important uses of the class. If possible and if it would not clutter
666
+ up the example too much, try to provide any input data directly into the
667
+ usage example, instead of refering to ARGV or ARGF for input.
668
+ </p>
669
+ <pre>
670
+ dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA')
671
+ </pre>
672
+ <p>
673
+ Otherwise, describe the input shortly, for example:
674
+ </p>
675
+ <pre>
676
+ # input should be string consisting of nucleotides
677
+ dna = Bio::Sequence.auto(ARGF.read)
678
+ </pre>
679
+ <p>
680
+ Methods should be preceded by a comment that describes what the method
681
+ does, including any relevant usage examples. (In contrast to the
682
+ documentation for the class itself, headings are not required.) In
683
+ addition, any arguments should be listed, as well as the type of thing that
684
+ is returned by the method. The format of this information is as follows:
685
+ </p>
686
+ <pre>
687
+ # ---
688
+ # *Arguments*:
689
+ # * (required) _str_: String or Bio::Sequence::NA
690
+ # * (optional) _nr_: a number that means something
691
+ # *Returns*:: true or false
692
+ </pre>
693
+ <p>
694
+ Attribute accessors can be preceded by a short description.
695
+ </p>
696
+ <h3>Exception handling</h3>
697
+ <p>
698
+ Don&#8216;t use
699
+ </p>
700
+ <pre>
701
+ $stderr.puts &quot;WARNING&quot;
702
+ </pre>
703
+ <p>
704
+ in your code. Instead, try to avoid printing error messages. For fatal
705
+ errors, use <tt>raise</tt> with an appropriate message.
706
+ </p>
707
+ <h3>Testing code should use &#8216;test/unit&#8216;</h3>
708
+ <p>
709
+ Unit tests should come with your modules by which you can assure what you
710
+ meant to do with each method. The test code is useful to make maintenance
711
+ easy and ensure stability. The use of
712
+ </p>
713
+ <pre>
714
+ if __FILE__ == $0
715
+ </pre>
716
+ <p>
717
+ is deprecated.
718
+ </p>
719
+ <h2>Maintenance</h2>
720
+ <p>
721
+ Finally, please maintain the code you&#8216;ve contributed. Please let us
722
+ know (on the bioruby list) before you commit, so that users can discuss on
723
+ the change.
395
724
  </p>
396
725
 
397
726
  </div>