Entering edit mode
8.0 years ago
asar7295
•
0
Hi everyone, I tried to execute local blast command on php script. The command did created a file for blast output but it just an empty file. So I tried paste the command to Linux command prompt and it create a file with blast result.
I still can't figure out the problem. Hope you guys can help me with this.
$blast_path="/opt/lampp/htdocs/blasto/bin/";
$blast_database_directory="/opt/lampp/htdocs/blasto/db/";
$blast_result="/opt/lampp/htdocs/blasto/result/";
$queryfname =tempnam($blast_result,"IN");
$resultfname=tempnam($blast_result,"OUT");
exec("find ".$queryfname." -type f -exec chmod 777 {} +");
exec("find ".$resultfname." -type f -exec chmod 777 {} +");
print("The query sequence:".$queryfname."<br>\n");
print("The resulting output:".$resultfname."<br><br>\n");
if ($qhandle=fopen($queryfname,"w")) {
if ($bytes=fwrite($qhandle,$_POST['sequence'])) {
print("Successfully wrote $bytes characters of data to $queryfname.<br /><br>\n");
} else {
print("Problem writing the file $queryfname at handle $qhandle!<br /><br>\n");
}
fclose($qhandle);
}
print($blast_path.$_POST['program']." -query ".$queryfname." -db ".$blast_database_directory.$_POST['database']." -evalue ".$_POST['evalue']." -out ".$resultfname."<br><br>");
exec($blast_path.$_POST['program']." -query ".$queryfname." -db ".$blast_database_directory.$_POST['database']." -evalue ".$_POST['evalue']." -out ".$resultfname);