diff options
| author | Pjotr <wrk@bosa.lan> | 2026-09-28 14:48:57 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-09-28 14:51:45 +0000 |
| commit | 7f460113cc9c7eca91935549c25d78a9393e0977 (patch) | |
| tree | e9a05e98fdaf571cd15975c6a1e3e73727b84bf2 /sourcecodes/test_set_predictions.php | |
| parent | 8380798b1c60c9844b9952921a8a7361e2fb28cd (diff) | |
| download | gn-bnw-7f460113cc9c7eca91935549c25d78a9393e0977.tar.gz | |
container: deployment fixes for the Guix container/VM
Changes previously carried as bnw-container-paths.patch in guix-bioinformatics, now applied to the source directly: * unify data directories on /var/lib/genenet/bnw (was /tmp/bnw and ./data/ mixed) * make the shell_exec paths __DIR__-relative and the example/octave helper scripts location-independent, so php-fpm can run them from any working directory * use core-octave randn/exp instead of the statistics-package normrnd/normpdf (not available in the container's octave) * nnodes: strtrim before strfind so the node count parses with the container's octave output * python3 instead of a hardcoded /home/jziebart path * add diag.php, a debug page showing the request and data state * bn_genenet.php: serve the GeneNetwork (GN2) handshake server-side; the My_Gennenet POST is converted (commas -> tabs, semicolons -> newlines) in PHP and the prepared-data page is returned in ONE request. This removes the raw-echo of into a JavaScript string (an XSS hole on public deployments) and is backward compatible for GN2 (same POST, better response).
Diffstat (limited to 'sourcecodes/test_set_predictions.php')
| -rw-r--r-- | sourcecodes/test_set_predictions.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sourcecodes/test_set_predictions.php b/sourcecodes/test_set_predictions.php index f1806575..14d9cc42 100644 --- a/sourcecodes/test_set_predictions.php +++ b/sourcecodes/test_set_predictions.php @@ -16,8 +16,8 @@ if($_POST["My_key"]!="") $searchID=""; $UploadValue="NO"; $TextFile=$_FILES["MyFile"]["name"]; -//$TextinFile="./data/".$keyval."ts_upload.txt"; -$TextinFile="/tmp/bnw/".$keyval."ts_upload.txt"; +//$TextinFile="/var/lib/genenet/bnw/".$keyval."ts_upload.txt"; +$TextinFile="/var/lib/genenet/bnw/".$keyval."ts_upload.txt"; ?> </header> @@ -77,14 +77,14 @@ if(isset($_POST["MyUpload"])) <!-- Main content --> <?php - // $filename1="./data/".$keyval."ts_upload.txt"; - //$filename2="./data/".$keyval."ts_output.txt"; - $dir="/tmp/bnw/"; + // $filename1="/var/lib/genenet/bnw/".$keyval."ts_upload.txt"; + //$filename2="/var/lib/genenet/bnw/".$keyval."ts_output.txt"; + $dir="/var/lib/genenet/bnw/"; $filename1=$dir.$keyval."ts_upload.txt"; $filename2=$dir.$keyval."ts_output.txt"; $plotly_file=$dir.$keyval."ts_plotly.html"; -$plotly_file_local="./data/".$keyval."ts_plotly.html"; -$pred_file_local="./data/".$keyval."ts_output.txt"; +$plotly_file_local="/var/lib/genenet/bnw/".$keyval."ts_plotly.html"; +$pred_file_local="/var/lib/genenet/bnw/".$keyval."ts_output.txt"; if(file_exists($filename1)) @@ -111,7 +111,7 @@ else if(file_exists($filename2)) }); </script> </div> - <a class=button2 href=<?php $d="./data/".$keyval."ts_output.txt"; print($d);?>>View and download predictions</a> + <a class=button2 href=<?php $d="/var/lib/genenet/bnw/".$keyval."ts_output.txt"; print($d);?>>View and download predictions</a> <br> <br> @@ -187,13 +187,13 @@ if($searchID!="") { if($UploadValue=="NO") { - // $fpdata = fopen("./data/".$keyval."ts_input.txt","w"); + // $fpdata = fopen("/var/lib/genenet/bnw/".$keyval."ts_input.txt","w"); $fpdata = fopen($dir.$keyval."ts_upload.txt","w"); if ($fpdata !== false) { fwrite($fpdata,$searchID); } } - $command = './run_scripts/run_test_set '.$keyval; + $command = __DIR__.'/run_scripts/run_test_set '.$keyval; $output = shell_exec("$command > /dev/null 2 > /dev/null &"); $pred_link='cv_predictions.php?My_key='.$keyval; } |
