From 74b673ba4a706085201a5610b938ff98f08f641d Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Wed, 25 Apr 2018 16:43:19 -0500 Subject: Bug fixes, code comments, and minor changes --- sourcecodes/BNW_workflow_net1.htm | 10 +- sourcecodes/BNW_workflow_sci.htm | 6 + sourcecodes/add_evd.php | 7 +- sourcecodes/add_evd_example.php | 9 +- sourcecodes/add_inv.php | 7 +- sourcecodes/add_inv_example.php | 7 +- sourcecodes/bn_file_load_gom.php | 22 +- .../BNT/potentials/@cgpot/marginalize_pot.m | 2 +- sourcecodes/bnt-master/KPMstats/clg_Mstep.m | 8 +- sourcecodes/bnt-master/graph/findroot.m | 2 +- sourcecodes/bnt-master/graph/findroot.m~ | 24 + sourcecodes/create_tiers_gom.php | 3 + sourcecodes/data/example1/Bqxmap.txt | 16 +- sourcecodes/data/example1/Bqxparameters.txt | 34 + sourcecodes/data/example2/hQGmap.txt | 16 +- sourcecodes/data/example2/hQGparameters.txt | 34 + sourcecodes/data/example_chl/bWRmap.txt | 10 +- sourcecodes/data/example_chl/bWRnet_figure.txt | 808 +++--- sourcecodes/data/example_chl/bWRparameters.txt | 21 + sourcecodes/data/example_chr2_spleen/cuLmap.txt | 28 +- .../data/example_chr2_spleen/cuLnet_figure.txt | 2626 ++++++++++---------- .../data/example_chr2_spleen/cuLparameters.txt | 57 + sourcecodes/data/example_sci/Llumap.txt | 10 +- sourcecodes/data/example_sci/Llunet_figure.txt | 808 +++--- sourcecodes/data/example_sci/Lluparameters.txt | 21 + sourcecodes/data/example_time_series/TEbmap.txt | 20 +- .../data/example_time_series/TEbnet_figure.txt | 1818 +++++++------- .../data/example_time_series/TEbparameters.txt | 41 + sourcecodes/data/examplecar15node/MtXmap.txt | 30 +- sourcecodes/data/examplecar15node/eIAmap.txt | 30 +- .../data/examplecar15node/eIAparameters.txt | 82 + sourcecodes/data/old/example_sci_bk/Lluban.txt | 15 + .../old/example_sci_bk/Llucontinuous_input.txt | 503 ++++ .../data/old/example_sci_bk/Llugraphviz.txt | 10 + sourcecodes/data/old/example_sci_bk/Lluk.txt | 1 + sourcecodes/data/old/example_sci_bk/Llumap.txt | 5 + sourcecodes/data/old/example_sci_bk/Llumapdata.txt | 1 + sourcecodes/data/old/example_sci_bk/Lluname.txt | 1 + .../data/old/example_sci_bk/Llunet_figure.txt | 433 ++++ .../data/old/example_sci_bk/Llunet_figure_new.txt | 433 ++++ sourcecodes/data/old/example_sci_bk/Llunlevels.txt | 2 + sourcecodes/data/old/example_sci_bk/Llunnode.txt | 1 + sourcecodes/data/old/example_sci_bk/Llunrows.txt | 1 + sourcecodes/data/old/example_sci_bk/Lluparent.txt | 1 + .../data/old/example_sci_bk/Llustructure_input.txt | 6 + .../old/example_sci_bk/Llustructure_input_temp.txt | 6 + .../data/old/example_sci_bk/Llustructure_old.txt | 5 + sourcecodes/data/old/example_sci_bk/Lluthr.txt | 1 + sourcecodes/data/old/example_sci_bk/Llutier.txt | 1 + sourcecodes/data/old/example_sci_bk/Llutype.txt | 2 + sourcecodes/data/old/example_sci_bk/Lluvar.txt | 1 + sourcecodes/data/old/example_sci_bk/Lluvardata.txt | 1 + sourcecodes/data/old/example_sci_bk/Lluvarname.txt | 1 + sourcecodes/data/old/example_sci_bk/Lluwhite.txt | 1 + .../example_sci_bk/old/Llurun_evidencemodified.sh | 38 + .../example_sci_bk/old/Llurun_initialstructure.sh | 38 + sourcecodes/data/old/examplecar/OVIban.txt | 1 + .../data/old/examplecar/OVIcontinuous_input.txt | 1004 ++++++++ sourcecodes/data/old/examplecar/OVIgraphviz.txt | 70 + sourcecodes/data/old/examplecar/OVIk.txt | 1 + sourcecodes/data/old/examplecar/OVImap.txt | 19 + sourcecodes/data/old/examplecar/OVImapdata.txt | 1 + sourcecodes/data/old/examplecar/OVIname.txt | 1 + sourcecodes/data/old/examplecar/OVInet_figure.txt | 237 ++ .../data/old/examplecar/OVInet_figure_new.txt | 138 + sourcecodes/data/old/examplecar/OVInnode.txt | 1 + sourcecodes/data/old/examplecar/OVInrows.txt | 1 + sourcecodes/data/old/examplecar/OVIparent.txt | 1 + .../data/old/examplecar/OVIstructure_input.txt | 20 + .../old/examplecar/OVIstructure_input_temp.txt | 20 + .../data/old/examplecar/OVIstructure_old.txt | 19 + sourcecodes/data/old/examplecar/OVIthr.txt | 1 + sourcecodes/data/old/examplecar/OVItype.txt | 2 + sourcecodes/data/old/examplecar/OVIvar.txt | 1 + sourcecodes/data/old/examplecar/OVIvardata.txt | 1 + sourcecodes/data/old/examplecar/OVIvarname.txt | 1 + sourcecodes/data/old/examplecar/OVIwhite.txt | 1 + .../old/examplecar/old/OVIrun_evidencemodified.sh | 38 + .../old/examplecar/old/OVIrun_initialstructure.sh | 38 + sourcecodes/data/old/examplezoo/fSfban.txt | 261 ++ .../data/old/examplezoo/fSfcontinuous_input.txt | 104 + sourcecodes/data/old/examplezoo/fSfgraphviz.txt | 61 + sourcecodes/data/old/examplezoo/fSfk.txt | 1 + sourcecodes/data/old/examplezoo/fSfmap.txt | 17 + sourcecodes/data/old/examplezoo/fSfmapdata.txt | 1 + sourcecodes/data/old/examplezoo/fSfname.txt | 1 + sourcecodes/data/old/examplezoo/fSfnet_figure.txt | 130 + sourcecodes/data/old/examplezoo/fSfnnode.txt | 1 + sourcecodes/data/old/examplezoo/fSfnrows.txt | 1 + sourcecodes/data/old/examplezoo/fSfparent.txt | 1 + .../data/old/examplezoo/fSfstructure_input.txt | 18 + .../old/examplezoo/fSfstructure_input_temp.txt | 18 + .../data/old/examplezoo/fSfstructure_old.txt | 16 + sourcecodes/data/old/examplezoo/fSfthr.txt | 1 + sourcecodes/data/old/examplezoo/fSftier.txt | 1 + sourcecodes/data/old/examplezoo/fSftype.txt | 2 + sourcecodes/data/old/examplezoo/fSfwhite.txt | 1 + .../old/examplezoo/old/fSfrun_initialstructure.sh | 38 + .../data/old/examplezoo/standardized_data.txt | 102 + sourcecodes/execute_bn_gom.php | 9 - sourcecodes/faq.php | 6 +- sourcecodes/help.php | 48 +- sourcecodes/home.php | 8 +- sourcecodes/k-best/index.html | 2 +- sourcecodes/network_layout_evd.php | 14 +- sourcecodes/network_layout_evd_2.php | 17 +- sourcecodes/network_layout_evd_2_example.php | 21 +- sourcecodes/network_layout_evd_example.php | 14 +- sourcecodes/network_layout_inv.php | 20 +- sourcecodes/network_layout_inv_2.php | 32 +- sourcecodes/network_layout_inv_2_example.php | 23 +- sourcecodes/network_layout_inv_example.php | 18 +- sourcecodes/parameter_learning/Predictmultiple.m | 22 +- .../Predictmultipleintervention.m | 107 + .../parameter_learning/checkDiscreteNodes.m | 2 + sourcecodes/parameter_learning/checkStructure.m | 8 +- .../code_backup/Predictmultiple.m | 72 + .../code_backup/Predictmultipleintrvention.m | 95 + .../code_backup/checkDiscreteNodes.m | 37 + .../code_backup/checkStructure.m | 78 + .../parameter_learning/code_backup/drawFigure.m | 390 +++ .../parameter_learning/code_backup/drawFigure.m~ | 388 +++ .../parameter_learning/code_backup/drawFigureM.m | 230 ++ .../parameter_learning/code_backup/getParams.m | 22 + .../code_backup/parameterLearning.m | 17 + .../parameter_learning/code_backup/prepareInput.m | 294 +++ .../parameter_learning/code_backup/prepareInput.m~ | 294 +++ .../parameter_learning/code_backup/readInput.m | 63 + .../parameter_learning/code_backup/readInputData.m | 75 + .../code_backup/readInputStructure.m | 72 + .../parameter_learning/code_backup/runBN_initial.m | 57 + .../code_backup/standardizeData.m | 25 + .../code_backup/writeParameters.m | 106 + .../code_backup/writeParameters_ev.m | 151 ++ .../code_backup/writeParameters_int.m | 186 ++ sourcecodes/parameter_learning/drawFigure.m | 191 +- sourcecodes/parameter_learning/drawFigureM.m | 11 +- sourcecodes/parameter_learning/parameterLearning.m | 31 + sourcecodes/parameter_learning/prepareInput.m | 21 +- sourcecodes/parameter_learning/readInput.m | 3 + sourcecodes/parameter_learning/readInputData.m | 4 + .../parameter_learning/readInputStructure.m | 3 + sourcecodes/parameter_learning/runBN_initial.m | 15 +- sourcecodes/parameter_learning/standardizeData.m | 9 +- sourcecodes/parameter_learning/writeParameters.m | 5 + .../parameter_learning/writeParameters_ev.m | 6 + .../parameter_learning/writeParameters_int.m | 6 +- sourcecodes/run_octave_inv | 2 +- sourcecodes/upload_structure_file.php | 270 +- 149 files changed, 10392 insertions(+), 3726 deletions(-) create mode 100644 sourcecodes/bnt-master/graph/findroot.m~ create mode 100644 sourcecodes/data/example1/Bqxparameters.txt create mode 100644 sourcecodes/data/example2/hQGparameters.txt create mode 100644 sourcecodes/data/example_chl/bWRparameters.txt create mode 100644 sourcecodes/data/example_chr2_spleen/cuLparameters.txt create mode 100644 sourcecodes/data/example_sci/Lluparameters.txt create mode 100644 sourcecodes/data/example_time_series/TEbparameters.txt create mode 100644 sourcecodes/data/examplecar15node/eIAparameters.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluban.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llucontinuous_input.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llugraphviz.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluk.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llumap.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llumapdata.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluname.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llunet_figure.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llunet_figure_new.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llunlevels.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llunnode.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llunrows.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluparent.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llustructure_input.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llustructure_input_temp.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llustructure_old.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluthr.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llutier.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Llutype.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluvar.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluvardata.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluvarname.txt create mode 100644 sourcecodes/data/old/example_sci_bk/Lluwhite.txt create mode 100644 sourcecodes/data/old/example_sci_bk/old/Llurun_evidencemodified.sh create mode 100644 sourcecodes/data/old/example_sci_bk/old/Llurun_initialstructure.sh create mode 100644 sourcecodes/data/old/examplecar/OVIban.txt create mode 100644 sourcecodes/data/old/examplecar/OVIcontinuous_input.txt create mode 100644 sourcecodes/data/old/examplecar/OVIgraphviz.txt create mode 100644 sourcecodes/data/old/examplecar/OVIk.txt create mode 100644 sourcecodes/data/old/examplecar/OVImap.txt create mode 100644 sourcecodes/data/old/examplecar/OVImapdata.txt create mode 100644 sourcecodes/data/old/examplecar/OVIname.txt create mode 100644 sourcecodes/data/old/examplecar/OVInet_figure.txt create mode 100644 sourcecodes/data/old/examplecar/OVInet_figure_new.txt create mode 100644 sourcecodes/data/old/examplecar/OVInnode.txt create mode 100644 sourcecodes/data/old/examplecar/OVInrows.txt create mode 100644 sourcecodes/data/old/examplecar/OVIparent.txt create mode 100644 sourcecodes/data/old/examplecar/OVIstructure_input.txt create mode 100644 sourcecodes/data/old/examplecar/OVIstructure_input_temp.txt create mode 100644 sourcecodes/data/old/examplecar/OVIstructure_old.txt create mode 100644 sourcecodes/data/old/examplecar/OVIthr.txt create mode 100644 sourcecodes/data/old/examplecar/OVItype.txt create mode 100644 sourcecodes/data/old/examplecar/OVIvar.txt create mode 100644 sourcecodes/data/old/examplecar/OVIvardata.txt create mode 100644 sourcecodes/data/old/examplecar/OVIvarname.txt create mode 100644 sourcecodes/data/old/examplecar/OVIwhite.txt create mode 100644 sourcecodes/data/old/examplecar/old/OVIrun_evidencemodified.sh create mode 100644 sourcecodes/data/old/examplecar/old/OVIrun_initialstructure.sh create mode 100644 sourcecodes/data/old/examplezoo/fSfban.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfcontinuous_input.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfgraphviz.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfk.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfmap.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfmapdata.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfname.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfnet_figure.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfnnode.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfnrows.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfparent.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfstructure_input.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfstructure_input_temp.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfstructure_old.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfthr.txt create mode 100644 sourcecodes/data/old/examplezoo/fSftier.txt create mode 100644 sourcecodes/data/old/examplezoo/fSftype.txt create mode 100644 sourcecodes/data/old/examplezoo/fSfwhite.txt create mode 100644 sourcecodes/data/old/examplezoo/old/fSfrun_initialstructure.sh create mode 100644 sourcecodes/data/old/examplezoo/standardized_data.txt create mode 100644 sourcecodes/parameter_learning/Predictmultipleintervention.m create mode 100644 sourcecodes/parameter_learning/code_backup/Predictmultiple.m create mode 100644 sourcecodes/parameter_learning/code_backup/Predictmultipleintrvention.m create mode 100644 sourcecodes/parameter_learning/code_backup/checkDiscreteNodes.m create mode 100644 sourcecodes/parameter_learning/code_backup/checkStructure.m create mode 100644 sourcecodes/parameter_learning/code_backup/drawFigure.m create mode 100644 sourcecodes/parameter_learning/code_backup/drawFigure.m~ create mode 100644 sourcecodes/parameter_learning/code_backup/drawFigureM.m create mode 100644 sourcecodes/parameter_learning/code_backup/getParams.m create mode 100644 sourcecodes/parameter_learning/code_backup/parameterLearning.m create mode 100644 sourcecodes/parameter_learning/code_backup/prepareInput.m create mode 100644 sourcecodes/parameter_learning/code_backup/prepareInput.m~ create mode 100644 sourcecodes/parameter_learning/code_backup/readInput.m create mode 100644 sourcecodes/parameter_learning/code_backup/readInputData.m create mode 100644 sourcecodes/parameter_learning/code_backup/readInputStructure.m create mode 100644 sourcecodes/parameter_learning/code_backup/runBN_initial.m create mode 100644 sourcecodes/parameter_learning/code_backup/standardizeData.m create mode 100644 sourcecodes/parameter_learning/code_backup/writeParameters.m create mode 100644 sourcecodes/parameter_learning/code_backup/writeParameters_ev.m create mode 100644 sourcecodes/parameter_learning/code_backup/writeParameters_int.m (limited to 'sourcecodes') diff --git a/sourcecodes/BNW_workflow_net1.htm b/sourcecodes/BNW_workflow_net1.htm index e82f1f41..d69ddf84 100644 --- a/sourcecodes/BNW_workflow_net1.htm +++ b/sourcecodes/BNW_workflow_net1.htm @@ -291,8 +291,10 @@ ul

