[Bioperl-l] help needed Was:Re: [Gmod-gbrowse] negative numbers in xyplot

Albert Vilella avilella at gmail.com
Tue Apr 19 13:04:52 EDT 2005


> > I submitted a feature request some minutes ago to GBrowse about
> > negative numbers in xyplot, but then, scanning a little bit through
> > the mailing list, I understood that this seems to be
> > Bio::Graphics::xyplot.pm related, not GBrowse. I resubmitted (now
> > logged in) as Bio::Graphics related.

> Well, the same group of people work on gbrowse and the bioperl glyphs, 
> so either way your bug report is most appreciated.  Would someone on 
> the mailing list like to volunteer to fix this bug?  It should be a 
> very simple one to handle.  Maybe you can implement log coordiantes 
> as well?

This "negative values in xyplot" feature seems to be stuck in the "TO
DO" list, so I took a look at the code to see if I could implement this
feature myself. 

After messing around a little bit with the code, I could more or less
localize the place where this feature should be added, but there are a
couple of places where I need some help:

In xyplot.pm draw function:
# now seed all the parts with the information they need to draw their
  foreach (@parts) {
    my $s = eval {$_->feature->score};
    next unless defined $s;
    my $position      = ($s-$min_score) * $scale;
    $_->{_y_position} = $bottom - $position;

Right now, "$bottom" will always point to the bottom the plot, where the
horizontal line of the xyplot graphic will be placed latter, even if $s
is negative. This results in negative numbers being wrongly positioned
as score=0.

So I understand that the horizontal line should be placed according to
the presence or absence of negative numbers.

What I couldn't find why was the horizontal lines are plotted inside
each type of graphic (_draw_histogram, _draw_boxes, _draw_line,
_draw_points), instead of outside, in its own subroutine. Is this so or
am I missing a point?

Then for negative numbers, my question would be: Where should the
horizontal line be set?

Finally, about the log coordinates scale Lincoln suggested, I visualize
this as substituting $scale comparisons for a call to some log_scale
subroutine that will re-place each value log-wise. 
Is that correct?

Thanks in advance,



More information about the Bioperl-l mailing list