AcePerl
view release on metacpan or search on metacpan
Ace/Graphics/Glyph/transcript.pm view on Meta::CPAN
if ($draw_arrow && @exon_boxes) {
# draw little arrows to indicate direction of transcription
# plus strand is to the right
my $a2 = ARROW/2;
if ($self->feature->strand > 0) {
my $s = $exon_boxes[-1][1];
$gd->line($s,$center,$s + ARROW,$center,$fg);
$gd->line($s+ARROW,$center,$s+$a2,$center-$a2,$fg);
$gd->line($s+ARROW,$center,$s+$a2,$center+$a2,$fg);
} else {
my $s = $exon_boxes[0][0];
$gd->line($s,$center,$s - ARROW,$center,$fg);
$gd->line($s - ARROW,$center,$s-$a2,$center-$a2,$fg);
$gd->line($s - ARROW,$center,$s-$a2,$center+$a2,$fg);
}
}
# draw label
if ($self->option('label')) {
$self->draw_label($gd,@_);
# draw description
if (my $d = $self->description) {
$gd->string($self->font,$x1,$y2,$d,$fontcolor);
}
}
}
sub description {
my $self = shift;
my $t = $self->feature->info;
return unless ref $t;
my $id = $t->Brief_identification;
my $comment = $t->Locus;
$comment .= $comment ? " ($id)" : $id if $id;
$comment;
}
1;
__END__
=head1 NAME
Ace::Graphics::Glyph::transcript - The "gene" glyph
=head1 SYNOPSIS
See L<Ace::Graphics::Panel> and L<Ace::Graphics::Glyph>.
=head1 DESCRIPTION
This glyph draws a series of filled rectangles connected by up-angled
connectors or "hats". The rectangles indicate exons; the hats are
introns. The direction of transcription is indicated by a small arrow
at the end of the glyph, rightward for the + strand.
The feature must respond to the exons() and optionally introns()
methods, or it will default to the generic display. Implied introns
(not returned by the introns() method) are drawn in a contrasting
color to explicit introns.
=head2 OPTIONS
In addition to the common options, the following glyph-specific
option is recognized:
Option Description Default
------ ----------- -------
-implied_intron_color The color to use for gaps gray
not returned by the introns()
method.
-draw_arrow Whether to draw arrowhead true
indicating direction of
transcription.
=head1 BUGS
Please report them.
=head1 SEE ALSO
L<Ace::Sequence>, L<Ace::Sequence::Feature>, L<Ace::Graphics::Panel>,
L<Ace::Graphics::Track>, L<Ace::Graphics::Glyph::anchored_arrow>,
L<Ace::Graphics::Glyph::arrow>,
L<Ace::Graphics::Glyph::box>,
L<Ace::Graphics::Glyph::primers>,
L<Ace::Graphics::Glyph::segments>,
L<Ace::Graphics::Glyph::toomany>,
L<Ace::Graphics::Glyph::transcript>,
=head1 AUTHOR
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2001 Cold Spring Harbor Laboratory
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. See DISCLAIMER.txt for
disclaimers of warranty.
=cut
( run in 0.501 second using v1.01-cache-2.11-cpan-39bf76dae61 )