3
#Thu Aug 19 22:29:23 EDT 2004
4
#Simon Ilyushchenko - demonstrating several new glyphs for gbrowse, part 1.
8
use Bio::Graphics::Panel;
12
bp_glyphs1-demo.pl - First 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=>1000,-name=>'ZK154',-type=>'clone');
40
my $subseg1 = $ftr->new(-start=>100,-end=>600,-name=>'saw teeth');
42
my $panel = Bio::Graphics::Panel->new(
45
-key_style => 'bottom');
47
$panel->add_track(segments=>[$subseg1],
51
-glyph => 'saw_teeth');
53
$subseg1->name('frequent saw teeth');
55
$panel->add_track(segments=>[$subseg1],
60
-glyph => 'saw_teeth');
62
$subseg1->name('dashed line');
64
$panel->add_track(segments=>[$subseg1],
68
-glyph => 'dashed_line');
70
$subseg1->name('thick colored dashed line with shear');
72
$panel->add_track(segments=>[$subseg1],
77
-space_color => 'blue',
80
-glyph => 'dashed_line');
82
$subseg1->name('three letters');
84
$panel->add_track(segments=>[$subseg1],
89
-glyph => 'three_letters');
91
$subseg1->name('flag');
93
$panel->add_track(segments=>[$subseg1],
100
$subseg1->name('dumbbell - square ');
102
$panel->add_track(segments=>[$subseg1],
105
-end_shape => "square",
107
-glyph => 'dumbbell');
109
$subseg1->name('dumbbell - diamond');
111
$panel->add_track(segments=>[$subseg1],
114
-end_shape => "diamond",
115
-fgcolor => 'orange',
117
-glyph => 'dumbbell');
119
$subseg1->name('dumbbell - tree');
121
$panel->add_track(segments=>[$subseg1],
124
-end_shape => "tree",
127
-glyph => 'dumbbell');
129
$subseg1->name('dumbbell - clover');
131
$panel->add_track(segments=>[$subseg1],
134
-end_shape => "clover",
137
-glyph => 'dumbbell');
140
$subseg1->name('dumbbell - star with text');
142
$panel->add_track(segments=>[$subseg1],
145
-end_shape => "star",
148
-caption => 'Back in USSR',
149
-glyph => 'dumbbell');
152
$subseg1->name('dumbbell - bubble text');
154
$panel->add_track(segments=>[$subseg1],
157
-end_shape => "bubble",
158
-bubble_text => 'CpG',
161
-glyph => 'dumbbell');
169
open OUT,">glyphs1.png" or die "Couldn't open glyphs1.png for writing: $!";
170
print OUT $panel->gd->png;