This tutorial provides -an overview of using BNW to build a Bayesian network model from a dataset and use the network to make predictions. The dataset used in this tutorial is a synthetic example of a genetic dataset that has a total of 8 variables. Two of the variables are genotypes labeled Geno1 and Geno2, and the remaining 6 variables are gene expression levels or other quantitative traits that are labeled Trait1 to Trait6. The dataset is available here.

The data file is formatted according to the guidelines on the BNW help page. The first row of the file contains the names of the variables and the remaining rows contain the data for each sample of the dataset. The genotypes (Geno1 and Geno2), which are the only discrete variables in the network, are the leftmost variables in the input file and are integer values (1 and 2) for all of the samples. The quantitative traits are continuous variables, and, therefore, all contain a "." in at least one of the samples.

+line-height:115%;font-family:"Arial","sans-serif"'> +**Recent updates to BNW may result in slight differences between what is described/shown below and what would currently be experienced in BNW.**

+This tutorial provides +an overview of using BNW to build a Bayesian network model from a dataset and use the network to make predictions. The dataset used in this tutorial is a synthetic example of a genetic dataset that has a total of 8 variables. Two of the variables are genotypes labeled Geno1 and Geno2, and the remaining 6 variables are gene expression levels or other quantitative traits that are labeled Trait1 to Trait6. The dataset is available here.

The data file is formatted according to the guidelines on the BNW help page. The first row of the file contains the names of the variables and the remaining rows contain the data for each sample of the dataset. The genotypes (Geno1 and Geno2), which are the only discrete variables in the network, are the leftmost variables in the input file and are integer values (1 and 2) for all of the samples. The quantitative traits are continuous variables, and, therefore, all contain a "." in at least one of the samples.

1. Structure learning using default options

@@ -322,7 +324,7 @@ normal'>In order to test if edges present the single best scoring network are conserved across high scoring networks. We can modify the structure learning settings to get identify the structures of many high scoring networks and perform model averaging over these structures. To do this, return to the BNW home page, select Learn a network model from data, and upload the datafile. Instead of using the default settings, select Go to structure learning settings and the BNW structural constraint interface. A more detailed overview of use of the structural constraint interface is provided in another tutorial, but, here, we will investigate the impact of modifying some of the structure learning settings shown below:


+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>In order to test if edges present the single best scoring network are conserved across high scoring networks. We can modify the structure learning settings to get identify the structures of many high scoring networks and perform model averaging over these structures. To do this, return to the BNW home page, select Learn a network model from data, and upload the datafile. Instead of using the default settings, select Go to structure learning settings and the BNW structural constraint interface. A more detailed overview of use of the structural constraint interface is provided in another tutorial, but, here, we will investigate the impact of modifying some of the structure learning settings shown below:


