blast_parse_1.pl
use Bio::Tools::BPlite;
if (! $ARGV[0])
{
print "What is the BLAST file to parse? ";
chomp ($inFile = <STDIN>);
}
else
{
$inFile = $ARGV[0];
}
$report = new Bio::Tools::BPlite(-file=>"$inFile");
$i = 1;
print "HIT_NUM\tSCORE\tBITS\tPERCENT\tEXPECT\tSUBJECT_NAME\tIDENTITIES\tMATCH_LENGTH\t";
print "QUERY_START\tQUERY_END\tSUBJECT_START\tSUBJECT_END\n";
print "\n**** DATA FOR QUERY ", $report->query, "****\n\n";
while(my $sbjct = $report->nextSbjct)
{
while (my $hsp = $sbjct->nextHSP)
{
print "$i\t";
print $hsp->score, "\t",
$hsp->bits, "\t",
$hsp->percent, "\t",
$hsp->P, "\t",
$hsp->subject->seqname, "\t",
$hsp->match, "\t",
$hsp->length, "\t";
print $hsp->query->start, "\t",
$hsp->query->end, "\t",
$hsp->subject->start, "\t",
$hsp->subject->end, "\n";
}
$i++;
}