[Biodevelopers] WWWBLAST: blast.REAL process can't read param values from parent process

Hancy Frederic hancy at gene.ucl.ac.be
Thu Apr 15 12:48:11 EDT 2004


Hi,

I have developped a cgi application that allows users to manage their own
blast databases from a web interface, allowing them to upload their sequence
files and create the blast database with formatdb. With the current wwwblast
application, the only way to do that (as far as I know) is to launch
formatdb on your sequence file from your server, and then to update
blast.html form (select database field) and the blast.rc configuration file.

To do that, I have replaced the blast.html page with a cgi script and a web
template. In addition to the normal blast.html form, the template contains
another form to manage the user's blast db. The first form sends its query
to the normal blast.cgi, the other to my script which reads for the
specified username the list of blast databases and loads it in the template.
In order to avoid conflicts between users and db files, I've created a
subfolder for each user in the db folder.

That's where I'm stuck: blast.cgi does the following:

#!/bin/csh -f

echo "Content-type: text/html"
echo ""
setenv BLASTDB db
./blast.REAL

So basically it outputs an HTTP header (Content-type), a blank line and then
it launches a child process blast.REAL which outputs to STDOUT the blast
output in HTML. Parameters are read from the inherited STDIN from the parent
process blast.cgi, which were sent by the client through an HTTP request.

What I need to do is to replace db with the user's database folder. Being
rather a newbie in bash, I've tried to replace this script with a perl CGI
where I could easily access to the username param, set the BLASTDB and
launch blast.REAL:

#!/usr/bin/perl

use CGI;
use strict;

my $q = new CGI;
my $username = $q->param("username"};

$ENV{BLASTDB} = "db/$username";
print $q->header( "text/html");
exec './blast.REAL' or die "Can't run command blast.REAL: $!";

When I use this script, it returns me a blank page, and a few second later
the old blast.html form.  If I try to redirect blast.REAL output to a file,
no file is created as if the command wasn't executed.  When using the debug
switch ($ENV{DEBUG_COMMAND_LINE} = 'TRUE' on the original script, a file
(__web.in) is created in /tmp. If I use after the command './blast.REAL <
__web.in' in my script, then the blast output is sent back to my browser.
This file contains all the param values.  So it seems that the created
process doesn't inherit from the STDIN of the parent process, the <
redirection provides the input.

Any help is greatly appreciated!

Frederic

----------------------------
Unite de Genetique, UCL
5 place croix du sud,
B-1348 Louvain-la-Neuve
Belgique
Tel: +32 10 47 88 96
Fax: +32 10 47 31 09
mailto:hancy at gene.ucl.ac.be
----------------------------




More information about the Biodevelopers mailing list