Bioperl: Changing _parse_alignment behaviour in Bio::Tools::Blast?

Peter van Heusden pvh@egenetics.com
Fri, 23 Jun 2000 11:37:22 +0200 (SAST)


Hi

I'm trying to parse BLAST reports which have oddities in their
description lines which are peculiar to our local BLAST reports
(unfortunately). Unfortunately, there doesn't seem to be a clean way to
over-ride how Bio::Tools::Blast extracts the name from the description
line.

This is how it appears to work:

Bio::Tools::Blast::_get_parse_blast_function's default function
 calls _parse_alignment

Bio::Tools::Blast::_parse_alignment does a 'require
Bio::Tools::Blast::Sbjct' and creates Bio::Tools::Blast::Sbjct objects

Bio::Tools::Blast::Sbjct::_initialise calls _set_id, which
parses the description and sets the name of the hit.

I tried a couple of things (of various levels of hackishness). I can't
sub-class Bio::Tools::Blast, because Bio::Tools::Blast uses a static Blast
object to store state, which isn't inherited (don't ya just love perl's
OO!).

I can't subclass Bio::Tools::Blast::Sbjct, because it is specifically
'require'ed' by Bio::Tools::Blast.

There seem to be two ways out of this mess:

1) Create a way of specifying your own _parse_alignment method (like you
can specify an _exec_func).

2) Move all the global variables used by Bio::Tools::Blast into one place
(e.g. as fields of $Blast), and then use a construct such as:

self->Blast_object(\$Blast); # where $Blast is defined in the module
                             # namespace

...

sub _foo {

my $Blast = $self->Blast_object();

}

In other words, fake class attribute inheritance. *This would involve
quite a significant re-write of Blast.pm*

For now (since I have a deadline of this afternoon), I'm going to just
hack my local Blast.pm. I'd appreciate comments on which way forward
people think is best, though.

Peter
--
Peter van Heusden				pvh@egenetics.com
Electric Genetics

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================