[Bioperl-l] GenericHit vs. BlastHit

Jason Stajich jason@cgt.mc.duke.edu
Thu, 22 Aug 2002 10:13:25 -0400 (EDT)


This is by design - Steve and I wrote different objects - the BlastHit and
BlastHSP are Steve's but they shouldn't be fundamentally different from
the GenericHit and GenericHSP.  The design is pretty different as Steve
does lazy parsing in the objects + SearchIO::psiblast while I try and do
event based parsing in the SearchIO::blast.pm.  We've agreed that the
event based parsing is the way to go and
BlastXX objects and related SearchIO::psiblast parser will be deprecated
in 1.2 -- I have moved most of the necessary functions over to the
GenericXX objects I just haven't tested and reimplemented all of them.
This will happen for 1.2 though.

All the data from the blast report is stored in the Generic objects --
what you are missing are the extra functions - but everything that is
defined in the HSP::HSPI or Hit::HitI interfaces should be implemented by
both objects.

The additional functions Steve implemented in BlastXX objects (seq_ind,
hsp tiling, etc) hadn't been ported over from the BlastXX objects to
GenericXX objects before 1.0 series was released.  A lot of it is on the
main trunk and 1.1 release though.  What would like to do that you can't
seem to do with the GenericXX objects?

-jason

On Thu, 22 Aug 2002, Paul Boutros wrote:

> Hi again,
>
> I'm doing some parsing of BLAST results with the SearchIO system, and it
> appears that SearchIO is returning me GenericResult and GenericHit
> objects, rather than the more detailed & specific BlastResult & BlastHit
> objects.  Is this a feature, or is there some particular way of getting it
> to return the BlastXXXX objects instead?  I'd prefer the Blast objects
> because they have some methods that are not available through the generic
> objects, like ->bits() for the bit-score.
>
> My code is:
> use strict;
> use Bio::SearchIO;
>
> my $searchio = new Bio::SearchIO(
> 			'-format'	=> 'blast',
> 			'-file'		=> '15k5prime.pre',
> 			);
>
> while (my $result = $searchio->next_result()) {
>
> 	print $result->query_name(), "n";
>
> 	while (my $hit = $result->next_hit()) {
> 		print $hit->significance(), "\n";
> 		print $hit->hit_length(), "\n";
> 		}
>
> 	}
>
> System:
> Perl: 5.6.1
> BioPerl: 1.00.2
> OS: W2K (sp3)
>
> <Off topic> Incidentally, as a comment on the whole "question about the
> nature of bioperl" thread, I have to point out that two days ago I hadn't
> used BioPerl for anything.  Today, I couldn't imagine parsing my blast
> output by hand again.  It works, and it's useful.  Search me about the
> stuff I haven't used, but it took a day to learn which isn't remotely
> significant for any large library.  I like it.</off topic>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu