[Bioperl-l] Problem with Graphics

Iain Wallace iain.m.wallace at gmail.com
Wed Dec 14 10:59:17 EST 2005


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;



More information about the Bioperl-l mailing list