bio-graphics 1.2 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- 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/lib/bio/graphics/panel.rb
CHANGED
@@ -1,209 +1,266 @@
|
|
1
|
-
#
|
2
|
-
# = bio/graphics/panel - panel class
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright (C) 2007
|
5
|
-
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
-
#
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
#
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
#
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
1
|
+
#
|
2
|
+
# = bio/graphics/panel - panel class
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# Charles Comstock <dgtized@gmail.com>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
include Math
|
10
|
+
|
11
|
+
# = DESCRIPTION
|
12
|
+
# The Bio::Graphics set of objects allow for creating simple images that
|
13
|
+
# display features on a linear map. A picture consists of:
|
14
|
+
# * one *panel*: container of all tracks
|
15
|
+
# * one or more *tracks*: container of the features. Multiple tracks
|
16
|
+
# can exist in the same graphic to allow for differential visualization of
|
17
|
+
# different feature types (e.g. genes as blue rectangles and polymorphisms
|
18
|
+
# as red triangles)
|
19
|
+
# * one or more *features* in each track: these are the actual features that
|
20
|
+
# you want to display (e.g. 'gene 1', 'SNP 123445')
|
21
|
+
# * a *ruler* on top of the panel: is added automatically
|
22
|
+
#
|
23
|
+
# Schematically:
|
24
|
+
# panel
|
25
|
+
# +-> track 1
|
26
|
+
# | +-> feature 1
|
27
|
+
# | +-> feature 2
|
28
|
+
# | +-> feature 3
|
29
|
+
# +-> track 2
|
30
|
+
# | +-> feature 4
|
31
|
+
# | +-> feature 5
|
32
|
+
# +-> ruler
|
33
|
+
#
|
34
|
+
# = USAGE
|
35
|
+
# # Create a panel for something with a length of 653. This could be a
|
36
|
+
# # sequence of 653 bp, but also a genetic map of 653 cM.
|
37
|
+
# g = Bio::Graphics::Panel.new(653)
|
38
|
+
#
|
39
|
+
# # Add the first track (e.g. 'genes')
|
40
|
+
# track1 = g.add_track('genes')
|
41
|
+
#
|
42
|
+
# # And put features in that track
|
43
|
+
# track1.add_feature('gene1','250..375')
|
44
|
+
# track1.add_feature('gene2','54..124')
|
45
|
+
# track1.add_feature('gene3','100..500')
|
46
|
+
#
|
47
|
+
# # Add a second track (e.g. 'polymorphisms')
|
48
|
+
# track2 = g.add_track('polymorphisms', false, [1,0,0], :triangle)
|
49
|
+
#
|
50
|
+
# # And put features on this one
|
51
|
+
# track2.add_feature('polymorphism 1','56')
|
52
|
+
# track2.add_feature('polymorphism 2','103')
|
53
|
+
#
|
54
|
+
# # Create the actual image as SVG text
|
55
|
+
# g.draw('my_picture.png')
|
56
|
+
#
|
57
|
+
# = NOTE ON ARGUMENTS
|
58
|
+
# As there can be an overwhelming number of arguments for some methods in
|
59
|
+
# Bio::Graphics, any optional arguments have to be provided as a hash. For
|
60
|
+
# example: the Track#add_feature method has only one mandatory argument (the
|
61
|
+
# feature object) and several optional ones. This is how you can use that
|
62
|
+
# method:
|
63
|
+
# track.add_feature(my_feature_object,
|
64
|
+
# :label => 'anonymous',
|
65
|
+
# :link => 'http://www.google.com',
|
66
|
+
# :glyph => :box,
|
67
|
+
# :colour => [0,1,0]
|
68
|
+
# )
|
69
|
+
module Bio::Graphics
|
70
|
+
|
71
|
+
# The defaults
|
72
|
+
DEFAULT_PANEL_WIDTH = 800 # How many pixels wide do we want the picture to be?
|
73
|
+
TRACK_HEADER_HEIGHT = 12 # The track header will contain the title.
|
74
|
+
FEATURE_HEIGHT = 10 # The height in pixels of a glyph.
|
75
|
+
FEATURE_V_DISTANCE = 5 # The vertical distance in pixels between glyphs
|
76
|
+
FEATURE_ARROW_LENGTH = 5 # In pixels again.
|
77
|
+
FONT = ['Georgia', 1, 1]
|
78
|
+
|
79
|
+
# The Bio::Graphics::Panel class describes the complete graph and contains
|
80
|
+
# all tracks. See Bio::Graphics documentation for explanation of interplay
|
81
|
+
# between different classes.
|
82
|
+
class Bio::Graphics::Panel
|
83
|
+
# Create a new Bio::Graphics::Panel object
|
84
|
+
#
|
85
|
+
# g = Bio::Graphics::Panel.new(456)
|
86
|
+
#
|
87
|
+
# The height of the image is calculated automatically depending on how many
|
88
|
+
# tracks and features it contains. The width of the image defaults to 800 pt
|
89
|
+
# but can be set manually by using the width argument to the opts hash:
|
90
|
+
#
|
91
|
+
# g = Bio::Graphics::Panel.new(456, :width => 1200)
|
92
|
+
#
|
93
|
+
#
|
94
|
+
# See also: Bio::Graphics::Panel::Track,
|
95
|
+
# Bio::Graphics::Panel::Track::Feature
|
96
|
+
# ---
|
97
|
+
# *Arguments*:
|
98
|
+
# * _length_ :: length of the thing you want to visualize, e.g for
|
99
|
+
# visualizing a sequence that is 3.24 kb long, use 324. (required)
|
100
|
+
# * _:width_ :: width of the resulting image in pixels. (default: 800)
|
101
|
+
# * _:clickable_ :: whether the picture should have clickable glyphs or not
|
102
|
+
# (default: false) If set to true, a html file will be created with
|
103
|
+
# the map.
|
104
|
+
# * _:display_start_ :: start coordinate to be displayed (default: 1)
|
105
|
+
# * _:display_stop_ :: stop coordinate to be displayed (default: length of sequence)
|
106
|
+
# * _:vertical_ :: Boolean: false = horizontal (= default)
|
107
|
+
# * _:format_ :: File format of the picture. Can be :png, :svg, :pdf or :ps
|
108
|
+
# (default: :png)
|
109
|
+
# *Returns*:: Bio::Graphics::Panel object
|
110
|
+
def initialize(length, opts = {})
|
111
|
+
@length = length
|
112
|
+
opts = {
|
113
|
+
:width => DEFAULT_PANEL_WIDTH,
|
114
|
+
:display_range => Range.new(0,@length),
|
115
|
+
:vertical => false,
|
116
|
+
:clickable => false,
|
117
|
+
:format => :png
|
118
|
+
}.merge(opts)
|
119
|
+
|
120
|
+
@width = opts[:width].to_i
|
121
|
+
|
122
|
+
@display_range = opts[:display_range]
|
123
|
+
@display_start = [0, @display_range.lend].max
|
124
|
+
@display_stop = [@length,@display_range.rend].min
|
125
|
+
if @display_stop <= @display_start
|
126
|
+
raise "[ERROR] Start coordinate to be displayed has to be smaller than stop coordinate."
|
127
|
+
end
|
128
|
+
@display_range = Range.new(@display_start,@display_stop)
|
129
|
+
|
130
|
+
@vertical = opts[:vertical]
|
131
|
+
@clickable = opts[:clickable]
|
132
|
+
|
133
|
+
@format = opts[:format]
|
134
|
+
if ! [:png, :svg, :pdf, :ps].include?(@format)
|
135
|
+
raise "[ERROR] Format has to be one of :png, :svg, :pdf or :ps."
|
136
|
+
end
|
137
|
+
|
138
|
+
@tracks = Array.new
|
139
|
+
@number_of_feature_rows = 0
|
140
|
+
@image_map = ImageMap.new
|
141
|
+
|
142
|
+
@rescale_factor = (@display_stop - @display_start).to_f / @width
|
143
|
+
|
144
|
+
# To prevent that we do the whole drawing thing multiple times
|
145
|
+
@final_panel_destination = nil
|
146
|
+
end
|
147
|
+
attr_accessor :length, :width, :height, :rescale_factor, :tracks, :number_of_feature_rows, :clickable, :image_map, :display_start, :display_stop, :display_range, :vertical, :format, :final_panel_destination
|
148
|
+
|
149
|
+
# Adds a Bio::Graphics::Track container to this panel. A panel contains a
|
150
|
+
# logical grouping of features, e.g. (for sequence annotation:) genes,
|
151
|
+
# polymorphisms, ESTs, etc.
|
152
|
+
#
|
153
|
+
# est_track = g.add_track('ESTs', :label => false, :glyph => :directed_generic)
|
154
|
+
# gene_track = g.add_track('genes', :label => true)
|
155
|
+
#
|
156
|
+
# ---
|
157
|
+
# *Arguments*:
|
158
|
+
# * _name_ :: Name to be displayed at the top of the track. (Required)
|
159
|
+
# * _:label_ :: boolean. Whether or not to display the labels for the features.
|
160
|
+
# (Default = true)
|
161
|
+
# * _:glyph_ :: Default glyph for features in this track. For more info, see
|
162
|
+
# the lib/bio/graphics/glyph directory. (Default = :generic)
|
163
|
+
# * _:colour_ :: Default colour for features in this track, in RGB
|
164
|
+
# (Default = [0,0,1])
|
165
|
+
# *Returns*:: Bio::Graphics::Track object that has just been created
|
166
|
+
def add_track(name, opts = {})
|
167
|
+
track = Bio::Graphics::Track.new(self, name, opts)
|
168
|
+
@tracks.push(track)
|
169
|
+
return track
|
170
|
+
end
|
171
|
+
|
172
|
+
# Create the drawing
|
173
|
+
#--
|
174
|
+
# The fact that display_start and display_stop can be set has two
|
175
|
+
# consequences:
|
176
|
+
# 1. not all features are drawn
|
177
|
+
# 2. the x-coordinate of all glyphs has to be corrected
|
178
|
+
#++
|
179
|
+
def draw(file_name)
|
180
|
+
if @final_panel_drawing.nil?
|
181
|
+
# Create a panel that is huge vertically
|
182
|
+
huge_height = 2000
|
183
|
+
|
184
|
+
huge_panel_destination = nil
|
185
|
+
huge_panel_destination = Cairo::ImageSurface.new(1, @width, huge_height)
|
186
|
+
|
187
|
+
background = Cairo::Context.new(huge_panel_destination)
|
188
|
+
background.set_source_rgb(1,1,1)
|
189
|
+
background.rectangle(0,0,@width,huge_height).fill
|
190
|
+
|
191
|
+
# Add ruler
|
192
|
+
vertical_offset = 0
|
193
|
+
ruler = Ruler.new(self)
|
194
|
+
ruler.draw(huge_panel_destination)
|
195
|
+
vertical_offset += ruler.height
|
196
|
+
|
197
|
+
# Add tracks
|
198
|
+
@tracks.each do |track|
|
199
|
+
track.vertical_offset = vertical_offset
|
200
|
+
track.draw(huge_panel_destination)
|
201
|
+
@number_of_feature_rows += track.number_of_feature_rows
|
202
|
+
vertical_offset += ( track.number_of_feature_rows*(FEATURE_HEIGHT+FEATURE_V_DISTANCE+5)) + 10 # '10' is for the header
|
203
|
+
end
|
204
|
+
|
205
|
+
# And create a smaller version of the panel
|
206
|
+
@height = ruler.height
|
207
|
+
@height += 20*@number_of_feature_rows
|
208
|
+
@height += 10*@tracks.length #To correct for the track headers
|
209
|
+
|
210
|
+
if @vertical
|
211
|
+
@image_map.flip_orientation(@width)
|
212
|
+
|
213
|
+
max_size = [@height, @width].max
|
214
|
+
rotated_destination = Cairo::ImageSurface.new(1, max_size, max_size)
|
215
|
+
rotated_context = Cairo::Context.new(rotated_destination)
|
216
|
+
rotated_context.rotate(3*PI/2)
|
217
|
+
rotated_context.translate(-@width, 0)
|
218
|
+
rotated_context.set_source(huge_panel_destination, 0, 0)
|
219
|
+
rotated_context.rectangle(0,0,max_size, max_size).fill
|
220
|
+
|
221
|
+
@width, @height = @height, @width
|
222
|
+
huge_panel_destination = rotated_destination
|
223
|
+
end
|
224
|
+
|
225
|
+
@final_panel_destination = Cairo::ImageSurface.new(1, @width, @height)
|
226
|
+
resized_context = Cairo::Context.new(@final_panel_destination)
|
227
|
+
resized_context.set_source(huge_panel_destination, 0, 0)
|
228
|
+
resized_context.rectangle(0,0,@width, @height).fill
|
229
|
+
end
|
230
|
+
|
231
|
+
# And print to file
|
232
|
+
if @format == :png
|
233
|
+
@final_panel_destination.write_to_png(file_name)
|
234
|
+
else
|
235
|
+
case @format
|
236
|
+
when :pdf
|
237
|
+
output_destination = Cairo::PDFSurface.new(file_name, @width, @height)
|
238
|
+
when :ps
|
239
|
+
output_destination = Cairo::PSSurface.new(file_name, @width, @height)
|
240
|
+
when :svg
|
241
|
+
output_destination = Cairo::SVGSurface.new(file_name, @width, @height)
|
242
|
+
end
|
243
|
+
|
244
|
+
output_context = Cairo::Context.new(output_destination)
|
245
|
+
output_context.set_source(@final_panel_destination, 0, 0)
|
246
|
+
output_context.rectangle(0,0,@width, @height).fill
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
if @clickable # create png and map
|
251
|
+
html_filename = file_name.sub(/\.[^.]+$/, '.html')
|
252
|
+
html = File.open(html_filename,'w')
|
253
|
+
html.puts "<html>"
|
254
|
+
html.puts "<body>"
|
255
|
+
html.puts @image_map.to_s
|
256
|
+
html.puts "<img border='1' src='" + file_name + "' usemap='#image_map' />"
|
257
|
+
html.puts "</body>"
|
258
|
+
html.puts "</html>"
|
259
|
+
html.close
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
end #Panel
|
266
|
+
end #Graphics
|