#!/usr/bin/perl
use Bio::DB::GFF;
use Bio::Graphics::Panel;
use strict;

my $filin  = $ARGV[0];
my $db = Bio::DB::GFF->new( -dsn => $filin,-adaptor => 'memory',
                            -aggregator => 'at{atpc:atfreq}' );
my $segment  = $db->segment('chr1');
my @features = $segment->features('at');
my $panel = Bio::Graphics::Panel->new(
       -offset    => 0, -grid    => 100,                                
       -length    => 500, -width     => 800,
       -pad_left  => 50, -pad_right => 50 );
$panel->add_track($segment, -glyph   => 'generic', 
                           -bgcolor => 'blue', -label   => 1);                                     
$panel->add_track(\@features,
                    -glyph => 'xyplot',
                    -graph_type=>'boxes',
                    -scale=>'left',
                    -height=>200,
 );
open (FI,"> sal.png");
print FI $panel->png;
close FI;
exit();