@@ -356,7 +358,7 @@ normal'>
To make predictions with the network, we will use the structure learned after model averaging of the top 100 highest scoring networks. First, we will use the model to compare the expected values for nodes in the network based on observed genotypes. For these predictions, we will keep the prediction in evidence mode. The difference between evidence and intervention modes is discussed in the BNW FAQ page. To use the model to make predictions based on Geno1, click on one of the blue bars in the Geno1 node and enter 1 or 2 to indicate which genotype value should be used to predict the values of the other network nodes. In the figure below, Geno1 is outlined in red and state 2 has a 100% probability, indicating that the value of this node has been entered as evidence. The red lines in the figure show the predicted distributions of the nodes after this evidence is known and can be compared with the blue lines which show the distributions for variables using the original data.


+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
To make predictions with the network, we will use the structure learned after model averaging of the top 100 highest scoring networks. First, we will use the model to compare the expected values for nodes in the network based on observed genotypes. For these predictions, we will keep the prediction in evidence mode. The difference between evidence and intervention modes is discussed in the BNW FAQ page. To use the model to make predictions based on Geno1, click on one of the blue bars in the Geno1 node and enter 1 or 2 to indicate which genotype value should be used to predict the values of the other network nodes. In the figure below, Geno1 is outlined in red and state 2 has a 100% probability, indicating that the value of this node has been entered as evidence. The red lines in the figure show the predicted distributions of the nodes after this evidence is known and can be compared with the blue lines which show the distributions for variables using the original data.


