[Bioperl-l] Problem with Graphics

Jason Stajich jason.stajich at duke.edu
Wed Dec 14 14:42:34 EST 2005


Are you on windows?

Try adding this before calling print.
binmode (STDOUT);

On Dec 14, 2005, at 10:59 AM, Iain Wallace wrote:

> Hi,
>
> I am trying to use the Bio::Graphics module, but am unable to view my
> output file. When I try to view the file I am told the file is
> corrupt.
>
> Below is the code that I tried and it seems to work (i.e. it doesn't
> crash and generates an output file)
>
> Unfortunately I have no idea what the error could be.
> Any help/pointers would be greatly appreciated
>
> Thanks
>
> Iain
> ---- Code from the How To ---
>
> #!/usr/bin/perl
>
>     use strict;
>
>     use Bio::Graphics;
>     use Bio::SeqFeature::Generic;
>
>   my $panel = Bio::Graphics::Panel->new(-length => 1000,-width  =>  
> 800);
>     my $track = $panel->add_track(-glyph => 'generic',-label  => 1);
>
>     while (<>) { # read blast file
>       chomp;
>       next if /^\#/;  # ignore comments
>      my($name,$score,$start,$end) = split /\t+/;
>      my $feature =
> Bio::SeqFeature::Generic->new(-display_name=>$name,-score=>$score,
>                                                  -start=>$start,- 
> end=>$end);
>      $track->add_feature($feature);
>    }
>
>    print $panel->png;
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
Duke University
http://www.duke.edu/~jes12




More information about the Bioperl-l mailing list