[Bioperl-l] <no subject>

Marco Blanchette mblanche at berkeley.edu
Mon Mar 6 05:02:14 UTC 2006


Dear all--

I am trying to forge my first bioperl weapons with the
Bio::DB::GFF and Bio::Graphics modules. My goal is to display genes with
their underlying mRNAs and later on add addition useful info (ie binding
site for our preferred proteins).

I loaded the GadFly gff3 annotation in a mysql database using
bulk_load_gff.pl and I am trying to pass a Bio::SeqFeatureI to the
Bio::Graphics::add_feature method.

My understanding is that:
my $tcs = $tg->features(-types =>'processed_transcript',
                                        -attributes => {Parent => $gene},
                                        -iterator => 1);

Produces a Bio::SeqIO object that can be iterate through the next_seq method
to get a Bio::Seq object that could be used to extract a Bio::SeqFeatureI by
using the get_SeqFeatures method.

Somehow, my script does not produce the expected results. Could somebody put
me on back on the right track.


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

my $dmdb = Bio::DB::GFF->new( -adaptor => 'dbi::mysql',
                                   -dsn => "chr4",
                                   );
                   
                   
my @genes = ('CG2041'); ##a gene on the fourth chromosome

foreach my $gene (@genes){
    
    my $geneseg = $dmdb->segment(-name => $gene, -merge);
    
    if ($geneseg){
    
    my @tgs = $geneseg->features(-types => 'gene');
    
    for my $tg (@tgs){
    
        my $length = $tg->length();
        
        my $panel = Bio::Graphics::Panel->new(-length => $length, -width  =>
800);
        
        my $track = $panel->add_track(    -glyph => 'generic',
                                        -label  => 1);
    
        my $tcs = $tg->features(-types =>'processed_transcript',
                                        -attributes => {Parent => $gene},
                                        -iterator => 1);
                   
        while ( my $tc = $tcs->next_seq ){
            $track->add_feature($tc->get_SeqFeatures);
        }
        
        print $panel->png;
    }
}
}

Many thanks


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