diff --git a/sourcecodes/BNW_workflow_sci.htm b/sourcecodes/BNW_workflow_sci.htm index 73451b4c..8adbc7b7 100644 --- a/sourcecodes/BNW_workflow_sci.htm +++ b/sourcecodes/BNW_workflow_sci.htm @@ -315,6 +315,12 @@ ul

+

+**Recent updates to BNW may result in slight differences between what is described/shown below and what would currently be experienced in BNW.** +

+

1. A genetic network linking genotype and phenotype

diff --git a/sourcecodes/add_evd.php b/sourcecodes/add_evd.php index 191dc244..92aca69f 100644 --- a/sourcecodes/add_evd.php +++ b/sourcecodes/add_evd.php @@ -2,7 +2,7 @@ $keyval=trim($_GET['My_key']); -include("restructuremap.php"); +//include("restructuremap.php"); function discretemap($textdata,$sym,$dmapdata) @@ -104,11 +104,6 @@ for($j=0;$j<$nn;$j++) } $dt=$type_d[$s]; - -//if($dt==1) -// $textdata=reversemap($sym,$textdata,$keyval); -//else -// $textdata=discretemap($textdata,$sym,$dmapdata); if($dt!=1) $textdata=discretemap($textdata,$sym,$dmapdata); diff --git a/sourcecodes/add_evd_example.php b/sourcecodes/add_evd_example.php index 03846663..a38d4474 100644 --- a/sourcecodes/add_evd_example.php +++ b/sourcecodes/add_evd_example.php @@ -2,7 +2,7 @@ $keyval=trim($_GET['My_key']); -include("restructuremap.php"); +//include("restructuremap.php"); function discretemap($textdata,$sym,$dmapdata) @@ -104,11 +104,6 @@ for($j=0;$j<$nn;$j++) } $dt=$type_d[$s]; - -//if($dt==1) -// $textdata=reversemap($sym,$textdata,$keyval); -//else -// $textdata=discretemap($textdata,$sym,$dmapdata); if($dt!=1) $textdata=discretemap($textdata,$sym,$dmapdata); @@ -189,7 +184,7 @@ else } - + // $file1="./data/".$keyval."run_evidencemodified.sh"; // $initiallines=file_get_contents("./data/temp_evidence_file"); // $all_lines="$initiallines"."$keyval\nfi\nexit"; diff --git a/sourcecodes/add_inv.php b/sourcecodes/add_inv.php index d9ec7cbb..c2953f85 100644 --- a/sourcecodes/add_inv.php +++ b/sourcecodes/add_inv.php @@ -1,5 +1,5 @@ @@ -51,18 +51,6 @@ if($searchID!="") - - - +

