Raw content of Bio::Graphics::Glyph::splice_site
package Bio::Graphics::Glyph::splice_site;
use strict;
use vars '@ISA';
@ISA = 'Bio::Graphics::Glyph::generic';
use Bio::Graphics::Glyph::generic;
use constant PWIDTH => 3;
sub draw_component {
my $self = shift;
my $gd = shift;
my ($left,$top) = @_;
my($x1,$y1,$x2,$y2) = $self->bounds(@_);
my $center = int(0.5+($x1+$x2)/2);
my $direction = $self->option('direction');
my $height = $y2 - $y1;
my $fraction = $self->option('height_fraction') || 1.0;
my $bottom = $y2;
$top = $y2 - $fraction * $height;
# draw the base
my $fgcolor = $self->fgcolor;
$gd->line($center,$bottom,$center,$top,$fgcolor);
if ($direction eq 'right') {
$gd->line($center,$top,$center + PWIDTH,$top,$fgcolor);
} elsif ($direction eq 'left') {
$gd->line($center,$top,$center - PWIDTH,$top,$fgcolor);
}
}
1;
=head1 NAME
Bio::Graphics::Glyph::splice_site - The "splice_site" glyph
=head1 SYNOPSIS
See L and L.
=head1 DESCRIPTION
This glyph was designed to show an inverted "L" representing splice
donors and acceptors. The vertical part of the L points downwards and
is positioned in the center of the range (even if the range is quite
large).
In addition to the usual glyph options, this glyph recognizes:
Option Value Description
------ ----- -----------
direction "left" or "right" direction the short part of the L
points
height_fraction 0.0 - 1.0 fractional height of the glyph,
usually a callback that uses the
feature's score to determine its
height
=head1 BUGS
Please report them.
=head1 SEE ALSO
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L,
L
=head1 AUTHOR
Xiaokang Pan Epan@cshl.orgE
Copyright (c) 2001 BDGP
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