[Bioperl-l] How to fix "blast_report is undefined"??

Huizhuan Wu wuhuizhu at mail.eecis.udel.edu
Tue Jul 6 13:59:55 EDT 2004


Here is the msg I got:
Here is blast_report: Bio::SearchIO::blast=HASH(0x9ac3e0)

Can't call method "next_result" on an undefined value at
/Users/wuhuizhuan/Sites/CGI-BIN/bl.cgi line 73.

Here is my code:
#!/usr/bin/perl -w -T

 $ENV{BLASTMAT} = '/usr/local/BLAST/data';
 $ENV{'BLASTDB'} ='/Users/huizhuan/myWork/learnBlast';
 $ENV{PATH} = '/usr/local/bin:/usr/ucb:/usr/bin:/sbin:/usr/sbin';
 $ENV{IFS} = "" if $ENV{IFS} ne "";


# This script gets sequence from grape MPSS page and perform blastn
against
# contig_fastaforNevada.txt database.

# Modules to use.
use CGI qw(:all);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use CGI::Carp qw(fatalsToBrowser carpout);
use strict;
use warnings;
use Getopt::Long;
use Bio::Tools::Run::StandAloneBlast;
use Bio::SeqIO;

print header;
print start_html("BLAST RESULT");
my ($query, $seq);
my $db = "/Users/huizhuan/myWork/learnBlast/data.txt";
   my $maxEval = 1.0e-10;

   $query = "233fff";
   my $seq = "GATCGGTTAATGGGCCATGGGGGG";
   my $seqobj = Bio::Seq->new( '-id' => $query,
                                '-seq' => $seq);
  my @params = ('program'=>'blastn', 'outfile'=>'blast.out',
                   '_READMETHOD'=>'Blast', 'F'=>'F','W'=>17,'g'=>'F',
'database'=>$db);

    my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
    $factory->e($maxEval);
    my $blast_report = $factory->blastall($seqobj);
    print "Here is blast_report: $blast_report";
    my $result = $blast_report->next_result;
    print end_html;


Any help is highly appreciated!
huizhuan




More information about the Bioperl-l mailing list