bio-graphics 1.2 → 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/classes/Bio.html +4 -26
- data/doc/classes/Bio/Feature.html +350 -0
- data/doc/classes/Bio/Feature.src/M000010.html +21 -0
- data/doc/classes/Bio/Feature.src/M000011.html +20 -0
- data/doc/classes/Bio/Feature.src/M000012.html +19 -0
- data/doc/classes/Bio/Feature.src/M000014.html +21 -0
- data/doc/classes/Bio/Feature.src/M000016.html +21 -0
- data/doc/classes/Bio/Feature.src/M000034.html +21 -0
- data/doc/classes/Bio/Feature.src/M000035.html +20 -0
- data/doc/classes/Bio/Feature.src/M000036.html +19 -0
- data/doc/classes/Bio/Feature.src/M000038.html +21 -0
- data/doc/classes/Bio/Feature.src/M000040.html +21 -0
- data/doc/classes/Bio/Feature.src/M000042.html +21 -0
- data/doc/classes/Bio/Feature.src/M000043.html +20 -0
- data/doc/classes/Bio/Feature.src/M000044.html +21 -0
- data/doc/classes/Bio/Feature.src/M000045.html +20 -0
- data/doc/classes/Bio/Feature.src/M000046.html +19 -0
- data/doc/classes/Bio/Feature.src/M000048.html +21 -0
- data/doc/classes/Bio/Feature.src/M000050.html +21 -0
- data/doc/classes/Bio/Feature.src/M000074.html +21 -0
- data/doc/classes/Bio/Feature.src/M000075.html +20 -0
- data/doc/classes/Bio/Feature.src/M000076.html +19 -0
- data/doc/classes/Bio/Feature.src/M000078.html +21 -0
- data/doc/classes/Bio/Feature.src/M000080.html +21 -0
- data/doc/classes/Bio/Feature/Qualifier.html +189 -0
- data/doc/classes/Bio/Feature/Qualifier.src/M000017.html +18 -0
- data/doc/classes/Bio/Feature/Qualifier.src/M000041.html +18 -0
- data/doc/classes/Bio/Feature/Qualifier.src/M000049.html +18 -0
- data/doc/classes/Bio/Feature/Qualifier.src/M000051.html +18 -0
- data/doc/classes/Bio/Feature/Qualifier.src/M000081.html +18 -0
- data/doc/classes/Bio/Features.html +329 -0
- data/doc/classes/Bio/Features.src/M000004.html +18 -0
- data/doc/classes/Bio/Features.src/M000005.html +19 -0
- data/doc/classes/Bio/Features.src/M000006.html +21 -0
- data/doc/classes/Bio/Features.src/M000007.html +18 -0
- data/doc/classes/Bio/Features.src/M000008.html +18 -0
- data/doc/classes/Bio/Features.src/M000009.html +18 -0
- data/doc/classes/Bio/Features.src/M000028.html +18 -0
- data/doc/classes/Bio/Features.src/M000029.html +19 -0
- data/doc/classes/Bio/Features.src/M000030.html +21 -0
- data/doc/classes/Bio/Features.src/M000031.html +18 -0
- data/doc/classes/Bio/Features.src/M000032.html +18 -0
- data/doc/classes/Bio/Features.src/M000033.html +18 -0
- data/doc/classes/Bio/Features.src/M000036.html +18 -0
- data/doc/classes/Bio/Features.src/M000037.html +19 -0
- data/doc/classes/Bio/Features.src/M000038.html +18 -0
- data/doc/classes/Bio/Features.src/M000039.html +19 -0
- data/doc/classes/Bio/Features.src/M000040.html +21 -0
- data/doc/classes/Bio/Features.src/M000041.html +18 -0
- data/doc/classes/Bio/Features.src/M000042.html +18 -0
- data/doc/classes/Bio/Features.src/M000043.html +18 -0
- data/doc/classes/Bio/Features.src/M000068.html +18 -0
- data/doc/classes/Bio/Features.src/M000069.html +19 -0
- data/doc/classes/Bio/Features.src/M000070.html +21 -0
- data/doc/classes/Bio/Features.src/M000071.html +18 -0
- data/doc/classes/Bio/Features.src/M000072.html +18 -0
- data/doc/classes/Bio/Features.src/M000073.html +18 -0
- data/doc/classes/Bio/Graphics.html +28 -42
- data/doc/classes/Bio/Graphics/{Panel/Track/Feature.html → Feature.html} +98 -125
- data/doc/classes/Bio/Graphics/Feature.src/M000020.html +51 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000021.html +65 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000022.html +55 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000023.html +66 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000024.html +51 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000025.html +65 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000026.html +55 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000054.html +51 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000055.html +65 -0
- data/doc/classes/Bio/Graphics/Feature.src/M000056.html +55 -0
- data/doc/classes/Bio/Graphics/Feature/SubFeature.html +348 -0
- data/doc/classes/Bio/Graphics/Feature/SubFeature.src/M000025.html +68 -0
- data/doc/classes/Bio/Graphics/Feature/SubFeature.src/M000026.html +67 -0
- data/doc/classes/Bio/Graphics/Glyph.html +178 -0
- data/doc/classes/Bio/Graphics/Glyph/Box.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/Box.src/M000004.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/Box.src/M000032.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.html +187 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000004.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000005.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000006.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000007.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000033.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000034.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/Common.src/M000035.html +24 -0
- data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyph.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyph.src/M000037.html +22 -0
- data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyphInFile.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/CustomTestGlyphInFile.src/M000038.html +22 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedBox.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedBox.src/M000009.html +31 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedBox.src/M000039.html +31 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000011.html +26 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000013.html +26 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedGeneric.src/M000043.html +26 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000008.html +40 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000010.html +40 -0
- data/doc/classes/Bio/Graphics/Glyph/DirectedSpliced.src/M000040.html +40 -0
- data/doc/classes/Bio/Graphics/{Panel/Track/Feature/PixelRange.html → Glyph/Dot.html} +16 -19
- data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000013.html +22 -0
- data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000015.html +22 -0
- data/doc/classes/Bio/Graphics/Glyph/Dot.src/M000045.html +22 -0
- data/doc/classes/Bio/Graphics/Glyph/Generic.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000009.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000011.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Generic.src/M000041.html +18 -0
- data/doc/classes/Bio/Graphics/Glyph/Line.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/Line.src/M000012.html +20 -0
- data/doc/classes/Bio/Graphics/Glyph/Line.src/M000014.html +20 -0
- data/doc/classes/Bio/Graphics/Glyph/Line.src/M000044.html +20 -0
- data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000014.html +28 -0
- data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000016.html +28 -0
- data/doc/classes/Bio/Graphics/Glyph/LineWithHandles.src/M000046.html +28 -0
- data/doc/classes/Bio/Graphics/Glyph/Spliced.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000010.html +19 -0
- data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000012.html +19 -0
- data/doc/classes/Bio/Graphics/Glyph/Spliced.src/M000042.html +19 -0
- data/doc/classes/Bio/Graphics/Glyph/Transcript.html +113 -0
- data/doc/classes/Bio/Graphics/Glyph/Triangle.html +139 -0
- data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000007.html +21 -0
- data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000008.html +21 -0
- data/doc/classes/Bio/Graphics/Glyph/Triangle.src/M000036.html +21 -0
- data/doc/classes/{ImageMap.html → Bio/Graphics/ImageMap.html} +50 -16
- data/doc/classes/{ImageMap.src/M000001.html → Bio/Graphics/ImageMap.src/M000030.html} +3 -3
- data/doc/classes/Bio/Graphics/ImageMap.src/M000031.html +18 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000032.html +18 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000033.html +18 -0
- data/doc/classes/{ImageMap.src/M000002.html → Bio/Graphics/ImageMap.src/M000034.html} +7 -4
- data/doc/classes/Bio/Graphics/ImageMap.src/M000035.html +24 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000062.html +18 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000063.html +18 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000064.html +27 -0
- data/doc/classes/Bio/Graphics/ImageMap.src/M000065.html +24 -0
- data/doc/classes/{ImageMap/ImageMapElement.html → Bio/Graphics/ImageMap/Element.html} +14 -14
- data/doc/classes/{ImageMap/ImageMapElement.src/M000003.html → Bio/Graphics/ImageMap/Element.src/M000034.html} +3 -3
- data/doc/classes/{ImageMap/ImageMapElement.src/M000004.html → Bio/Graphics/ImageMap/Element.src/M000035.html} +6 -4
- data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000036.html +19 -0
- data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000037.html +22 -0
- data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000066.html +19 -0
- data/doc/classes/Bio/Graphics/ImageMap/Element.src/M000067.html +22 -0
- data/doc/classes/Bio/Graphics/Panel.html +70 -69
- data/doc/classes/Bio/Graphics/Panel.src/M000025.html +52 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000026.html +20 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000027.html +98 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000028.html +20 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000029.html +52 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000030.html +20 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000031.html +98 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000059.html +52 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000060.html +20 -0
- data/doc/classes/Bio/Graphics/Panel.src/M000061.html +98 -0
- data/doc/classes/Bio/Graphics/{Panel/Ruler.html → Ruler.html} +50 -21
- data/doc/classes/Bio/Graphics/Ruler.src/M000015.html +30 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000016.html +20 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000017.html +30 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000018.html +20 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000019.html +26 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000020.html +45 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000047.html +30 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000048.html +20 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000049.html +26 -0
- data/doc/classes/Bio/Graphics/Ruler.src/M000050.html +45 -0
- data/doc/classes/Bio/Graphics/SubFeature.html +348 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000001.html +73 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000002.html +69 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000023.html +73 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000024.html +69 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000027.html +73 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000028.html +69 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000057.html +73 -0
- data/doc/classes/Bio/Graphics/SubFeature.src/M000058.html +69 -0
- data/doc/classes/Bio/Graphics/{Panel/Track.html → Track.html} +67 -69
- data/doc/classes/Bio/Graphics/Track.src/M000017.html +39 -0
- data/doc/classes/Bio/Graphics/Track.src/M000018.html +37 -0
- data/doc/classes/Bio/Graphics/Track.src/M000019.html +45 -0
- data/doc/classes/Bio/Graphics/Track.src/M000020.html +41 -0
- data/doc/classes/Bio/Graphics/Track.src/M000021.html +39 -0
- data/doc/classes/Bio/Graphics/Track.src/M000022.html +37 -0
- data/doc/classes/Bio/Graphics/Track.src/M000023.html +45 -0
- data/doc/classes/Bio/Graphics/Track.src/M000051.html +39 -0
- data/doc/classes/Bio/Graphics/Track.src/M000052.html +37 -0
- data/doc/classes/Bio/Graphics/Track.src/M000053.html +45 -0
- data/doc/classes/Range.html +129 -0
- data/doc/classes/String.html +167 -0
- data/doc/classes/String.src/M000001.html +18 -0
- data/doc/classes/String.src/M000002.html +18 -0
- data/doc/classes/String.src/M000003.html +23 -0
- data/doc/classes/String.src/M000029.html +18 -0
- data/doc/classes/String.src/M000030.html +18 -0
- data/doc/classes/String.src/M000031.html +23 -0
- data/doc/classes/TestCustomGlyph.html +137 -0
- data/doc/classes/TestCustomGlyph.src/M000025.html +25 -0
- data/doc/classes/TestCustomGlyphInFile.html +167 -0
- data/doc/classes/TestCustomGlyphInFile.src/M000026.html +19 -0
- data/doc/classes/TestCustomGlyphInFile.src/M000027.html +25 -0
- data/doc/classes/TestCustomGlyphInFile.src/M000028.html +18 -0
- data/doc/classes/TestExtensions.html +152 -0
- data/doc/classes/TestExtensions.src/M000015.html +22 -0
- data/doc/classes/TestExtensions.src/M000016.html +25 -0
- data/doc/classes/TestFeature.html +152 -0
- data/doc/classes/TestFeature.src/M000017.html +19 -0
- data/doc/classes/TestFeature.src/M000018.html +21 -0
- data/doc/classes/TestImageMap.html +182 -0
- data/doc/classes/TestImageMap.src/M000019.html +22 -0
- data/doc/classes/TestImageMap.src/M000020.html +56 -0
- data/doc/classes/TestImageMap.src/M000021.html +56 -0
- data/doc/classes/TestImageMap.src/M000022.html +20 -0
- data/doc/classes/TestPanel.html +276 -0
- data/doc/classes/TestPanel.src/M000001.html +18 -0
- data/doc/classes/TestPanel.src/M000002.html +61 -0
- data/doc/classes/TestPanel.src/M000003.html +35 -0
- data/doc/classes/TestPanel.src/M000004.html +54 -0
- data/doc/classes/TestPanel.src/M000005.html +54 -0
- data/doc/classes/TestPanel.src/M000006.html +41 -0
- data/doc/classes/TestPanel.src/M000007.html +36 -0
- data/doc/classes/TestPanel.src/M000008.html +20 -0
- data/doc/classes/TestPanel.src/M000009.html +26 -0
- data/doc/classes/TestPanel.src/M000010.html +21 -0
- data/doc/classes/TestRuler.html +152 -0
- data/doc/classes/TestRuler.src/M000013.html +22 -0
- data/doc/classes/TestRuler.src/M000014.html +31 -0
- data/doc/classes/TestSubFeature.html +152 -0
- data/doc/classes/TestSubFeature.src/M000023.html +21 -0
- data/doc/classes/TestSubFeature.src/M000024.html +18 -0
- data/doc/classes/TestTrack.html +152 -0
- data/doc/classes/TestTrack.src/M000011.html +19 -0
- data/doc/classes/TestTrack.src/M000012.html +23 -0
- data/doc/created.rid +1 -1
- data/doc/files/README_DEV.html +399 -70
- data/doc/files/TUTORIAL.html +188 -67
- data/doc/files/lib/bio-graphics_rb.html +3 -2
- data/doc/files/lib/bio/graphics/feature_rb.html +12 -6
- data/doc/files/lib/bio/graphics/glyphs/box_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/common_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/directed_box_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/directed_generic_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/directed_spliced_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/dot_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/generic_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/line_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/line_with_handles_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/spliced_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/transcript_rb.html +113 -0
- data/doc/files/lib/bio/graphics/glyphs/triangle_rb.html +113 -0
- data/doc/files/lib/bio/graphics/image_map_rb.html +3 -2
- data/doc/files/lib/bio/graphics/panel_rb.html +10 -2
- data/doc/files/lib/bio/graphics/ruler_rb.html +3 -2
- data/doc/files/lib/bio/graphics/subfeature_rb.html +114 -0
- data/doc/files/lib/bio/graphics/track_rb.html +3 -2
- data/doc/files/lib/feature_rb.html +101 -0
- data/doc/files/samples/arkdb_features_rb.html +101 -0
- data/doc/files/samples/glyph_showcase_rb.html +108 -0
- data/doc/files/samples/protein_domains_rb.html +115 -0
- data/doc/files/samples/subfeatures_rb.html +108 -0
- data/doc/files/scripts/gff2png_rb.html +154 -0
- data/doc/files/test/unit/custom_glyph_in_file_rb.html +101 -0
- data/doc/files/test/unit/test_class_extensions_rb.html +108 -0
- data/doc/files/test/unit/test_creation_rb.html +108 -0
- data/doc/files/test/unit/test_custom_glyph_rb.html +108 -0
- data/doc/files/test/unit/test_draw_rb.html +108 -0
- data/doc/files/test/unit/test_imagemap_rb.html +108 -0
- data/doc/files/test/unit/test_subfeatures_rb.html +108 -0
- data/doc/fr_class_index.html +24 -6
- data/doc/fr_file_index.html +14 -0
- data/doc/fr_method_index.html +51 -19
- data/doc/images/glyph_showcase.png +0 -0
- data/doc/images/terms.svg +146 -132
- data/images/glyph_showcase.png +0 -0
- data/lib/bio-graphics.rb +38 -6
- data/lib/bio/graphics/feature.rb +212 -440
- data/lib/bio/graphics/glyphs/box.rb +21 -0
- data/lib/bio/graphics/glyphs/common.rb +149 -0
- data/lib/bio/graphics/glyphs/directed_box.rb +28 -0
- data/lib/bio/graphics/glyphs/directed_generic.rb +23 -0
- data/lib/bio/graphics/glyphs/directed_spliced.rb +39 -0
- data/lib/bio/graphics/glyphs/dot.rb +21 -0
- data/lib/bio/graphics/glyphs/generic.rb +15 -0
- data/lib/bio/graphics/glyphs/line.rb +17 -0
- data/lib/bio/graphics/glyphs/line_with_handles.rb +25 -0
- data/lib/bio/graphics/glyphs/spliced.rb +16 -0
- data/lib/bio/graphics/glyphs/transcript.rb +12 -0
- data/lib/bio/graphics/glyphs/triangle.rb +18 -0
- data/lib/bio/graphics/image_map.rb +25 -4
- data/lib/bio/graphics/panel.rb +266 -209
- data/lib/bio/graphics/ruler.rb +95 -96
- data/lib/bio/graphics/subfeature.rb +187 -0
- data/lib/bio/graphics/track.rb +155 -156
- data/lib/feature.rb +204 -0
- data/samples/arkdb_features.rb +10 -8
- data/samples/glyph_showcase.rb +58 -22
- data/samples/protein_domains.rb +19 -0
- data/samples/subfeatures.rb +31 -0
- data/test/unit/custom_glyph_in_file.rb +12 -0
- data/test/unit/data.txt +32 -0
- data/test/unit/test_class_extensions.rb +23 -0
- data/test/unit/test_creation.rb +43 -13
- data/test/unit/test_custom_glyph.rb +50 -0
- data/test/unit/test_draw.rb +211 -0
- data/test/unit/test_imagemap.rb +134 -0
- data/test/unit/test_subfeatures.rb +17 -0
- metadata +396 -119
- data/doc/classes/Bio/Graphics/Panel.src/M000005.html +0 -29
- data/doc/classes/Bio/Graphics/Panel.src/M000006.html +0 -19
- data/doc/classes/Bio/Graphics/Panel.src/M000007.html +0 -68
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000008.html +0 -20
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000009.html +0 -28
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000010.html +0 -54
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000013.html +0 -20
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000014.html +0 -20
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000015.html +0 -28
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000016.html +0 -59
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000017.html +0 -20
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000018.html +0 -28
- data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000019.html +0 -59
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000008.html +0 -26
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000009.html +0 -42
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000010.html +0 -52
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000011.html +0 -23
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000012.html +0 -43
- data/doc/classes/Bio/Graphics/Panel/Track.src/M000013.html +0 -259
- data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000011.html +0 -65
- data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000012.html +0 -39
- data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000013.html +0 -27
- data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000014.html +0 -225
- data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000015.html +0 -48
- data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000012.html +0 -18
- data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000013.html +0 -18
- data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000015.html +0 -18
- data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000016.html +0 -18
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Thu
|
1
|
+
Thu, 24 Jan 2008 20:03:24 +0000
|
data/doc/files/README_DEV.html
CHANGED
@@ -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
|
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
|
-
<
|
73
|
-
|
72
|
+
<pre>
|
73
|
+
#
|
74
|
+
# = README.DEV - Information for developers
|
75
|
+
#
|
76
|
+
# Copyright:: Copyright (C) 2007, 2008
|
77
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
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‘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‘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 => [0,1,1])
|
111
|
+
</pre>
|
112
|
+
<p>
|
113
|
+
The construct you‘ll see for this is as follows (for Track#new):
|
74
114
|
</p>
|
75
|
-
<
|
115
|
+
<pre>
|
116
|
+
def initialize(panel, name, opts = {})
|
117
|
+
@panel = panel
|
118
|
+
@name = name
|
119
|
+
|
120
|
+
opts = {
|
121
|
+
:label => true,
|
122
|
+
:glyph => :generic,
|
123
|
+
:colour => [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
|
-
|
78
|
-
|
79
|
-
|
134
|
+
Basically, this means that the ‘panel’ and ‘name’
|
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‘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‘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‘s one file for each class: panel, track, feature,
|
91
|
-
image_map. See the tutorial on a breakdown what each of these do.
|
92
|
-
these except the image_map make up a picture. The image_map is used
|
93
|
-
describe the HTML map that can be created to make a picture clickable.
|
150
|
+
There‘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
|
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::<something>
|
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‘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]
|
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, …; 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‘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 ‘bumped’ 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
|
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.
|
186
|
-
|
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
|
190
|
-
‘complement(join(10..20,50..70))’.
|
191
|
-
use the Bio::Locations object from bioruby (see
|
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 ‘complement(join(10..20,50..70))’.
|
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‘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‘s look at the other end: the Feature object that gets
|
203
263
|
created. In the Feature#initialize method, you‘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‘UTR, CDS and 3‘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‘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.
|
224
|
-
have an array @pixel_range_collection with just one
|
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‘ve got a directed feature (so one with an arrow), and the
|
|
229
303
|
3’ end falls outside of the view. What would happen, is that the
|
230
304
|
3’ end that‘s out of view would be chopped of (that‘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.
|
306
|
+
the feature) becomes an arrow. We don‘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>
|
324
|
+
<h4>5. Drawing the thing</h4>
|
251
325
|
<p>
|
252
|
-
The Cairo
|
253
|
-
href="http://cairographics.org">cairographics.org</a
|
254
|
-
|
255
|
-
also see
|
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‘s walk through the code itself…
|
358
|
+
Now let‘s walk through the drawing code itself…
|
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.
|
322
|
-
|
396
|
+
the title. We also ‘translate’ 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),
|
329
|
-
grid is basically a hash with the keys being the row number, and the
|
330
|
-
arrays of ranges. (These ranges use basepair units rather than
|
331
|
-
that‘s completely arbitrary.) For each feature, we first
|
332
|
-
can draw it at the top of the track (i.e. row 1) and if we
|
333
|
-
it down a row at a time until there‘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‘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‘t move it down a row at a time until there‘s room for it.
|
334
411
|
</p>
|
335
412
|
<p>
|
336
413
|
So for example, suppose we‘ve already drawn two features that have
|
@@ -351,28 +428,38 @@ like:
|
|
351
428
|
2 => [(125..175)] }
|
352
429
|
</pre>
|
353
430
|
<p>
|
354
|
-
So now we know what the vertical coordinates of the glyph should be.
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
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… 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‘s not the case, the Feature is seen as having one SubFeature.
|
437
|
+
</p>
|
438
|
+
<p>
|
439
|
+
Next step is to check if there‘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‘s no way the arrow will be visible. If
|
360
444
|
we‘d try to draw that arrow anyway, it would become bigger than the
|
361
445
|
feature itself. Another reason would be if the feature‘s 3’ end
|
362
446
|
extends outwith the picture.
|
363
447
|
</p>
|
364
448
|
<p>
|
365
|
-
Finally, we can <b>draw</b>.
|
366
|
-
|
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>, …).
|
367
454
|
</p>
|
368
455
|
<p>
|
369
|
-
For the spliced features (
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
@
|
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>‘_’-separated_lowercase for method names
|
520
|
+
|
521
|
+
</li>
|
522
|
+
<li>‘_’-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‘t replace spaces to tabs.
|
535
|
+
|
536
|
+
</li>
|
537
|
+
</ul>
|
538
|
+
<h3>Comments</h3>
|
539
|
+
<p>
|
540
|
+
Don‘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 <brh@example.org>,
|
576
|
+
# Copyright:: Copyright (C) 2006 Chem R. Hacker <crh@example.org>
|
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‘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 # => '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 # => 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‘t use
|
699
|
+
</p>
|
700
|
+
<pre>
|
701
|
+
$stderr.puts "WARNING"
|
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 ‘test/unit‘</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‘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>
|