empty directory
[bioperl-live.git] / scripts / biographics / bp_glyphs2-demo.PLS
blobe2d3455ce79f73a78b8309559b9e9065e1a7efc5
1 #!/usr/bin/perl
3 #Wed Sep 1 18:54:18 EDT 2004
4 #Simon Ilyushchenko - demonstrating several new glyphs for gbrowse, part 2.
6 use strict;
8 use Bio::Graphics::Panel;
10 =head1 NAME
12 bp_glyphs2-demo.pl - Second demo of Bio::Graphics glyphs
14 =head1 SYNOPSIS
16 % bp_glyphs2-demo.pl | display -
18 =head1 DESCRIPTION
20 Generates a PNG image of some of the more esoteric Bio::Graphics glyphs.
22 =head1 SEE ALSO
24 L<Bio::Graphics>, the BioGraphics HOWTO.
26 =head1 AUTHOR
28 Simon Ilyushchenko
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.
36 =cut
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(
43 -grid => 1,
44 -segment => $segment,
45 -key_style => 'bottom');
47 $subseg1->name('dumbbell - arrows with arc ');
49 $panel->add_track(segments=>[$subseg1],
50 -label => 1,
51 -width => 50,
52 -height => 30,
53 -arc => 1,
54 -shape_size => 20,
55 -fgcolor => 'crimson',
56 -end_shape => "arrow",
57 -glyph => 'dumbbell');
59 $subseg1->name('dumbbell - wave ');
61 $panel->add_track(segments=>[$subseg1],
62 -label => 1,
63 -shape_size => 20,
64 -end_shape => "wave",
65 -height => 20,
66 -fgcolor => 'green',
67 -glyph => 'dumbbell');
69 $subseg1->name('two bolts');
71 $panel->add_track(segments=>[$subseg1],
72 -label => 1,
73 -shape_size => 40,
74 -bolt_color => 'violet',
75 -height => 20,
76 -glyph => 'two_bolts');
78 $subseg1->name('wave');
80 $panel->add_track(segments=>[$subseg1],
81 -label => 1,
82 -height => 10,
83 -circle => 1,
84 -glyph => 'wave');
86 $subseg1->name('broken line');
88 $panel->add_track(segments=>[$subseg1],
89 -label => 1,
90 -height => 20,
91 -glyph => 'broken_line');
93 $subseg1->name('tic_tac_toe');
95 $panel->add_track(segments=>[$subseg1],
96 -label => 1,
97 -height => 20,
98 -glyph => 'tic_tac_toe');
100 $subseg1->name('text_in_box');
102 $panel->add_track(segments=>[$subseg1],
103 -label => 1,
104 -height => 20,
105 -text_bgcolor => 'yellow',
106 -glyph => 'text_in_box');
109 $subseg1->name('christmas arrow');
111 $panel->add_track(segments=>[$subseg1],
112 -label => 1,
113 -height => 20,
114 -fgcolor => 'steelblue',
115 -glyph => 'christmas_arrow');
118 $subseg1->name('pentagram');
120 $panel->add_track(segments=>[$subseg1],
121 -label => 1,
122 -height => 20,
123 -glyph => 'pentagram');
126 $subseg1->name('weighted arrow');
128 $panel->add_track(segments=>[$subseg1],
129 -label => 1,
130 -height => 20,
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;
138 close OUT;