about summary refs log tree commit diff
path: root/sourcecodes/run_scripts
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-09-28 14:48:57 +0000
committerPjotr <wrk@bosa.lan>2026-09-28 14:51:45 +0000
commit7f460113cc9c7eca91935549c25d78a9393e0977 (patch)
treee9a05e98fdaf571cd15975c6a1e3e73727b84bf2 /sourcecodes/run_scripts
parent8380798b1c60c9844b9952921a8a7361e2fb28cd (diff)
downloadgn-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/run_scripts')
-rw-r--r--sourcecodes/run_scripts/path_cd.m4
-rwxr-xr-xsourcecodes/run_scripts/run_del_var2
-rwxr-xr-xsourcecodes/run_scripts/run_kfold2
-rwxr-xr-xsourcecodes/run_scripts/run_loo2
-rwxr-xr-xsourcecodes/run_scripts/run_mod_edges2
-rwxr-xr-xsourcecodes/run_scripts/run_mod_str2
-rwxr-xr-xsourcecodes/run_scripts/run_octave2
-rwxr-xr-xsourcecodes/run_scripts/run_octave_evd2
-rwxr-xr-xsourcecodes/run_scripts/run_octave_inv2
-rwxr-xr-xsourcecodes/run_scripts/run_prep_input2
-rwxr-xr-xsourcecodes/run_scripts/run_settings2
-rwxr-xr-xsourcecodes/run_scripts/run_test_set2
-rwxr-xr-xsourcecodes/run_scripts/run_violin2
13 files changed, 14 insertions, 14 deletions
diff --git a/sourcecodes/run_scripts/path_cd.m b/sourcecodes/run_scripts/path_cd.m
index 4c5c04ad..5a67bd16 100644
--- a/sourcecodes/run_scripts/path_cd.m
+++ b/sourcecodes/run_scripts/path_cd.m
@@ -1,5 +1,5 @@
-base_dir = pwd();
+base_dir = fileparts(fileparts(mfilename("fullpath")));
 addpath(strcat(base_dir,"/bnt-master"));
 addpath(genpathKPM(strcat(base_dir,"/bnt-master")));
 addpath(strcat(base_dir,"/parameter_learning"));
-cd /tmp/bnw;
+cd /var/lib/genenet/bnw;
diff --git a/sourcecodes/run_scripts/run_del_var b/sourcecodes/run_scripts/run_del_var
index 5a500ee2..5baa1218 100755
--- a/sourcecodes/run_scripts/run_del_var
+++ b/sourcecodes/run_scripts/run_del_var
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 removeNodes(arg_list{1},arg_list{2});
 prepareInput(arg_list{2});
\ No newline at end of file
diff --git a/sourcecodes/run_scripts/run_kfold b/sourcecodes/run_scripts/run_kfold
index 02d70da1..f2ed09f1 100755
--- a/sourcecodes/run_scripts/run_kfold
+++ b/sourcecodes/run_scripts/run_kfold
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 fileout=strcat(arg_list{1},"kfoldCV.txt");
 delete(fileout);
diff --git a/sourcecodes/run_scripts/run_loo b/sourcecodes/run_scripts/run_loo
index c73bf1a6..cca85cd7 100755
--- a/sourcecodes/run_scripts/run_loo
+++ b/sourcecodes/run_scripts/run_loo
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 filename=strcat(arg_list{1},"looCV.txt");
 delete(filename);
diff --git a/sourcecodes/run_scripts/run_mod_edges b/sourcecodes/run_scripts/run_mod_edges
index a8376351..e4b1ecb3 100755
--- a/sourcecodes/run_scripts/run_mod_edges
+++ b/sourcecodes/run_scripts/run_mod_edges
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 modifyEdges(arg_list{1},arg_list{2});
 
diff --git a/sourcecodes/run_scripts/run_mod_str b/sourcecodes/run_scripts/run_mod_str
index 2acacbb8..0fd293fa 100755
--- a/sourcecodes/run_scripts/run_mod_str
+++ b/sourcecodes/run_scripts/run_mod_str
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 
 fname1=strcat(arg_list{1},"continuous_input_orig.txt");
diff --git a/sourcecodes/run_scripts/run_octave b/sourcecodes/run_scripts/run_octave
index 92971614..88601baf 100755
--- a/sourcecodes/run_scripts/run_octave
+++ b/sourcecodes/run_scripts/run_octave
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv(); 
 runBN_initial(arg_list{1});
 createSVG(arg_list{1});
diff --git a/sourcecodes/run_scripts/run_octave_evd b/sourcecodes/run_scripts/run_octave_evd
index dfcac1f3..95c59732 100755
--- a/sourcecodes/run_scripts/run_octave_evd
+++ b/sourcecodes/run_scripts/run_octave_evd
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 Predictmultiple(arg_list{1});
 command=cstrcat("/home/jziebart/python/Python-2.7.15/python ",base_dir,"/violin_ev_plotly.py ",arg_list{1});
diff --git a/sourcecodes/run_scripts/run_octave_inv b/sourcecodes/run_scripts/run_octave_inv
index fc9d0636..035e8be6 100755
--- a/sourcecodes/run_scripts/run_octave_inv
+++ b/sourcecodes/run_scripts/run_octave_inv
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv();
 Predictmultipleintervention(arg_list{1});
 command=cstrcat("/home/jziebart/python/Python-2.7.15/python ",base_dir,"/violin_int_plotly.py ",arg_list{1});
diff --git a/sourcecodes/run_scripts/run_prep_input b/sourcecodes/run_scripts/run_prep_input
index 47503ce7..fc9fb6c8 100755
--- a/sourcecodes/run_scripts/run_prep_input
+++ b/sourcecodes/run_scripts/run_prep_input
@@ -1,4 +1,4 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m");
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd);
 arg_list = argv();
 prepareInput(arg_list{1});
diff --git a/sourcecodes/run_scripts/run_settings b/sourcecodes/run_scripts/run_settings
index c32cd116..b8db8b1b 100755
--- a/sourcecodes/run_scripts/run_settings
+++ b/sourcecodes/run_scripts/run_settings
@@ -1,4 +1,4 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m");
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd);
 arg_list = argv();
 writeSettings(arg_list{1});
diff --git a/sourcecodes/run_scripts/run_test_set b/sourcecodes/run_scripts/run_test_set
index aef01887..cdb7e1aa 100755
--- a/sourcecodes/run_scripts/run_test_set
+++ b/sourcecodes/run_scripts/run_test_set
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m")
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd)
 arg_list = argv(); 
 filename=strcat(arg_list{1},"ts_output.txt");
 delete(filename);
diff --git a/sourcecodes/run_scripts/run_violin b/sourcecodes/run_scripts/run_violin
index c5ce7737..896bc0bb 100755
--- a/sourcecodes/run_scripts/run_violin
+++ b/sourcecodes/run_scripts/run_violin
@@ -1,5 +1,5 @@
 #!/usr/bin/octave -qf
-source("./run_scripts/path_cd.m");
+pcd=[fileparts(mfilename("fullpath")) "/path_cd.m"];source(pcd);
 arg_list = argv(); 
 
 #command=strcat({"/home/jziebart/python/Python-2.7.15/python ../violin_plotly.py "},arg_list{1});