diff options
author | Sam Ockman | 2012-06-12 04:36:47 -0400 |
---|---|---|
committer | Sam Ockman | 2012-06-12 04:36:47 -0400 |
commit | b4c536fa8e94643f8cbd37f9fb1db18b2ab52263 (patch) | |
tree | 176d7c395d13b10fe2145ccb72bf406364abc0f3 | |
parent | be2baf17cba5468d901f8e2d8818fe558e2ee5fe (diff) | |
download | genenetwork2-b4c536fa8e94643f8cbd37f9fb1db18b2ab52263.tar.gz |
More progress on data trait and analysis
-rw-r--r-- | wqflask/other_config/nginx.conf | 6 | ||||
-rwxr-xr-x | wqflask/wqflask/show_trait/DataEditingPage.py | 25 | ||||
-rw-r--r-- | wqflask/wqflask/templates/trait_data_and_analysis.html | 28 | ||||
-rw-r--r-- | 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 @@ <table class="target2" cellpadding="0" cellspacing="0" width="100%"> <tr> <td> - <div class="ui-tabs" id="stats_tabs0"> + {% for sd in stats_data %} + <div class="ui-tabs" id="{{ 'stats_tabs%i' % loop.index0 }}"> <ul> <li><a href="#statstabs-1" class="stats_tab">Basic Table</a></li> @@ -294,62 +295,62 @@ <tr align="right"> <td class="fs13 b1 cbw c222" align="left">N of Samples</td> - <td class="fs13 b1 cbw c222" nowrap="yes">99</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ sd.N }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Mean</td> - <td class="fs13 b1 cbw c222" nowrap="yes">6.129</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.traitmean }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Median</td> - <td class="fs13 b1 cbw c222" nowrap="yes">6.105</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.traitmedian }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Standard Error (SE)</td> - <td class="fs13 b1 cbw c222" nowrap="yes">0.018</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.traitsem }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Standard Deviation (SD)</td> - <td class="fs13 b1 cbw c222" nowrap="yes">0.182</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.traitstdev }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Minimum</td> - <td class="fs13 b1 cbw c222" nowrap="yes">5.782</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.min }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Maximum</td> - <td class="fs13 b1 cbw c222" nowrap="yes">6.579</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.max }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left">Range (log2)</td> - <td class="fs13 b1 cbw c222" nowrap="yes">0.797</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.range_log2 }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left"><span>Range (fold)</span></td> - <td class="fs13 b1 cbw c222" nowrap="yes">1.74</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.range_fold }}</td> </tr> <tr align="right"> <td class="fs13 b1 cbw c222" nowrap="yes" align="left"><span><a href="/glossary.html#Interquartile" target="_blank" class= "non_bold">Interquartile Range</a></span></td> - <td class="fs13 b1 cbw c222" nowrap="yes">1.18</td> + <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.interquartile }} </td> </tr> </table> </td> @@ -402,7 +403,8 @@ </table> </div> </div> - + {% endfor %} + {# Not used now - Todo: Delete after we're sure this is right. <div class="ui-tabs" id="stats_tabs1"> <ul> <li><a href="#statstabs-1" class="stats_tab">Basic Table</a></li> @@ -540,6 +542,8 @@ </div> <div class="ui-tabs" id="stats_tabs2"> + + #} <ul> <li><a href="#statstabs-1" class="stats_tab">Basic Table</a></li> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 58eeddd3..c15f4ba1 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -26,4 +26,5 @@ def showDatabaseBXD(): # Here it's currently too complicated not to use an fd that is a webqtlFormData fd = webqtlFormData.webqtlFormData(request.args) template_vars = show_trait_page.ShowTraitPage(fd) + print("showDatabaseBXD template_vars:", pf(template_vars.__dict__)) return render_template("trait_data_and_analysis.html", **template_vars.__dict__) |