[Bioperl-l] Scale with Bio::Grahics for upstream regions

Lincoln Stein lstein at cshl.org
Mon May 12 11:35:41 EDT 2003


This might be solved by updating to the latest CVS version.  When I try with 
the latest version, this script works as expected:

#!/usr/bin/perl

use strict;
use Bio::Graphics;
use Bio::SeqFeature::Generic;

my $Generic = 'Bio::SeqFeature::Generic';  # to reduce typing

# create a few features using Bio::SeqFeature::Generic
my $whole_region = $Generic->new(-start=>-5000,   
							-end=>10000,-display_name=>'whole');
my $red0         = $Generic->new(-start=>-3000, -end=>-2000, 
						-display_name=>'red0' );
my $red1         = $Generic->new(-start=>100, -end=>5000, 
						-display_name=>'red1' );
my $red2         = $Generic->new(-start=>4000,-end=>9000, 
			-display_name=>'red2' );

my $blue1        = 
$Generic->new(-start=>5000,-end=>9000,-display_name=>'blue1');
$blue1->add_SeqFeature($Generic->new(-start=>5000,-end=>6000));
$blue1->add_SeqFeature($Generic->new(-start=>7000,-end=>7500));
$blue1->add_SeqFeature($Generic->new(-start=>8000,-end=>9000));

my $panel = Bio::Graphics::Panel->new(-segment=>$whole_region,-width=>800);
$panel->add_track($whole_region,
		  -glyph  => 'arrow',
		  -double => 1,
		  -tick   => 2);

$panel->add_track([$red0,$red1,$red2],
		  -glyph   => 'segments',
		  -label   => 1,
		  -bgcolor => 'red');

$panel->add_track($blue1,
		  -glyph   => 'segments',
		  -label   => 1,
		  -bgcolor => 'blue');

print $panel->png;

Lincoln


On Saturday 03 May 2003 06:20 pm, Joao Magalhaes wrote:
> Hi!
>
> I'm using Bio::Graphics to display putative transcription factor binding
> sites upstream of the ORF. My problem is that I need to show negative
> values in regard to the distance to the ORF. How can I draw a scale with
> negative values? For the moment I draw a scale like this:
>
> my $full_length = Bio::SeqFeature::Generic->new(-start=>1,-end=>1000,
> -seq_id=>"$query");
> $panel->add_track($full_length,
>                  -glyph   => 'arrow',
>                  -tick    => 1,
>                  -fgcolor => 'black',
>                  );
>
> But I want start to be "-1000" and end "-1". Only if I put negative values,
> the scale disappears. Any suggestions?
>
> Thanks.
>
>
> Joao Magalhaes (joao.magalhaes at fundp.ac.be)
>
> Website on Aging: http://www.senescence.info
> Reason's Triumph: http://www.jpreason.com
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://pw600a.bioperl.org/mailman/listinfo/bioperl-l

-- 
Lincoln Stein
lstein at cshl.org
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redandblue.png
Type: image/png
Size: 1509 bytes
Desc: not available
Url : http://pw600a.bioperl.org/pipermail/bioperl-l/attachments/20030512/040950dc/redandblue-0001.png


More information about the Bioperl-l mailing list