[Bioperl-l] wwwblast script question
huizhuan wu
arhui20 at hotmail.com
Thu Jul 8 11:07:01 EDT 2004
Can someone there help me out of this? I have been stuck in this for a week.
Any help would be highly appreciated!
I have a bioperl cgi script to host a blast server locally. But I kept
getting an error msg of not being able to call blastall in "$blast_report =
$factory->blastall($seqobj);". The script is running ok in command line. So
it should be the wwwblast server environment setting problem. I am running
on a machine that I have a user accout but without the root previledge.
------------------------------------------------
my bioperl cgi script is in: /Users/myname/Sites/CGI-BIN/
my local database to blast(I have formatted it) is in:
/users/myname/blast_script/data.txt
the blast programs in the machine is in: /usr/local/NCBI/network/wwwblast
my confirguration file is in: /etc/httpd/myname.conf
------------------------------------------------
Here is my settings on environment variables:
(1) in .ncbirc file
[NCBI]
data=/usr/local/BLAST/data
[BLAST]
BLASTDB=/Users/myname/blast_script
BLASTMAT=/usr/local/BLAST/data
(2) in myname.conf
<Directory /usr/local/NCBI/network/wwwblast>
Options ExecCGI
</Directory>
<Directory /usr/local/BLAST/>
Options ExecCGI
</Directory>
<Directory /Users/myname/Sites/>
Options ExecCGI
</Directory>
------------------------------------------------
Here is the error msg:
Here is blast_report Content-type:text/html
Can't call method "next_result" on an undefined value at
/Users/myanme/Sites/CGI-BIN/bl.cgi line 73.
------------------------------------------------
The error is located here:
----
my $blast_report = $factory->blastall($seqobj);
print "Here is blast_report: $blast_report";
my $result = $blast_report->next_result;
----
--------------------------------------------------
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 data.txt
# 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/myname/blast_script/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;
_________________________________________________________________
MSN Life Events gives you the tips and tools to handle the turning points in
your life. http://lifeevents.msn.com
More information about the Bioperl-l
mailing list