[Bioperl-l] Bio::DB::SeqFeature::Store::memory -> filter_by_type very slow

Jelle Scholtalbers j.scholtalbers at gmail.com
Mon Feb 1 12:24:29 UTC 2010


Hi,
I used the Bio::DB::SeqFeature::Store::memory module to load in a GFF3 file
which I could then use in my script in a 'queryable' way. To retrieve
features I used for example
        $db->features(-type => 'BAC:FPC', -seq_id=>'chromosome0')
However when doing a profile on my script I found out that 60% of the
running time went into filter_by_type from
Bio::DB::SeqFeature::Store::memory.
Replacing this function with
     my @features = grep{$_->type eq 'BAC:FPC'}
$db->features(-seq_id=>'chromosome0')
which gave me the same results was just a fraction of the earlier run time.
My script went from 60min. to 4min. for the same result and only changing
this function (is called often).
Can/Should this be fixed or is this just the faster way to do it?

Cheers,
Jelle



More information about the Bioperl-l mailing list