[Bioperl-l] Feature extraction using Bio::DB::GFF

Marc Logghe Marc.Logghe at DEVGEN.com
Fri Mar 3 16:30:40 EST 2006


> 
> my $feats = $db->features(  -types => 'processed_transcript',
>                             -merge => 1,
>                             -iterator => 1,
>                             );
>                    
> while (my $feat = $feats -> next_seq() ){
>     print "$feat\n";
>     print $feat -> sub_SeqFeature(), "\n";
> 
> }
> 
Hi Marco,
It is because you are calling $db->features in scalar context. In that
way $feats contains the number of returned feature objects and not the
objects themselves. You should do something like:
my @feats = $db->features(  -types => 'processed_transcript',
                            -merge => 1,
                            -iterator => 1,
                            );
                   
foreach my $feat (@feats){
   # do something with $feat
}

HTH,
Marc



More information about the Bioperl-l mailing list