From b4c536fa8e94643f8cbd37f9fb1db18b2ab52263 Mon Sep 17 00:00:00 2001 From: Sam Ockman Date: Tue, 12 Jun 2012 04:36:47 -0400 Subject: More progress on data trait and analysis --- wqflask/other_config/nginx.conf | 6 ++++- wqflask/wqflask/show_trait/DataEditingPage.py | 25 +++++++++++-------- .../wqflask/templates/trait_data_and_analysis.html | 28 ++++++++++++---------- wqflask/wqflask/views.py | 1 + 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/wqflask/other_config/nginx.conf b/wqflask/other_config/nginx.conf index 93e6af10..65ee768c 100644 --- a/wqflask/other_config/nginx.conf +++ b/wqflask/other_config/nginx.conf @@ -49,6 +49,10 @@ http { root /home/sam/gene/wqflask/wqflask/static/; } +# location ^~ /image/ { +# root /home/sam/gene/wqflask/wqflask/static/; +# } + location ^~ /images/ { root /home/sam/gene/wqflask/wqflask/static/; } @@ -60,7 +64,7 @@ http { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } + } } diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py index a496a919..d5238828 100755 --- a/wqflask/wqflask/show_trait/DataEditingPage.py +++ b/wqflask/wqflask/show_trait/DataEditingPage.py @@ -853,6 +853,8 @@ class DataEditingPage(templatePage): primary_strains = [] #XZ: strain of primary group, e.g., BXD, LXS #MDP_menu = HT.Select(name='stats_mdp', Class='stats_mdp') + MDP_menu = [] # We're going to use the same named data structure as in the old version + # but repurpose it for Jinja2 as an array for strain in thisTrait.data.keys(): strainName = strain.replace("_2nd_", "") @@ -872,21 +874,24 @@ class DataEditingPage(templatePage): primary_strains = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + primary_strains #XZ: note that fd.f1list and fd.parlist are added. all_strains = primary_strains + other_strains other_strains = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + other_strains #XZ: note that fd.f1list and fd.parlist are added. - #MDP_menu.append(('All Cases','0')) - #MDP_menu.append(('%s Only' % fd.RISet,'1')) - #MDP_menu.append(('Non-%s Only' % fd.RISet,'2')) + print("ac1") # This is the one used for first sall3 + MDP_menu.append(('All Cases','0')) + MDP_menu.append(('%s Only' % fd.RISet, '1')) + MDP_menu.append(('Non-%s Only' % fd.RISet, '2')) #stats_row.append("Include: ", MDP_menu, HT.BR(), HT.BR()) else: if (len(other_strains) > 0) and (len(primary_strains) + len(other_strains) > 3): - #MDP_menu.append(('All Cases','0')) - #MDP_menu.append(('%s Only' % fd.RISet,'1')) - #MDP_menu.append(('Non-%s Only' % fd.RISet,'2')) + print("ac2") + MDP_menu.append(('All Cases','0')) + MDP_menu.append(('%s Only' % fd.RISet,'1')) + MDP_menu.append(('Non-%s Only' % fd.RISet,'2')) #stats_row.append("Include: ", MDP_menu, " "*3) all_strains = primary_strains all_strains.sort(key=webqtlUtil.natsort_key) all_strains = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + all_strains primary_strains = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + primary_strains else: + print("ac3") all_strains = strainlist other_strains.sort(key=webqtlUtil.natsort_key) @@ -962,7 +967,7 @@ class DataEditingPage(templatePage): vals_set = [vals] #stats_script = HT.Script(language="Javascript") #script needed for tabs - + self.stats_data = [] for i, vals in enumerate(vals_set): if i == 0 and len(vals) < 4: stats_container = HT.Div(id="stats_tabs", style="padding:10px;", Class="ui-tabs") #Needed for tabs; notice the "stats_script_text" below referring to this element @@ -994,11 +999,11 @@ class DataEditingPage(templatePage): if thisTrait.db: if thisTrait.cellid: - statsTableCell = BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=thisTrait.db.type, cellid=thisTrait.cellid) + self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=thisTrait.db.type, cellid=thisTrait.cellid)) else: - statsTableCell = BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=thisTrait.db.type) + self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=thisTrait.db.type)) else: - statsTableCell = BasicStatisticsFunctions.basicStatsTable(vals=vals) + self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals)) #statsTable.append(HT.TR(HT.TD(statsTableCell))) diff --git a/wqflask/wqflask/templates/trait_data_and_analysis.html b/wqflask/wqflask/templates/trait_data_and_analysis.html index 122bafd9..f77d22d4 100644 --- a/wqflask/wqflask/templates/trait_data_and_analysis.html +++ b/wqflask/wqflask/templates/trait_data_and_analysis.html @@ -267,7 +267,8 @@
-
+ {% for sd in stats_data %}
+
N of Samples |
- 99 |
+ {{ sd.N }} |
Mean |
- 6.129 |
+ {{ "%2.3f" % sd.traitmean }} |
Median |
- 6.105 |
+ {{ "%2.3f" % sd.traitmedian }} |
Standard Error (SE) |
- 0.018 |
+ {{ "%2.3f" % sd.traitsem }} |
Standard Deviation (SD) |
- 0.182 |
+ {{ "%2.3f" % sd.traitstdev }} |
Minimum |
- 5.782 |
+ {{ "%2.3f" % sd.min }} |
Maximum |
- 6.579 |
+ {{ "%2.3f" % sd.max }} |
Range (log2) |
- 0.797 |
+ {{ "%2.3f" % sd.range_log2 }} |
Range (fold) |
- 1.74 |
+ {{ "%2.3f" % sd.range_fold }} |
Interquartile Range |
- 1.18 |
+ {{ "%2.3f" % sd.interquartile }} |
|