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
@@ -0,0 +1,21 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/box - box glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Box < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
@feature_context.move_to(self.left_pixel, 0)
|
13
|
+
@feature_context.line_to(self.right_pixel, 0)
|
14
|
+
@feature_context.line_to(self.right_pixel, Bio::Graphics::FEATURE_HEIGHT)
|
15
|
+
@feature_context.line_to(self.left_pixel, Bio::Graphics::FEATURE_HEIGHT)
|
16
|
+
@feature_context.close_path
|
17
|
+
@feature_context.stroke
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/common - common methods for all glyphs
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Common
|
11
|
+
def initialize(subfeature, feature_context)
|
12
|
+
@subfeature, @feature_context = subfeature, feature_context
|
13
|
+
end
|
14
|
+
attr_accessor :subfeature, :feature_context
|
15
|
+
|
16
|
+
def left_pixel
|
17
|
+
if self.class == Bio::Graphics::Glyph::Triangle
|
18
|
+
return @subfeature.pixel_range_collection[0].lend - Bio::Graphics::FEATURE_ARROW_LENGTH
|
19
|
+
elsif self.class == Bio::Graphics::Glyph::Dot
|
20
|
+
return @subfeature.pixel_range_collection[0].lend - @radius
|
21
|
+
else
|
22
|
+
return @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}[0].lend
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def right_pixel
|
27
|
+
if self.class == Bio::Graphics::Glyph::Triangle
|
28
|
+
return @subfeature.pixel_range_collection[0].rend + Bio::Graphics::FEATURE_ARROW_LENGTH
|
29
|
+
elsif self.class == Bio::Graphics::Glyph::Dot
|
30
|
+
return @subfeature.pixel_range_collection[0].rend + @radius
|
31
|
+
else
|
32
|
+
return @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}[-1].rend
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
# Method to draw each of the squared spliced rectangles for
|
39
|
+
# spliced and directed_spliced
|
40
|
+
# ---
|
41
|
+
# *Arguments*:
|
42
|
+
# * _track_drawing_::
|
43
|
+
# * _pixel_ranges_::
|
44
|
+
# * _top_pixel_of_feature_::
|
45
|
+
# * _gap_starts_::
|
46
|
+
# * _gap_stops_::
|
47
|
+
def draw_spliced(feature_context, pixel_ranges, gap_starts, gap_stops)
|
48
|
+
# draw the parts
|
49
|
+
pixel_ranges.each do |range|
|
50
|
+
feature_context.rectangle(range.lend, 0, range.rend - range.lend, Bio::Graphics::FEATURE_HEIGHT).fill
|
51
|
+
gap_starts.push(range.rend)
|
52
|
+
gap_stops.push(range.lend)
|
53
|
+
end
|
54
|
+
|
55
|
+
# And then draw the connections in the gaps
|
56
|
+
# Start with removing the very first start and the very last stop.
|
57
|
+
gap_starts.sort!.pop
|
58
|
+
gap_stops.sort!.shift
|
59
|
+
|
60
|
+
gap_starts.length.times do |gap_number|
|
61
|
+
connector(feature_context,gap_starts[gap_number].to_f,gap_stops[gap_number].to_f)
|
62
|
+
end
|
63
|
+
|
64
|
+
if @subfeature.hidden_subfeatures_at_stop
|
65
|
+
from = @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}[-1].rend
|
66
|
+
to = @subfeature.feature.track.panel.width
|
67
|
+
feature_context.move_to(from, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
68
|
+
feature_context.line_to(to, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
69
|
+
feature_context.stroke
|
70
|
+
end
|
71
|
+
|
72
|
+
if @subfeature.hidden_subfeatures_at_start
|
73
|
+
from = 1
|
74
|
+
to = @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}[0].lend
|
75
|
+
feature_context.move_to(from, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
76
|
+
feature_context.line_to(to, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
77
|
+
feature_context.stroke
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Method to draw the arrows of directed glyphs. Not to be used
|
82
|
+
# directly, but called by Feature#draw.
|
83
|
+
def arrow(feature_context,direction,x,y,size)
|
84
|
+
case direction
|
85
|
+
when :right
|
86
|
+
feature_context.move_to(x,y)
|
87
|
+
feature_context.rel_line_to(size,size)
|
88
|
+
feature_context.rel_line_to(-size,size)
|
89
|
+
feature_context.close_path.fill
|
90
|
+
when :left
|
91
|
+
feature_context.move_to(x,y)
|
92
|
+
feature_context.rel_line_to(-size,size)
|
93
|
+
feature_context.rel_line_to(size,size)
|
94
|
+
feature_context.close_path.fill
|
95
|
+
when :north
|
96
|
+
feature_context.move_to(x-size,y+size)
|
97
|
+
feature_context.rel_line_to(size,-size)
|
98
|
+
feature_context.rel_line_to(size,size)
|
99
|
+
feature_context.close_path.fill
|
100
|
+
when :south
|
101
|
+
feature_context.move_to(x-size,y-size)
|
102
|
+
feature_context.rel_line_to(size,size)
|
103
|
+
feature_context.rel_line_to(size,-size)
|
104
|
+
feature_context.close_path.fill
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Method to draw the arrows of directed glyphs. Not to be used
|
109
|
+
# directly, but called by Feature#draw.
|
110
|
+
def open_arrow(feature_context,direction,x,y,size)
|
111
|
+
case direction
|
112
|
+
when :right
|
113
|
+
feature_context.move_to(x,y)
|
114
|
+
feature_context.rel_line_to(size,size)
|
115
|
+
feature_context.rel_line_to(-size,size)
|
116
|
+
feature_context.stroke
|
117
|
+
when :left
|
118
|
+
feature_context.move_to(x,y)
|
119
|
+
feature_context.rel_line_to(-size,size)
|
120
|
+
feature_context.rel_line_to(size,size)
|
121
|
+
feature_context.stroke
|
122
|
+
when :north
|
123
|
+
feature_context.move_to(x-size,y+size)
|
124
|
+
feature_context.rel_line_to(size,-size)
|
125
|
+
feature_context.rel_line_to(size,size)
|
126
|
+
feature_context.stroke
|
127
|
+
when :south
|
128
|
+
feature_context.move_to(x-size,y-size)
|
129
|
+
feature_context.rel_line_to(size,size)
|
130
|
+
feature_context.rel_line_to(size,-size)
|
131
|
+
feature_context.stroke
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Method to draw the connections (introns) of spliced glyphs. Not to
|
136
|
+
# be used directly, but called by Feature#draw.
|
137
|
+
def connector(feature_context,from,to)
|
138
|
+
line_width = feature_context.line_width
|
139
|
+
feature_context.set_line_width(0.5)
|
140
|
+
middle = from + ((to - from)/2)
|
141
|
+
feature_context.move_to(from, 2)
|
142
|
+
feature_context.line_to(middle, 7)
|
143
|
+
feature_context.line_to(to, 2)
|
144
|
+
feature_context.stroke
|
145
|
+
feature_context.set_line_width(line_width)
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/directed_box - directed_box glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::DirectedBox < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
if @subfeature.strand == -1 # Reverse strand
|
13
|
+
@feature_context.move_to(self.left_pixel + Bio::Graphics::FEATURE_ARROW_LENGTH, 0)
|
14
|
+
@feature_context.line_to(self.right_pixel, 0)
|
15
|
+
@feature_context.line_to(self.right_pixel, Bio::Graphics::FEATURE_HEIGHT)
|
16
|
+
@feature_context.line_to(self.left_pixel + Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT)
|
17
|
+
@feature_context.stroke
|
18
|
+
open_arrow(@feature_context,:left,self.left_pixel+Bio::Graphics::FEATURE_ARROW_LENGTH,0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
19
|
+
else #default is forward strand
|
20
|
+
@feature_context.move_to(self.right_pixel - Bio::Graphics::FEATURE_ARROW_LENGTH, 0)
|
21
|
+
@feature_context.line_to(self.left_pixel, 0)
|
22
|
+
@feature_context.line_to(self.left_pixel, Bio::Graphics::FEATURE_HEIGHT)
|
23
|
+
@feature_context.line_to(self.right_pixel - Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT)
|
24
|
+
open_arrow(@feature_context, :right, self.right_pixel - Bio::Graphics::FEATURE_ARROW_LENGTH, 0, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/directed_generic - directed_generic glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::DirectedGeneric < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
if @subfeature.strand == -1 # Reverse strand
|
13
|
+
@feature_context.rectangle(self.left_pixel+Bio::Graphics::FEATURE_ARROW_LENGTH, 0, self.right_pixel - self.left_pixel - Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT).fill
|
14
|
+
arrow(@feature_context,:left,self.left_pixel+Bio::Graphics::FEATURE_ARROW_LENGTH,0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
15
|
+
@feature_context.close_path.fill
|
16
|
+
else #default is forward strand
|
17
|
+
@feature_context.rectangle(self.left_pixel, 0, self.right_pixel- self.left_pixel - Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT).fill
|
18
|
+
arrow(@feature_context,:right,self.right_pixel-Bio::Graphics::FEATURE_ARROW_LENGTH,0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
19
|
+
@feature_context.close_path.fill
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/directed_spliced - directed_spliced glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::DirectedSpliced < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
gap_starts = Array.new
|
13
|
+
gap_stops = Array.new
|
14
|
+
|
15
|
+
# Start with the one with the arrow
|
16
|
+
pixel_ranges = @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}
|
17
|
+
range_with_arrow = nil
|
18
|
+
if @subfeature.strand == -1 # reverse strand => box with arrow is first one
|
19
|
+
range_with_arrow = pixel_ranges.shift
|
20
|
+
@feature_context.rectangle((range_with_arrow.lend)+Bio::Graphics::FEATURE_ARROW_LENGTH, 0, range_with_arrow.rend - range_with_arrow.lend - Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT).fill
|
21
|
+
arrow(@feature_context,:left,range_with_arrow.lend+Bio::Graphics::FEATURE_ARROW_LENGTH, 0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
22
|
+
@feature_context.close_path.fill
|
23
|
+
else # forward strand => box with arrow is last one
|
24
|
+
range_with_arrow = pixel_ranges.pop
|
25
|
+
@feature_context.rectangle(range_with_arrow.lend, 0, range_with_arrow.rend - range_with_arrow.lend - Bio::Graphics::FEATURE_ARROW_LENGTH, Bio::Graphics::FEATURE_HEIGHT).fill
|
26
|
+
arrow(@feature_context,:right,range_with_arrow.rend-Bio::Graphics::FEATURE_ARROW_LENGTH, 0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
27
|
+
@feature_context.close_path.fill
|
28
|
+
end
|
29
|
+
gap_starts.push(range_with_arrow.rend)
|
30
|
+
gap_stops.push(range_with_arrow.lend)
|
31
|
+
|
32
|
+
# And then add the others
|
33
|
+
draw_spliced(@feature_context, pixel_ranges, gap_starts, gap_stops)
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/dot - dot glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Dot < Bio::Graphics::Glyph::Common
|
11
|
+
attr_accessor :radius
|
12
|
+
|
13
|
+
def draw
|
14
|
+
raise "Start and stop are not the same (necessary if you want triangle glyphs)" if @subfeature.start != @subfeature.stop
|
15
|
+
|
16
|
+
@radius = Bio::Graphics::FEATURE_HEIGHT/2
|
17
|
+
@feature_context.circle(self.left_pixel + @radius, @radius, @radius).fill
|
18
|
+
@feature_context.close_path.stroke
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/generic - generic glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Generic < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
@feature_context.rectangle(self.left_pixel, 0, (self.right_pixel - self.left_pixel), Bio::Graphics::FEATURE_HEIGHT).fill
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/line - line glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Line < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
@feature_context.move_to(self.left_pixel,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
13
|
+
@feature_context.line_to(self.right_pixel,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
14
|
+
@feature_context.stroke
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/line_with_handles - line_with_handles glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::LineWithHandles < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
@feature_context.move_to(self.left_pixel,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
13
|
+
@feature_context.line_to(self.right_pixel,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
14
|
+
@feature_context.stroke
|
15
|
+
|
16
|
+
@feature_context.set_source_rgb([0,0,0])
|
17
|
+
arrow(@feature_context,:right,self.left_pixel,0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
18
|
+
@feature_context.close_path.stroke
|
19
|
+
arrow(@feature_context,:left,self.right_pixel,0,Bio::Graphics::FEATURE_ARROW_LENGTH)
|
20
|
+
@feature_context.close_path.stroke
|
21
|
+
|
22
|
+
@feature_context.set_source_rgb(@subfeature.colour)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/splices - spliced glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Spliced < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
pixel_ranges = @subfeature.pixel_range_collection.sort_by{|pr| pr.lend}
|
13
|
+
draw_spliced(@feature_context, pixel_ranges, [], [])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/transcript - transcript glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Transcript < Bio::Graphics::Glyph::Common
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#
|
2
|
+
# = bio/graphics/glyphs/triangle - triangle glyph
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007, 2008
|
5
|
+
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
module Bio::Graphics::Glyph
|
10
|
+
class Bio::Graphics::Glyph::Triangle < Bio::Graphics::Glyph::Common
|
11
|
+
def draw
|
12
|
+
raise "Start and stop are not the same (necessary if you want triangle glyphs)" if @subfeature.start != @subfeature.stop
|
13
|
+
|
14
|
+
arrow(@feature_context,:north, self.left_pixel + Bio::Graphics::FEATURE_ARROW_LENGTH, 0, Bio::Graphics::FEATURE_ARROW_LENGTH)
|
15
|
+
@feature_context.close_path.stroke
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -3,25 +3,44 @@
|
|
3
3
|
#
|
4
4
|
# Copyright:: Copyright (C) 2007
|
5
5
|
# Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
6
|
+
# Charles Comstock <dgtized@gmail.com>
|
6
7
|
# License:: Ruby's
|
7
|
-
class ImageMap
|
8
|
+
class Bio::Graphics::ImageMap
|
8
9
|
def initialize
|
9
10
|
@elements = Array.new
|
10
11
|
end
|
11
12
|
attr_accessor :elements
|
12
13
|
|
14
|
+
def add_element(left,top,right,bottom,url = nil)
|
15
|
+
@elements.push(Element.new(left,top,right,bottom,url))
|
16
|
+
end
|
17
|
+
|
13
18
|
def to_s
|
14
19
|
output = Array.new
|
15
20
|
output.push('<map name="image_map" border="1">')
|
16
21
|
@elements.each do |e|
|
17
|
-
|
22
|
+
area = e.to_s
|
23
|
+
if area != ''
|
24
|
+
output.push(e.to_s)
|
25
|
+
end
|
18
26
|
end
|
19
27
|
output.push('</map>')
|
20
28
|
return output.join("\n")
|
21
29
|
end
|
22
30
|
|
23
31
|
|
24
|
-
|
32
|
+
# Switch horizontal to vertical orientation
|
33
|
+
def flip_orientation(width)
|
34
|
+
@elements.each do |element|
|
35
|
+
left, top, right, bottom = element.left, element.top, element.right, element.bottom
|
36
|
+
element.left = top
|
37
|
+
element.top = width - right
|
38
|
+
element.right = bottom
|
39
|
+
element.bottom = width - left
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class Element
|
25
44
|
def initialize(left, top, right, bottom, url = nil)
|
26
45
|
@left, @top, @right, @bottom = left, top, right, bottom
|
27
46
|
@url = ( url.nil? ) ? '' : url
|
@@ -29,7 +48,9 @@ class ImageMap
|
|
29
48
|
attr_accessor :left, :top, :right, :bottom, :url
|
30
49
|
|
31
50
|
def to_s
|
32
|
-
|
51
|
+
if @url == ''
|
52
|
+
return ''
|
53
|
+
else
|
33
54
|
return '<area shape="rect" coords="' + @left.to_s + ' ' + @top.to_s + ' ' + @right.to_s + ' ' + @bottom.to_s + '" href="' + @url + '"/>'
|
34
55
|
end
|
35
56
|
end
|