From 8070dc963753142bb86c4ed698d91fd623ed28e7 Mon Sep 17 00:00:00 2001
From: ziejd2
Date: Thu, 28 Sep 2017 15:04:40 -0500
Subject: BNW using Octave instead of Matlab.
This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning.
I am calling this BNW_1.02. It can be accessed at:
compbio.uthsc.edu/BNW_1.02
---
sourcecodes/network_layout_evd.php~ | 667 ++++++++++++++++++++++++++++++++++++
1 file changed, 667 insertions(+)
create mode 100644 sourcecodes/network_layout_evd.php~
(limited to 'sourcecodes/network_layout_evd.php~')
diff --git a/sourcecodes/network_layout_evd.php~ b/sourcecodes/network_layout_evd.php~
new file mode 100644
index 00000000..a5909436
--- /dev/null
+++ b/sourcecodes/network_layout_evd.php~
@@ -0,0 +1,667 @@
+
+
Error: Unable to display your network structure.
+5 && $node<=7)
+{
+ $width=150;
+ $hieght=120;
+ $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+ $width=110;
+ $hieght=85;
+ $font=10;
+}
+else
+{
+ $width=80;
+ $hieght=60;
+ $font=8;
+}
+*/
+ $width=150;
+ $hieght=150;
+ $font=12;
+
+$r_index=$node+2;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]); //name
+$data_read[$i][1]=trim($datamat[1]); //datatype
+$col_in=2;
+$r_index+=4;
+ if($datamat[1]==1) //type=coninuous
+ {
+ for($j=1;$j<=101;$j++)
+ {
+ $datamat=explode("\t",$str_arrmat[$r_index]);
+ $data_read[$i][$col_in]=trim($datamat[0]); //x data
+ // echo $data_read[$i][$col_in];
+ // echo ' ';
+
+ $col_in++;
+ $data_read[$i][$col_in]=trim($datamat[1]); //y data
+ // echo $data_read[$i][$col_in];
+ // echo ' ';
+
+ $col_in++;
+ $r_index++; // increment to point next data
+ // echo "
";
+ }
+ }
+ if($datamat[1]>1) //type=descrete
+ {
+ $iter=$datamat[1];
+ for($j=1;$j<=$iter;$j++)
+ {
+ $datamat=explode("\t",$str_arrmat[$r_index]);
+ $data_read[$i][$col_in]=trim($datamat[0]); //x data
+ //use level mapping
+ $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+
+ $col_in++;
+ $data_read[$i][$col_in]=trim($datamat[1]); //y data
+
+ $col_in++;
+ $r_index++; // increment to point next data
+ //echo "
";
+ }
+ }
+
+}
+
+
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+$grviz_name_list=array();
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name=file_get_contents("$g_file_name");
+$grviz_name_list=explode("\n",$grviz_name);
+
+
+
+//$foutnew=fopen("contentofgraphviz.txt","w");
+//fwrite($foutnew,"$line");
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y $grfilename";
+//$line=system($cmd);
+
+
+
+
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+ $i++;
+ if($i>1)
+ {
+
+ $data=explode(" ",$row);
+ $j=0;
+ $k=0;
+ $flag=0;
+ foreach($data as $cell)
+ {
+
+ $j++;
+
+ $cell=trim($cell);
+ //echo $cell;
+ //echo ' ';
+ if($j==1 && $cell=="node")
+ {
+ $flag=1;
+ }
+
+ if($j>1 && $j<5 && $flag==1)
+ {
+ //echo $cell;
+ //echo ' ';
+ if($j==2)
+ {
+
+ $ID_data[$ii][$k]=$grviz_name_list[$cell];
+ }
+ else
+ $ID_data[$ii][$k]=round($cell/10*900);
+ // echo $ID_data[$ii][$k];
+ //echo ' ';
+
+ $k++;
+ }
+ }
+
+ if($flag==1)
+ {
+ $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+ $ID_data[$ii][4]=$ID_data[$ii][2]+150;
+ $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+ $ID_data[$ii][6]=$ID_data[$ii][2];
+ $ii++;
+ //echo "
";
+ }
+ // echo "
";
+
+ }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+ $i++;
+ if($i>1)
+ {
+
+ $data=explode(" ",$row);
+ $j=0;
+
+ $flag=0;
+ $number_of_point=0;
+ $index=0;
+ foreach($data as $cell)
+ {
+ $j++;
+ $cell=trim($cell);
+
+ if($j==1 && $cell=="edge")
+ {
+ $flag=1;
+ }
+
+ if($j==2 && $flag==1)
+ {
+
+ for($k=0;$k<$nnode;$k++)
+ {
+ $cell=$grviz_name_list[$cell];
+ if($cell==$ID_data[$k][0])
+ {
+ $edge_data[$ii][0]=$ID_data[$k][3];
+ $edge_data[$ii][1]=$ID_data[$k][4];
+ }
+
+ }
+
+ }
+ else if($j==3 && $flag==1)
+ {
+ for($k=0;$k<$nnode;$k++)
+ {
+ if($cell==$ID_data[$k][0])
+ {
+ $edge_data[$ii][2]=$ID_data[$k][5];
+ $edge_data[$ii][3]=$ID_data[$k][6];
+ }
+
+ }
+
+ }
+ else if($j==4 && $flag==1)
+ {
+ $edge_data[$ii][4]=$cell;
+ $number_of_point=$cell*2;
+ $index=5;
+ }
+ else if($j>4 && $number_of_point>0 && $flag==1)
+ {
+ if(($j%2)!=0)
+ $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+ else
+ $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+ $number_of_point--;
+ $index++;
+ }
+
+
+
+ }
+ if($flag==1)
+ {
+ $ii++;
+ //echo "
";
+ }
+
+ }
+}
+
+
+$nedges=$ii;
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit 1.4.1