[Bioperl-l] Bio::Graphics segments problem

Lincoln Stein lstein at cshl.edu
Sat Oct 4 14:18:54 EDT 2003


Hi,

I know it looks weird, but a Bio::Graphics now defines the 1..2 as:

	1-------2-------3
        =========

That is, the width of the line will be exactly two units long.  The position 
of the dimensionless coordinate is to the left of the graphic.  In graphics 
terminology it is a "half open interval".  I know you would prefer this:

	1------2-------3
        =====

But this causes visual anomalies at high magnifications when the sequence is 
shown:

	0------1-----2------3
         A   GC?

I am willing to consider this alternative:

	0-----1------2------3
            ========

but it might be troublesome.

Lincoln

On Monday 29 September 2003 03:26 pm, Vamsi wrote:
> use Bio::Graphics::Panel;
> use Bio::SeqFeature::Generic;
>
> my $length = 100;
> my $seq = Bio::SeqFeature::Generic->new(-start => 1,
>                                         -end => $length);
>
> my $p = new Bio::Graphics::Panel(
>                                  -length => $length,
>                                  -width => 800,
>                                  );
> $p->add_track($seq,
>               -glyph => 'arrow',
>               -tick => 2,
>               -double => 1,
>               );
>
> #$p->add_track(segments => [[1,40],[61,90]]);
> my $g = $p->add_track();
> $g->add_group([[1,40],[61,90]]);
>
> open(F, '>b.png');
> binmode F;
> print F $p->png();
> close F;

-- 
Lincoln Stein
lstein at cshl.edu
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)


More information about the Bioperl-l mailing list