[Bioperl-l] Display of gff annotation

Marco Blanchette mblanche at berkeley.edu
Sat Apr 8 01:54:21 UTC 2006


Dear all--

I have a gff annotation in the form of:

##gff-version 2
# seqname    source    feature    start    end    score    strand    frame
attributes
AF260530 (    -    exon    262    693    .    +    .    note "1"
AF260530 (    -    exon    4450    4630    .    +    .    note "2"
AF260530 (    -    exon    13432    13776    .    +    .    note "3"
AF260530 (    -    exon    15198    15359    .    +    .    note "4.1"
AF260530 (    -    exon    15537    15698    .    +    .    note "4.2"
AF260530 (    -    exon    16060    16221    .    +    .    note "4.3"
AF260530 (    -    exon    16682    16852    .    +    .    note "4.4"
AF260530 (    -    exon    16985    17146    .    +    .    note "4.5"
AF260530 (    -    exon    16985    17146    .    +    .    note "5"


Where the value of the tag 'note' is the exon name. all exons with a decimal
annotation are alternatively spliced exon. My goal would be to display the
alternative exons in a different color (let say red) than the constitutive
exons (let say blue).

I have this script:
#!/usr/bin/perl

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


my $gffio = Bio::Tools::GFF->new(-file => $ARGV[0],
                                 -gff_version => 2,
                                );

my $feat_o = Bio::SeqFeature::Generic->new(-name => 'aGene');

while (my $feature = $gffio->next_feature) {
        $feat_o->add_SeqFeature($feature,'EXPAND');
}

my $panel = Bio::Graphics::Panel->new(
                  -length => $feat_o->end,
                  -width  => 1500,
                  -pad_left => 10,
                  -pad_right => 10,
                 );

my $full_length = Bio::SeqFeature::Generic->new(-start=>1,
                                                -end=>$feat_o->end);

$panel->add_track($full_length,
          -glyph   => 'arrow',
          -tick    => 2,
          -fgcolor => 'black',
          -double  => 1,
                        );

$panel->add_track($feat_o,
                    -glyph=> 'segments');
print $panel->png


That does almost what I need. My questions are:
1) is there a better way to transform the GFF file into a SeqFeature object
than the while loop that I am using

2) How could I tell the Bio::Graphics::Panel object to color the exon with a
'.' in red and the others in blue.

Many thanks all

Marco



Marco Blanchette, Ph.D.

mblanche at berkeley.edu

Donald C. Rio's lab
Department of Molecular and Cell Biology
16 Barker Hall
University of California
Berkeley, CA 94720-3204

Tel: (510) 642-1084
Cell: (510) 847-0996
Fax: (510) 642-6062








More information about the Bioperl-l mailing list