n0 root = i ; diff --git a/sourcecodes/bnt-master/graph/findroot.m~ b/sourcecodes/bnt-master/graph/findroot.m~ new file mode 100644 index 00000000..d242a3a3 --- /dev/null +++ b/sourcecodes/bnt-master/graph/findroot.m~ @@ -0,0 +1,24 @@ +function root = findroot(bnet, cliques) + +%% findroot is to find the strong root in a clique tree assume it has one +%% in the tree. For a clique tree constructed from a strongly triangulated +%% graph, an interface clique that contains all discrete parents +%% and at least one continuous node from a connected continuous component +%% is for sure to be available as a guaranteed strong root. +%% -By Wei Sun, George Mason University, 4/17/2010. + +%% We choose the interface clique that contains the max number +%% of interface nodes to be the strong root. +n0 = 0 ; +for i=1:length(cliques) + % check hybrid cliques + hc = intersect(cliques{i}, bnet.cnodes) ; + hd = intersect(cliques{i}, bnet.dnodes) ; + if ~isempty(hd) & ~isempty(hc) + nd = length(hd) ; + if nd > n0 + root = i ; + n0 = nd ; + end + end +end diff --git a/sourcecodes/create_tiers_gom.php b/sourcecodes/create_tiers_gom.php index 0f332eef..be8e2fc2 100644 --- a/sourcecodes/create_tiers_gom.php +++ b/sourcecodes/create_tiers_gom.php @@ -90,6 +90,9 @@ $runtime=exe_time($keyval,$parent_number,$k_number);