From c599ccf86e8db0f031007937dbdfe0da4b0e56e7 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 6 Sep 2012 17:21:11 -0500 Subject: Put the correlation tool options into the template and wrote some coffee script to automatically change the description text below. --- wqflask/wqflask/show_trait/DataEditingPage.py | 53 +- .../new/javascript/trait_data_and_analysis.coffee | 22 +- .../new/javascript/trait_data_and_analysis.js | 19 +- .../wqflask/templates/trait_data_and_analysis.html | 2029 ++------------------ 4 files changed, 177 insertions(+), 1946 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py index affcd449..d619f26c 100755 --- a/wqflask/wqflask/show_trait/DataEditingPage.py +++ b/wqflask/wqflask/show_trait/DataEditingPage.py @@ -232,17 +232,31 @@ class DataEditingPage(templatePage): # - Interquartile Range # """) - self.basic_table['columns'] = yaml.load(""" - - - n: All Cases - t: all - - - n: BXD Only - t: primary - - - n: Non-BXD Only - t: other - """) + #self.sample_groups = [] + #self.sample_groups.append(dict(label=fd.RISet + " Only", + # value="primary_only")) + #self.sample_groups.append(dict(label="Non-"+fd.RISet, + # value="other_only")) + #self.sample_groups.append(dict(label="All Cases", + # value="all_cases")) + + self.sample_groups = OrderedDict() + self.sample_groups['primary_only'] = fd.RISet + " Only" + self.sample_groups['other_only'] = "Non-" + fd.RISet + self.sample_groups['all_cases'] = "All Cases" + + + #self.basic_table['columns'] = yaml.load(""" + # - + # n: All Cases + # t: all + # - + # n: BXD Only + # t: primary + # - + # n: Non-BXD Only + # t: other + # """) print(pf(self.basic_table)) @@ -1160,7 +1174,7 @@ class DataEditingPage(templatePage): (RISetgp, webqtlConfig.PUBLICTHRESH)) for item in self.cursor.fetchall(): dataset_menu.append(dict(tissue=None, - datasets=item)) + datasets=[item])) self.cursor.execute('''SELECT GenoFreeze.FullName,GenoFreeze.Name FROM GenoFreeze, InbredSet WHERE GenoFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = @@ -1168,7 +1182,7 @@ class DataEditingPage(templatePage): (RISetgp, webqtlConfig.PUBLICTHRESH)) for item in self.cursor.fetchall(): dataset_menu.append(dict(tissue=None, - datasets=item)) + datasets=[item])) #03/09/2009: Xiaodong changed the SQL query to order by Name as requested by Rob. self.cursor.execute('SELECT Id, Name FROM Tissue order by Name') @@ -1195,16 +1209,14 @@ class DataEditingPage(templatePage): dataset_menu_selected = None if len(dataset_menu): if thisTrait and thisTrait.db: - dataset_menu_selected = thisTrait.db.fullname + dataset_menu_selected = thisTrait.db.name #criteriaText = HT.Span("Return:", Class="ffl fwb fs12") #criteriaMenu1 = HT.Select(name='criteria1', selected='500', onMouseOver="if (NS4 || IE4) activateEl('criterias', event);") - return_results_menu = [] - - for counter in (100, 200, 500, 1000, 2000, 5000, 10000, 15000, 20000): - return_results_menu.append(('top %s' % (counter,), str(counter))) + return_results_menu = (100, 200, 500, 1000, 2000, 5000, 10000, 15000, 20000) + return_results_menu_selected = 500 #criteriaMenu1.append(('top 100','100')) #criteriaMenu1.append(('top 200','200')) @@ -1334,9 +1346,10 @@ class DataEditingPage(templatePage): #submitTable.append(corr_script) # #title3Body.append(submitTable) - self.correlation_tools = dict(dataset_menu = dataset_menu, + self.corr_tools = dict(dataset_menu = dataset_menu, dataset_menu_selected = dataset_menu_selected, - return_results_menu = return_results_menu) + return_results_menu = return_results_menu, + return_results_menu_selected = return_results_menu_selected,) def dispMappingTools(self, fd, title4Body, thisTrait): 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 77415d32..f13dc5bf 100644 --- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee +++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee @@ -11,7 +11,6 @@ $ -> hide_tabs(1) - # Changes stats table between all, bxd only and non-bxd, etc. stats_mdp_change = -> selected = $(this).val() @@ -20,7 +19,6 @@ $ -> $(".stats_mdp").change(stats_mdp_change) - update_stat_values = (the_values)-> for category in ['primary', 'other', 'all'] id = "#" + process_id(category, "mean") @@ -153,7 +151,25 @@ $ -> console.log("Found Show Outliers") $('#show_hide_outliers').val("Hide Outliers") console.log("Should be now Hide Outliers") - + + ### + Calculate Correlations Code + ### + + on_corr_method_change = -> + console.log("in beginning of on_corr_method_change") + corr_method = $('select[name=corr_method]').val() + console.log("corr_method is:", corr_method) + $('.correlation_desc').hide() + $('#' + corr_method + "_r_desc").show().effect("highlight") + + $('select[name=corr_method]').change(on_corr_method_change) + + ### + End Calculate Correlations Code + ### + + console.log("before registering show_hide_outliers") $('#show_hide_outliers').click(show_hide_outliers) console.log("after registering show_hide_outliers") diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js index 6357a7da..96b245ea 100644 --- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js +++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js @@ -10,7 +10,7 @@ }; $(function() { - var edit_data_change, hide_tabs, make_table, process_id, show_hide_outliers, stats_mdp_change, update_stat_values; + var edit_data_change, hide_tabs, make_table, on_corr_method_change, process_id, show_hide_outliers, stats_mdp_change, update_stat_values; hide_tabs = function(start) { var x, _i, _results; _results = []; @@ -186,6 +186,23 @@ return console.log("Should be now Hide Outliers"); } }; + /* + Calculate Correlations Code + */ + + on_corr_method_change = function() { + var corr_method; + console.log("in beginning of on_corr_method_change"); + corr_method = $('select[name=corr_method]').val(); + console.log("corr_method is:", corr_method); + $('.correlation_desc').hide(); + return $('#' + corr_method + "_r_desc").show().effect("highlight"); + }; + $('select[name=corr_method]').change(on_corr_method_change); + /* + End Calculate Correlations Code + */ + console.log("before registering show_hide_outliers"); $('#show_hide_outliers').click(show_hide_outliers); console.log("after registering show_hide_outliers"); diff --git a/wqflask/wqflask/templates/trait_data_and_analysis.html b/wqflask/wqflask/templates/trait_data_and_analysis.html index 3644b436..f6917a90 100644 --- a/wqflask/wqflask/templates/trait_data_and_analysis.html +++ b/wqflask/wqflask/templates/trait_data_and_analysis.html @@ -10,14 +10,14 @@
{# - - + + - - - - - + + + + + @@ -240,13 +240,15 @@

  Basic Statistics

-

Include:
+ +

Include: +



@@ -693,14 +695,6 @@
- -
@@ -709,1914 +703,105 @@
- - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - -
Database:Method: + +
Database: + +
Return:
Return:
Samples:

- Pearson    Spearman Rank
-
-
-
- The Sample Correlation is computed - between trait data and any
- other traits in the sample database selected above. Use Spearman - Rank
- when the sample size is small (<20) or when there are influential outliers.
- - - -
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - -
Database:
Return:
Samples:

-
-
- The Literature Correlation (Lit r) between this - gene and all other genes is computed
- using the Semantic Gene Organizer and human, rat, and - mouse data from PubMed.
- Values are ranked by Lit r, but Sample r and Tissue r are also displayed.
-
- More on using Lit r
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - - + +
Database:
Return:
Samples: + +

- Pearson    Spearman Rank
+ Pearson    Spearman Rank

-
+

+ + The Sample Correlation + is computed + between trait data and any
+ other traits in the sample database selected above. Use + Spearman + Rank
+ when the sample size is small (<20) or when there are influential outliers. +
+ +
- The Tissue Correlation (Tissue r) - estimates the similarity of expression of two genes
- or transcripts across different cells, tissues, or organs (glossary). Tissue correlations
- are generated by analyzing expression in multiple samples usually taken from single cases.
- Pearson and Spearman Rank correlations have been computed for all pairs of genes
- using data from mouse samples.
-- cgit v1.2.3