Skip Menu |

This queue is for tickets about the Bio-Graphics CPAN distribution.

Report information
The Basics
Id: 60151
Status: new
Priority: 0/
Queue: Bio-Graphics

People
Owner: Nobody in particular
Requestors: wra [...] umd.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: wiggle glyphs xyplot and box are not responding to flip
Date: Fri, 6 Aug 2010 15:06:34 -0400
To: <bug-Bio-Graphics [...] rt.cpan.org>
From: Ray Anderson <wra [...] umd.edu>
I found this bug in Bio::Graphics v2.11, but it doesn't look new. The wiggle_xyplot and wiggle_box glyphs are not responding to the flip status and so are drawn incorrectly when the other features are flipped. note: this is not a bug in the wiggle_density glyph (so my fix is based on that code)

Message body is not shown because sender requested not to inline it.

From: wra [...] umd.edu
The offset for wiggle_xyplot was to far to the left. This diff file should replace the original diff file.
Subject: wiggleFlip.diff
diff -c Glyph.sav/wiggle_box.pm Glyph/wiggle_box.pm *** Glyph.sav/wiggle_box.pm 2010-08-06 13:50:13.447650560 -0400 --- Glyph/wiggle_box.pm 2010-08-06 13:59:32.461648206 -0400 *************** *** 213,218 **** --- 213,219 ---- my $pixels_per_datapoint = $self->panel->width/@$data * $data_width_ratio; my $xstart; + @$data = reverse @$data if $self->flip; for (my $i = 0; $i <= @$data ; $i++) { $xstart ||= $x1 + $pixels_per_datapoint * $i if $data->[$i]; # trigger to draw the previous box is empty space of the end of the stack diff -c Glyph.sav/wiggle_xyplot.pm Glyph/wiggle_xyplot.pm *** Glyph.sav/wiggle_xyplot.pm 2010-08-06 13:50:13.445650640 -0400 --- Glyph/wiggle_xyplot.pm 2010-08-06 13:42:08.636898264 -0400 *************** *** 242,247 **** --- 242,248 ---- my ($start,$end,$score) = @$_; my $x1 = $left + ($start - $f_start) * $x_scale; my $x2 = $left + ($end - $f_start) * $x_scale; + if ($x2 >= $left and $x1 <= $right) { my $y1 = $bottom - ($score - $min_score) * $y_scale; my $y2 = $y_origin; *************** *** 249,254 **** --- 250,256 ---- $y1 = $bottom if $y1 > $bottom; $x1 = $left if $x1 < $left; $x2 = $right if $x2 > $right; + ($x1,$x2) = ($right + $left - $x1,$right + $left - $x2) if $self->flip; my $color = $score > $midpoint ? $positive : $negative; [int($x1+0.5),int($y1+0.5),int($x2+0.5),int($y2+0.5),$color,$lw];