about summary refs log tree commit diff
path: root/sourcecodes/kfold_plotly.py
diff options
context:
space:
mode:
authorziejd22021-02-24 15:19:03 -0600
committerziejd22021-02-24 15:19:03 -0600
commit1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0 (patch)
treed4356879a9b0a3d44063a6b292ef0197173697af /sourcecodes/kfold_plotly.py
parenta2b306b10fb07f07c63235861ccfe460153e8609 (diff)
downloadBNW-1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0.tar.gz
Moving final GENENET8 version to master
Diffstat (limited to 'sourcecodes/kfold_plotly.py')
-rw-r--r--sourcecodes/kfold_plotly.py34
1 files changed, 11 insertions, 23 deletions
diff --git a/sourcecodes/kfold_plotly.py b/sourcecodes/kfold_plotly.py
index 102d01d2..66f08143 100644
--- a/sourcecodes/kfold_plotly.py
+++ b/sourcecodes/kfold_plotly.py
@@ -1,13 +1,15 @@
-#!/var/www/html/compbio/BNW_1.3/bnw-env/bin/python
+#!/home/jziebart/python/Python-2.7.15/python
 import os
 import sys
 
+#sys.path.append('/home/jziebart/.local/bin')
+#sys.path.append('/home/jziebart/.local/lib')
+
 import plotly
 import plotly.graph_objs as go
 import csv
 import string
 
-
 netID = sys.argv[-1]
 
 outfile = netID+"kfold_plotly.html"
@@ -17,12 +19,11 @@ f=open(filename,"r")
 #Read the first line to get the variable name
 lines=f.readlines()
 line = lines.pop()
-#line = map(string.strip,line.strip().split(" "))
-line = line.strip().split(" ")
+line = map(string.strip,line.strip().split(" "))
 #print line
 varName = line[3][:-1]
 #print varName
-plot_title = varName+' k-fold validation'
+plot_title = '<br>'+varName+' k-fold validation'
 #print plot_title
 header = lines.pop(0)
 
@@ -30,11 +31,9 @@ header = lines.pop(0)
 typefile = netID+"type.txt"
 tf=open(typefile,"r")
 line=tf.readline()
-#varnames = map(string.strip,line.strip().split("\t"))
-varnames = line.strip().split("\t")
+varnames = map(string.strip,line.strip().split("\t"))
 line=tf.readline()
-#vartypes = map(string.strip,line.strip().split("\t"))
-vartypes = line.strip().split("\t")
+vartypes = map(string.strip,line.strip().split("\t"))
 varindex = varnames.index(varName)
 cd_type = int(vartypes[varindex])
 
@@ -50,8 +49,7 @@ if cd_type == 1:
 #    line = f.readline()
 #    while line:
     for line in lines:
-        #line = map(string.strip,line.strip().split("\t"))
-        line = line.strip().split("\t")
+        line = map(string.strip,line.strip().split("\t"))
         x.append(float(line[2]))
         y.append(float(line[3]))
 #        line=f.readline()
@@ -64,10 +62,6 @@ if cd_type == 1:
             size=24,
             color='black'
             ),
-	title_xref="paper",
-	title_x=0.5,
-	title_xanchor="center",
-	title_yanchor="middle",
         xaxis=dict(
             autorange=True,
             title='Actual values',
@@ -97,8 +91,7 @@ else:
 #    for i in range(5):
 #        line = f.readline()
     #Get names of states
-    #header = map(string.strip,header.strip().split("\t"))
-    header = header.strip().split("\t")
+    header = map(string.strip,header.strip().split("\t"))
     states = header[3:]
     #Read the data
     actual = []
@@ -106,8 +99,7 @@ else:
 #    line = f.readline()
 #    while line:
     for line in lines:
-        #line = map(string.strip,line.strip().split("\t"))
-        line = line.strip().split("\t")
+        line = map(string.strip,line.strip().split("\t"))
         actual.append(line[2])
         predict_x = line[3:]
         predict_x = [float(x) for x in predict_x]
@@ -155,10 +147,6 @@ else:
             size=24,
             color='black'
             ),
-	title_xref="paper",	
-	title_x=0.5,
-	title_xanchor="center",
-	title_yanchor="middle",
         xaxis=dict(
             autorange=True,
             title='State',