1
package Bio::Graphics::Glyph::transcript;
2
# $Id: transcript.pm,v 1.23.4.1 2006/10/02 23:10:20 sendu Exp $
5
use base qw(Bio::Graphics::Glyph::segments);
9
return 0 unless $self->{level} == 0;
10
my $pad = $self->SUPER::pad_left;
11
my $strand = $self->feature->strand;
12
return $pad unless defined $strand && $strand < 0;
13
return $self->arrow_length > $pad ? $self->arrow_length : $pad;
18
return 0 unless $self->{level} == 0;
19
my $pad = $self->SUPER::pad_right;
20
my $strand = $self->feature->strand;
21
return $pad unless defined($strand) && $strand > 0;
22
return $self->arrow_length > $pad ? $self->arrow_length : $pad;
27
return unless $self->level > 0;
28
$self->SUPER::draw_component(@_);
31
sub part_label_merge {
33
my $label = $self->SUPER::part_label_merge;
34
return $label if defined $label;
43
$self->SUPER::draw_connectors($gd,$left,$top);
44
my @parts = $self->parts; # or return;
46
# H'mmm. No parts. Must be in an intron, so draw intron
47
# spanning entire range
49
return unless $self->feature_has_subparts;
50
my($x1,$y1,$x2,$y2) = $self->bounds(0,0);
51
$self->_connector($gd,$left,$top,$x1,$y1,$x1,$y2,$x2,$y1,$x2,$y2);
55
# flip argument makes this confusing
56
# certainly there's a simpler way to express this idea
57
my $strand = $self->feature->strand;
58
my ($first,$last) = ($parts[0],$parts[-1]);
60
($first,$last) = ($last,$first) if exists $self->{flip};
63
my($x1,$y1,$x2,$y2) = $last->bounds(@_);
64
my $center = ($y2+$y1)/2;
66
$self->arrow($gd,$x1,$x1-$self->arrow_length,$center)
68
$self->arrow($gd,$x2,$x2+$self->arrow_length,$center);
72
my($x1,$y1,$x2,$y2) = $first->bounds(@_);
73
my $center = ($y2+$y1)/2;
75
$self->arrow($gd,$x2,$x2+$self->arrow_length,$center)
77
$self->arrow($gd,$x1,$x1 - $self->arrow_length,$center);
83
return $self->option('arrow_length') || 8;
86
# override option() for force the "hat" type of connector
89
return $self->SUPER::connector(@_) if $self->all_callbacks;
90
return ($self->option('connector') || 'hat');
100
Bio::Graphics::Glyph::transcript - The "transcript" glyph
104
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
108
This glyph is used for drawing transcripts. It is essentially a
109
"segments" glyph in which the connecting segments are hats. The
110
direction of the transcript is indicated by an arrow attached to the
115
The following options are standard among all Glyphs. See
116
L<Bio::Graphics::Glyph> for a full explanation.
118
Option Description Default
119
------ ----------- -------
121
-fgcolor Foreground color black
123
-outlinecolor Synonym for -fgcolor
125
-bgcolor Background color turquoise
127
-fillcolor Synonym for -bgcolor
129
-linewidth Line width 1
131
-height Height of glyph 10
133
-font Glyph font gdSmallFont
135
-connector Connector type 0 (false)
138
Connector color black
140
-label Whether to draw a label 0 (false)
142
-description Whether to draw a description 0 (false)
144
-hilite Highlight color undef (no color)
146
In addition, the alignment glyph recognizes the following
147
glyph-specific options:
149
Option Description Default
150
------ ----------- -------
152
-arrow_length Length of the directional 8
162
L<Bio::Graphics::Panel>,
163
L<Bio::Graphics::Glyph>,
164
L<Bio::Graphics::Glyph::arrow>,
165
L<Bio::Graphics::Glyph::cds>,
166
L<Bio::Graphics::Glyph::crossbox>,
167
L<Bio::Graphics::Glyph::diamond>,
168
L<Bio::Graphics::Glyph::dna>,
169
L<Bio::Graphics::Glyph::dot>,
170
L<Bio::Graphics::Glyph::ellipse>,
171
L<Bio::Graphics::Glyph::extending_arrow>,
172
L<Bio::Graphics::Glyph::generic>,
173
L<Bio::Graphics::Glyph::graded_segments>,
174
L<Bio::Graphics::Glyph::heterogeneous_segments>,
175
L<Bio::Graphics::Glyph::line>,
176
L<Bio::Graphics::Glyph::pinsertion>,
177
L<Bio::Graphics::Glyph::primers>,
178
L<Bio::Graphics::Glyph::rndrect>,
179
L<Bio::Graphics::Glyph::segments>,
180
L<Bio::Graphics::Glyph::ruler_arrow>,
181
L<Bio::Graphics::Glyph::toomany>,
182
L<Bio::Graphics::Glyph::transcript>,
183
L<Bio::Graphics::Glyph::transcript2>,
184
L<Bio::Graphics::Glyph::translation>,
185
L<Bio::Graphics::Glyph::triangle>,
194
Lincoln Stein E<lt>lstein@cshl.orgE<gt>
196
Copyright (c) 2001 Cold Spring Harbor Laboratory
198
This library is free software; you can redistribute it and/or modify
199
it under the same terms as Perl itself. See DISCLAIMER.txt for
200
disclaimers of warranty.