3 #Wed Sep 1 18:54:18 EDT 2004
4 #Simon Ilyushchenko - demonstrating several new glyphs for gbrowse, part 2.
8 use Bio
::Graphics
::Panel
;
12 bp_glyphs2-demo.pl - Second demo of Bio::Graphics glyphs
16 % bp_glyphs2-demo.pl | display -
20 Generates a PNG image of some of the more esoteric Bio::Graphics glyphs.
24 L<Bio::Graphics>, the BioGraphics HOWTO.
30 Copyright (c) 2004 Cold Spring Harbor Laboratory
32 This library is free software; you can redistribute it and/or modify
33 it under the same terms as Perl itself. See DISCLAIMER.txt for
34 disclaimers of warranty.
38 my $ftr = 'Bio::Graphics::Feature';
39 my $segment = $ftr->new(-start
=>1,-end
=>400,-name
=>'ZK154',-type
=>'clone');
40 my $subseg1 = $ftr->new(-start
=>100,-end
=>300,-name
=>'glyphs 2');
42 my $panel = Bio
::Graphics
::Panel
->new(
45 -key_style
=> 'bottom');
47 $subseg1->name('dumbbell - arrows with arc ');
49 $panel->add_track(segments
=>[$subseg1],
55 -fgcolor
=> 'crimson',
56 -end_shape
=> "arrow",
57 -glyph
=> 'dumbbell');
59 $subseg1->name('dumbbell - wave ');
61 $panel->add_track(segments
=>[$subseg1],
67 -glyph
=> 'dumbbell');
69 $subseg1->name('two bolts');
71 $panel->add_track(segments
=>[$subseg1],
74 -bolt_color
=> 'violet',
76 -glyph
=> 'two_bolts');
78 $subseg1->name('wave');
80 $panel->add_track(segments
=>[$subseg1],
86 $subseg1->name('broken line');
88 $panel->add_track(segments
=>[$subseg1],
91 -glyph
=> 'broken_line');
93 $subseg1->name('tic_tac_toe');
95 $panel->add_track(segments
=>[$subseg1],
98 -glyph
=> 'tic_tac_toe');
100 $subseg1->name('text_in_box');
102 $panel->add_track(segments
=>[$subseg1],
105 -text_bgcolor
=> 'yellow',
106 -glyph
=> 'text_in_box');
109 $subseg1->name('christmas arrow');
111 $panel->add_track(segments
=>[$subseg1],
114 -fgcolor
=> 'steelblue',
115 -glyph
=> 'christmas_arrow');
118 $subseg1->name('pentagram');
120 $panel->add_track(segments
=>[$subseg1],
123 -glyph
=> 'pentagram');
126 $subseg1->name('weighted arrow');
128 $panel->add_track(segments
=>[$subseg1],
131 -fgcolor
=> 'sienna',
132 -glyph
=> 'weighted_arrow');
136 open OUT
,">glyphs2.png" or die "Couldn't open glyphs2.png for writing: $!";
137 print OUT
$panel->gd->png;