This glyph was designed to show P-element insertions in the Drosophila
genome, but in fact is suitable for any type of zero-width feature.
Also see the triangle glyph.
In addition to the generic options, this glyph recognizes:
Option Name Description Default
----------- ----------- -------
-insertion_width Width of glyph in pixels 3
None available.
sub box
{ my $self = shift;
my $half = $self->insertion_width/2; return ($self->left-$half,$self->top,$self->right+$half,$self->bottom); } |
sub draw
{ my $self = shift;
my $gd = shift;
my ($left,$top) = @_;
my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
my $height = $self->height;
my $half = $self->insertion_width/2;
my $fill = $self->bgcolor;
my $poly = GD::Polygon->new;
if ($self->feature->strand > 0) { $poly->addPt($x1 - $half, $y1);
$poly->addPt($x1 + ($half), $y1);
$poly->addPt($x1, $y2); } else {
$poly->addPt($x1, $y1); $poly->addPt($x1 - $half, $y2);
$poly->addPt($x1 + ($half), $y2);
}
$gd->filledPolygon($poly, $fill);
$gd->polygon($poly, $fill);
$self->draw_label($gd,$left,$top) if $self->option('label');
$self->draw_description($gd,$left,$top) if $self->option('description');
}
1; } |
Please report them.