about summary refs log tree commit diff
path: root/sourcecodes/example.php
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/example.php')
-rw-r--r--sourcecodes/example.php68
1 files changed, 67 insertions, 1 deletions
diff --git a/sourcecodes/example.php b/sourcecodes/example.php
index 11c74633..d831b32d 100644
--- a/sourcecodes/example.php
+++ b/sourcecodes/example.php
@@ -1,6 +1,8 @@
 <?php
 include("input_validate.php");
 $oldkeyval=$_GET["My_key"];
+//$dir="/tmp/bnw/";
+$dir="/var/lib/genenet/bnw/";
 
 $type_n=array();
 
@@ -23,9 +25,73 @@ $alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
 $keyval=$alpha;
 shell_exec('./examplefilecopy.sh '.$example.' '.$oldkeyval.' '.$keyval);
 
+
+shell_exec('./run_scripts/run_prep_input '.$keyval);
+
+
+/////////////////////////////////structure matrix////////////////////////////
+
+$matfile=$dir.$keyval."structure_input.txt";
+
+$fout=fopen($dir.$keyval."graphviz.txt","w");
+
+$matrix1=file_get_contents("$matfile");
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array();
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$initialstring="digraph G {\n"."size=\"6,8\";\n"."node [shape=square,width=1.5];\n";
+$endstring="}";
+fwrite($fout,"$initialstring");
+
+$g_file_name=$dir.$keyval."grviz_name_file.txt";
+$grviz_name_file=fopen($g_file_name,"w");
+
+for($i=0;$i<$n;$i++)
+  {
+    $row_name=trim($dataname[$i]);
+    fwrite($grviz_name_file,"$row_name\n");
+  }
+
+for($i=1;$i<=$n;$i++)
+  {
+    $ii=$i-1;
+    $row_name=trim($dataname[$ii]);
+
+    $col_arr=explode("\t",$str_arrmat[$i]);
+
+    for($j=0;$j<$n;$j++)
+      {
+	$col_val=trim($col_arr[$j]);
+	if($col_val==1)
+	  {
+	    $col_name=trim($dataname[$j]);
+	    fprintf($fout,"%s -> %s;\n",$ii,$j);
+	    //fprintf($fouttemp,"%s -> %s;\n",$row_name,$col_name);
+
+	  }
+      }
+
+
+  }
+fwrite($fout,"$endstring");
+fclose($fout);
+
+
+shell_exec('./run_scripts/run_octave '.$keyval);
+
+
+
+
 ?>
 <script>
-window.open("layout_example.php?My_key=<?php print($keyval);?>",'_self',false);
+ //window.open("layout_example.php?My_key=<?php print($keyval);?>",'_self',false);
+ window.open("layout_svg_no.php?My_key=<?php print($keyval);?>",'_self',false);
 </script>