blat standalone version won't run in python cgi


I am using the standalone version of BLAT for one of my school projects. The standalone version is run through a python CGI file in a web server hosted by our class server. When the client-side HTML form sends a query sequence to the python CGI on the server-side, the CGI file writes the query sequence to a file in the working directory. The CGI then runs the BLAT standalone version using os.system() with the following command:

blat_standalone/blat/blat -stepSize=5 -repMatch=2253 -minScore=20 -minIdentity=0 GRCh38_chrom1.fna query.fa output.psl

The blat_standalone version is saved in the working directory. I have also made sure that the working directory (the directory in which the python cgi is saved) is world accessible (i.e. permission of the directory is 777)

However, after running the web application, I got an "output.psl" file in the directory that was empty and also write-protected. When I removed the output.psl file and ran BLAT on command line (i.e. not through python CGI) using the above noted command, I had no problem running the program and a new output.psl file was created with correct results. When I changed the permission of this output.psl file (the one created through command line and has correct results) to 774 and reran the web application, the output.psl file was overwritten and becomes empty again.

I also recorded the exit code of the command when it was ran in python CGI and it is 65280.

The permission of the output.psl file created through python cgi is as follows:

-rw-r--r-- 1 daemon  apache               0 May 10 01:05 output.psl

What did I do wrong?





Source link