[Bioperl-l] BPlite to parse multi query sequence report
Jason Stajich
jason@cgt.mc.duke.edu
Tue Jan 14 18:16:52 EST 2003
you can - but it is hacky. The code in SYNOPSIS shows how to do this.
However, I would suggest using Bio::SearchIO instead of BPlite.
See the HOWTO:
http://bioperl.org/HOWTOs/
use Bio::Tools::BPlite;
my $report = new Bio::Tools::BPlite(-fh=>\*STDIN);
{
$report->query;
$report->database;
while(my $sbjct = $report->nextSbjct) {
$sbjct->name;
while (my $hsp = $sbjct->nextHSP) {
$hsp->score;
$hsp->bits;
$hsp->percent;
$hsp->P;
$hsp->match;
$hsp->positive;
$hsp->length;
$hsp->querySeq;
$hsp->sbjctSeq;
$hsp->homologySeq;
$hsp->query->start;
$hsp->query->end;
$hsp->hit->start;
$hsp->hit->end;
$hsp->hit->seq_id;
$hsp->hit->overlaps($exon);
}
}
# the following line takes you to the next report in the stream/file
# it will return 0 if that report is empty,
# but that is valid for an empty blast report.
# Returns -1 for EOF.
last if ($report->_parseHeader == -1);
redo;
}
On Tue, 14 Jan 2003, E Klee wrote:
>
> Ok, I am still struggling w/ the BioPerl Blast parsers. Can I use BPlite to
> parse a blast output file that contains multiple query sequences compared to
> multiple subject sequences. My experience with this so far is openning a
> new BPlite report will only reference the output for the first query
> sequence in my file. Using a while() statement to step through all subjects
> via nextSbjct() is only finding the hits to the first query sequence. Any
> help?
>
> -E
>
> _________________________________________________________________
> MSN 8: advanced junk mail protection and 2 months FREE*.
> http://join.msn.com/?page=features/junkmail
>
> _______________________________________________
> 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
More information about the Bioperl-l
mailing list