[Bioperl-l] Fwd: Re: SOLVED Bio::Graphics::Panel make ruler have neg values

Lincoln Stein lstein at cshl.edu
Wed May 31 16:05:47 UTC 2006


Oddly, bioperl-l listserver is holding this mail because it has "a suspicious 
header". I took out Kevin's email address in case it is the "spammotel" 
header that is bothering it.

Lincoln

----------  Forwarded Message  ----------

Subject: Re: [Bioperl-l] SOLVED Bio::Graphics::Panel make ruler have neg 
values
Date: Wednesday 31 May 2006 11:17
From: Lincoln Stein <lstein at cshl.edu>
To: bioperl-l at lists.open-bio.org
Cc: "Kevin Lam Koiyau" <ULNJUJERYDIX at spammotel.com>

Hi Kevin,

Since you are modifying the Panel.pm source code, why don't you just go ahead
and use the current Bio::Graphics development tree? Since 1.5.1 it supports
negative coordinates. Here's an illustration:

 #!/usr/bin/perl

 use strict;

 use Bio::Graphics;
 use Bio::Graphics::Feature;

 my $whole   = Bio::Graphics::Feature->new(-start=>-200,-end=>+200);
 my $feature =
Bio::Graphics::Feature->new(-start=>-100,-end=>+100,-strand=>+1);
 my $panel   = Bio::Graphics::Panel->new(-start=> -200,
					 -end  => +200,
					 -width=>800,
					 -pad_left=>10,
					 -pad_right=>10);
 $panel->add_track($whole,
		   -glyph=>'arrow',
		   -double=>1,
		   -tick=>2);
 $panel->add_track($feature,
	 	  -glyph=>'box',
		   -stranded=>1);
 print $panel->png;

 exit 0;

The resulting image is attached.

Lincoln

On Tuesday 30 May 2006 23:45, Kevin Lam Koiyau wrote:
> I am so sorry for the truncated email accidentally hit reply.
> if anyone is interested i have opted to change
>
> change line 161 of arrow.pm in Perl/site/lib/Bio/Graphics/Glyph/arrow.pm
> in linux its
> /usr/lib/perl5/site_perl/5.8.5/Bio/Graphics/Glyph/arrow.pm
>
>
>       $gd->string($font,$middle,$center+$a2-1,$label,$font_color)
>
> to
>
>       $gd->string($font,$middle,$center+$a2-1,$label-1000,$font_color)
>
> just  for this one-off use.
>
>
>
> strangely I found at line 112 for ver 1.51 bioperl in arrow.pm a hidden
> option for coords offset?
>     my $relative_coords_offset = $self->option('relative_coords_offset');
>     $relative_coords_offset    = 1 unless defined $relative_coords_offset;
> but entering the option -relative_coords_offset=>1000 in the arrow glyphs
> didn't do anything...
>
>
>
> Hi!
>
> > oh it was in a slightly different header asking about the create image
> > map feature.
> > I am using the stable version 1.4 of bioperl now. In any case I have not
> > added the sequence as a feature annotated seq. as I already have the bp
> > where the TF binds (in 1-1050 numberings) so what I did was to just add
> > graded segments based on the position.
> > I saw that there is a scale function for the arrow glyp however, it is a
> > multiply function, can it be hacked to take in a offset value (ie minus
> > the
> > scale by 1000?)
> >
> > cheers
> > kevin
> >
> >
> > Hi,
> >
> > > For some reason I didn't see the first posting on this. In current
> >
> > bioperl
> >
> > > live, the ruler can have negative numberings - I use this routinely.
> > > You need
> > > to create a feature that starts in negative coordinates. What is
> >
> > happening
> >
> > > to
> > > you when you try this?
> > >
> > > Lincoln
> > >
> > > On Wednesday 24 May 2006 21:59, Kevin Lam Koiyau wrote:
> > > > Hi
> > > > thanks for the help offered thus far!
> > > > sigh I am trying to annotate TFBS on a -1000 to +50 bp promtoer seq
> > >
> > > using
> > >
> > > > bioperl. therefore i was asked to make the numberings as such (-1000)
> >
> > is
> >
> > > > there any way at all to do this in bioperl without changing the .pm
> > >
> > > file?
> > >
> > > > thanks guys..
> > > > kevin
> > > >
> > > > _______________________________________________
> > > > Bioperl-l mailing list
> > > > Bioperl-l at lists.open-bio.org
> > > > http://lists.open-bio.org/mailman/listinfo/bioperl-l
> > >
> > > --
> > > Lincoln D. Stein
> > > Cold Spring Harbor Laboratory
> > > 1 Bungtown Road
> > > Cold Spring Harbor, NY 11724
> > > (516) 367-8380 (voice)
> > > (516) 367-8389 (fax)
> > > FOR URGENT MESSAGES & SCHEDULING,
> > > PLEASE CONTACT MY ASSISTANT,
> > > SANDRA MICHELSEN, AT michelse at cshl.edu
> > > _______________________________________________
> > > Bioperl-l mailing list
> > > Bioperl-l at lists.open-bio.org
> > > http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING,
PLEASE CONTACT MY ASSISTANT,
SANDRA MICHELSEN, AT michelse at cshl.edu

-------------------------------------------------------

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING, 
PLEASE CONTACT MY ASSISTANT, 
SANDRA MICHELSEN, AT michelse at cshl.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: negatives.png
Type: image/png
Size: 1065 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20060531/6c5f4137/attachment-0004.png>


More information about the Bioperl-l mailing list