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

Lincoln Stein lstein at cshl.edu
Mon May 23 13:10:41 EDT 2005


The horizontal scale should be drawn at position 0, or at the top or bottom of 
the plot area if zero is outside the area entirely.  I'm not sure what you 
mean about the horizontal line being drawn in its own subroutine outside the 
glyph.  Some glyphs have horizontal components, and others don't, so I must 
be misunderstanding you.

Lincoln


On Tuesday 19 April 2005 01:04 pm, Albert Vilella wrote:
> (below)
>
> > > 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
> positions
>   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,
>
> Bests,
>
>     Albert.
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724


More information about the Bioperl-l mailing list