[Bioperl-l] wwwblast script question

Jason Stajich jason at cgt.duhs.duke.edu
Thu Jul 8 22:22:22 EDT 2004


Presumably the .ncbirc file in your home directory is not used by the
apache process running the webserver - I don't think this is the problem
necessarily, but could be part of it.

What does $factory->executable('blastall') report in your script?

Your error message seems inconsistent with what you are printing.  You say
it cannot call blastall but in fact blastall is being called an returning
a null value.  I wonder where it is really breaking down...

What if you just remove StandAloneBlast from the equation and run
my $fh;
open($fh, "blastall -i seqfile.fa -d yourdb -F F -g 5 -W 17 |") || die("cannot run blast!")
my $searchio = Bio::SearchIO->new(-format => 'blast', -fh => $fh);
my $result = $searchio->next_result;

Then run StandAloneBlast with verbose flag set to 1
 $factory->verbose(1);
to see more warnings and information and make sure the command-line it is
running seems sensible.

Best I got at this point...

-jason
On Thu, 8 Jul 2004, huizhuan wu wrote:

> 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
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list