[Bioperl-l] SearchIO speed up

Sendu Bala bix at sendu.me.uk
Thu Aug 17 17:53:52 EDT 2006

Chris Fields wrote:
> I have to agree.  If there was a way to get around this by having the change
> behind the scenes in HSPI then I wouldn't see a problem. 
> Hence my suggestion of implementing hit() and other
> SeqFeature::SimilarityPair methods directly in Bio::Search::HSP::HSPI (i.e.
> no SimilarityPair inheritance) to return Bio::SeqFeature::Similarity objects
> directly.

That is exactly what I did (on your suggestion). The problem that Hilmar 
points out is that HSPI should continue being a SimilarityPair in case 
anything checks that it is a SimilarityPair.

Would there be any problem with leaving HSPI as a SimilarityPair and 
having GenericHSP::new as:

sub new {
     my($class, at args) = @_;
     my $self = $class->Bio::Root::Root::new(@args);
     # one change I forgot to mention before: the Similarity objects
     # created for query() and hit() can no longer have
     # '-primary'   => $self->primary_tag set unless we also override
     # primary_tag, but I've no idea what primary_tag is supposed to do

# overridden methods, as before

This gives a 1.43x speedup. (Simply overriding methods gives only a 
1.14x speedup.)

More information about the Bioperl-l mailing list