[Bioperl-l] help with PHRAP assembly & Bio::Graphics

Crabtree, Jonathan crabtree at tigr.org
Wed Jan 19 10:22:24 EST 2005


Mariano-

I just realized that I got the sign wrong (again!).  You'll want to set -offset to a *negative* number, not a positive number.  For example:

#!/usr/bin/perl

use Bio::Graphics::Panel;
use Bio::SeqFeature::Generic;

my $panel = Bio::Graphics::Panel->new(-length=> 1000, -offset=> -100, -width=> 600);

my $scale = Bio::SeqFeature::Generic->new(-start => -75, -end => 100);
$panel->add_track($scale, 
		  -glyph => 'anchored_arrow',
		  -tick => 2,
		  -fontcolor => '#3d5315',
		  -fgcolor => '#3d5315',
		  -bgcolor => '#e3ffb7',
		  );

my $gd =  $panel->gd();
print $gd->png();



-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org on behalf of Crabtree, Jonathan
Sent: Wed 1/19/2005 10:07 AM
To: malatorr at genoma.ciencias.uchile.cl; bioperl-l at bioperl.org
Subject: RE: [Bioperl-l] help with PHRAP assembly & Bio::Graphics
 

Mariano-

You should be able to use negative coordinates by setting the -offset
parameter (to the absolute value of the smallest negative coordinate
that you want to use in your image) when you call Panel->new().  Someone
else asked about this a few months ago and reported that this solution
worked for them:

http://bioperl.org/pipermail/bioperl-l/2004-July/016538.html

Jonathan


> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org 
> [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of 
> Mariano Latorre A
> Sent: Wednesday, January 19, 2005 8:57 AM
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] help with PHRAP assembly & Bio::Graphics
> 
> 
> Hi!
> 
> I'm developing a bioperl cgi to show a png PHRAP assembly 
> using Bio::Graphics + perl cgi.
> 
> The problem is that the Contig deffines the zero position and 
> usually the alignment ESTs are located before the contig. 
> This implies I need to use negative positions...but 
> Bio::graphics doesn't allow to use negative positions...it 
> just cuts them off.
> 
> PD: I paste my source code.
> -- 
> Mariano Latorre A <malatorr at genoma.ciencias.uchile.cl>
> Universidad de Chile
> 
> ##############################################################
> ########################
> #THE CGI "render.pl"
> 
> #!/usr/bin/perl
> 
> 
> use CGI;
> use lib "$ENV{HOME}/projects/bioperl-live";
> use Bio::Graphics;
> use Bio::SeqFeature::Generic;
> 
> my $form = new CGI;
> print "Content-type: image/png\n\n";
> 
> my $panel = Bio::Graphics::Panel->new(-length => 2000,-width  
> => 1800, - pad_left => 10, -pad_right => 10,);
> 
> my $full_length = Bio::SeqFeature::Generic->new(-start=>$form->param
> ("start"),-end=>$form->param("end"));
> 
> $panel->add_track($full_length,
>                   -glyph   => 'arrow',
>                   -tick    => 2,
>                   -fgcolor => 'black',
>                   -double  => 1,
>                  );
> 
> my $track = $panel->add_track(-glyph => 'graded_segments',
>                               -label  => 1,
>                               -bgcolor => 'blue',
>                               -min_score => -200,
>                               -max_score => 1000);
> 
> 
> for($i=1;defined($form->param("est$i"));$i++){
>   my($name,$score,$start,$end) = split /\@/,$form->param("est$i");
>   my $feature = Bio::SeqFeature::Generic->new(-display_name=>$name,
>             -score=>$score,
>             -start=>$start,
>             -end=>$end);
>   $track->add_feature($feature);
> }
> print $panel->png;
> 
> 
> ##############################################################
> ########################
> # The Url to call the CGI
> render.pl? 
> est1=hola at 300@-200 at 367@&est2=chau at 50@300 at 600@&est3=nada at 50@310
> @25@&start=1&end=800
> 
> ##############################################################
> ########################
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org 
> http://portal.open-> bio.org/mailman/listinfo/bioperl-l
> 

_______________________________________________
Bioperl-l mailing list
Bioperl-l at portal.open-bio.org
http://portal.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list