[Bioperl-l] SearchIO question

Jason Stajich jason@cgt.mc.duke.edu
Wed, 27 Nov 2002 23:44:50 -0500 (EST)


   use Bio::SearchIO;
    # format can be 'fasta', 'blast'
    my $searchio = new Bio::SearchIO( -format => $format,
                                      -file   => $filename );
    while ( my $result = $searchio->next_result() ) {
       while( my $hit = $result->next_hit ) {
        # process the Bio::Search::Hit::HitI object
           while( my $hsp = $hit->next_hsp ) {
            # process the Bio::Search::HSP::HSPI object
            print "H", $hsp->hit->start, "..", $hsp->hit->end, "\n";
            print "Q", $hsp->query->start, "..", $hsp->query->end, "\n";
         }
    }



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

On Wed, 27 Nov 2002, nkuipers wrote:

> Hi folks,
>
> I want to parse "from hit position x, to hit position y" information for high
> scoring pairs in a blast report.  Bio::Tools::BPlite has $hsp->hit->start/end,
> and Bio::Blast has similar idea.  I'd like to stay away from both, especially
> the latter since its documentation is big and scary.  ;)  I wasn't able to
> find similar functionality in the documentation for Bio::SearchIO, ResultI,
> HitI or HSPI...did I miss something or is this sort of information in some

Bio::Tools::Blast is deprecated and Bio::Tools::BPlite is no longer
maintained.

You need to follow the inheritance tree which is clickable at the
documentation site http://doc.bioperl.org - you have to know that a HSP is
made up of two Similarity objects since it is a FeaturePair.  That is
where we store this data.

There is also the beginnings of a HOWTO at http://bioperl.org/HOWTOs/.
Will try and provide more practical examples, it is still too much of a
power-user's document I suspect.

> kind of Seq object or..??
>
> Thanks,
>
> Nathanael Kuipers
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>