[Bioperl-l] Bio::Tools::Blast;

Fish Fish wfish82@hotmail.com
Thu, 04 Jan 2001 00:59:55 -0000


Hi,

  I am trying to pick out those blast results saying
"***** No hits found *****", among many other things.
But I can't get it work with Bio::Tools::Blast.  Can
somebody point out what is wrong in the following
code?  Also, it seems if the first of a multi blast
record is a "No hits found", then the 2nd record will
be skipped.

  Thanks in advance!

wfish82

**********************************

#!/usr/local/bin/perl -w

use strict;
use Bio::SeqIO;
use Bio::Tools::Blast qw(:obj);

my $blastn=$ARGV[0];

my %blastParam=(
                -file           => $blastn,
                -parse          => 1,
                -filt_func      => \&filter,
                -min_len        => 50,
                -check_all_hits => 0,
                -strict         => 0,
                -stats          => 0,
                -best           => 0,
                -share          => 0,
                -exec_func      => \&process_blast,
);

$Blast->parse(%blastParam);

sub filter{
  my $hit=shift;
  if(! defined $hit){
    print "blahblah...\n";
  }else{
    return 1;
  }
}
sub process_blast{
  my $blastObj=shift;
  if(! defined $blastObj->hit){
    printf "BLAHBLAH...\n";
  }
  $blastObj->destroy;
}

#######################################
# end
#############################
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com