From 9d22fe88365c96a092febeab9cef7775dcb5a773 Mon Sep 17 00:00:00 2001
From: Sam Ockman
Date: Sun, 15 Jul 2012 21:17:49 -0400
Subject: Continuing trait data table in js
---
wqflask/wqflask/dataSharing/SharingInfo.py | 19 +------
wqflask/wqflask/show_trait/DataEditingPage.py | 24 ++++-----
.../new/javascript/trait_data_and_analysis.coffee | 60 ++++++++++++++++++++++
.../new/javascript/trait_data_and_analysis.js | 52 ++++++++++++++++++-
.../wqflask/templates/trait_data_and_analysis.html | 6 ++-
5 files changed, 129 insertions(+), 32 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/dataSharing/SharingInfo.py b/wqflask/wqflask/dataSharing/SharingInfo.py
index 4845b5c8..289754d0 100755
--- a/wqflask/wqflask/dataSharing/SharingInfo.py
+++ b/wqflask/wqflask/dataSharing/SharingInfo.py
@@ -60,8 +60,6 @@ class SharingInfo(object):
About_Array_Platform, About_Data_Values_Processing,
Data_Source_Acknowledge, Progreso """
- #InfoRecord = namedtuple('InfoRecord', field_names)
-
# We can use string interpolation here cause we own the string
sql = """select %s from InfoFiles where """ % (field_names)
if(self.GN_AccessionId):
@@ -73,20 +71,8 @@ class SharingInfo(object):
else:
raise 'No correct parameter found'
info = cursor.fetchone()
- print("432 info:", info)
- print("type(info):", type(info))
- #info = InfoRecord._make(info)
- info = todict(field_names, info)
- # We need to edit info so we convert it to a dict...
- #info = info._asdict()
- print("q888 info.Title:", info['Title'])
-
- print("info type is:", type(info))
- #new_about_cases = unicode(info.About_Cases, "utf-8")
- #print("new_about_cases is:", new_about_cases)
-
- #info['About_Cases'] = unicode(info['About_Cases'], "utf-8")
+ info = todict(field_names, info)
# fetch datasets file list
try:
@@ -130,8 +116,7 @@ class SharingInfo(object):
htmlfilelist += ""
else:
htmlfilelist = "Data sets are not available or are not public yet."
- print("333 info is:", pf(info))
- print("333 keys:", pf(info))
+
return info, htmlfilelist
#return SharingBody.sharinginfo_body_string % (info[31], info[32], infoupdate, info[32], info[1], info[3], info[30], info[4], info[27], info[33], info[2], info[23], info[26], info[11], info[15], info[16], info[18], info[19], info[20], info[21], info[22], info[13], info[12], info[14], info[14], htmlfilelist, info[6], info[35], info[36], info[37], info[38], info[39], info[40], info[5], info[7], info[8], info[9], info[10], info[17], info[24])
diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py
index 81bb3a92..610124ae 100755
--- a/wqflask/wqflask/show_trait/DataEditingPage.py
+++ b/wqflask/wqflask/show_trait/DataEditingPage.py
@@ -213,18 +213,18 @@ class DataEditingPage(templatePage):
self.hddn = hddn
self.basic_table = {}
- self.basic_table['rows'] = yaml.load("""
- - N of Samples
- - Mean
- - Median
- - Standard Error (SE)
- - Standard Deviation (SD)
- - Minimum
- - Maximum
- - Range (log2)
- - Range (fold)
- - Interquartile Range
- """)
+ #self.basic_table['rows'] = yaml.load("""
+ # - N of Samples
+ # - Mean
+ # - Median
+ # - Standard Error (SE)
+ # - Standard Deviation (SD)
+ # - Minimum
+ # - Maximum
+ # - Range (log2)
+ # - Range (fold)
+ # - Interquartile Range
+ # """)
self.basic_table['columns'] = yaml.load("""
- All Cases
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
index 380d0a5a..d3817f99 100644
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
+++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
@@ -55,6 +55,66 @@ $ ->
the_values.push(parseFloat(real_value))
mean(the_values)
+ make_table = ->
+ header = ""
+ for column in basic_table['columns']
+ the_id = process_id("column_" + column)
+ header += """ "
+
+ rows = [
+ {
+ vn: "n_of_samples"
+ pretty: "N of Samples"
+ },
+ {
+ vn: "mean"
+ pretty: "Mean"
+ },
+ {
+ vn: "median"
+ pretty: "median"
+ },
+ {
+ vn: "se"
+ pretty: "Standard Error (SE)"
+ }
+ ]
+
+ console.log("rows are:", rows)
+ the_rows = "#{ column } """
+ header += "