From 984030cbff9c8f49a664df7c693f852f6d09b2e5 Mon Sep 17 00:00:00 2001 From: zsloan Date: Sat, 4 Apr 2020 20:23:34 -0500 Subject: Changed Y axis on permutation histogram from Frequency to Count --- wqflask/wqflask/templates/mapping_results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index 86816d17..c046f7fb 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -490,7 +490,7 @@ }, yaxis: { autorange: true, - title: "Frequency", + title: "Count", titlefont: { family: "arial", size: 20 -- cgit v1.2.3 From 9e6b8a2b2adfb4b41867ecd6932ce899872eea9e Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 6 Apr 2020 17:41:19 -0500 Subject: Added Mean column for phenotype traits in search and global search result tables --- wqflask/base/data_set.py | 2 ++ wqflask/base/trait.py | 5 +++-- wqflask/wqflask/do_search.py | 1 + wqflask/wqflask/gsearch.py | 7 ++++++- wqflask/wqflask/search_results.py | 3 +++ wqflask/wqflask/templates/gsearch_pheno.html | 6 ++++++ wqflask/wqflask/templates/search_result_page.html | 7 +++++++ 7 files changed, 28 insertions(+), 3 deletions(-) diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 5b32c5ae..ebf3f021 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -710,6 +710,7 @@ class PhenotypeDataSet(DataSet): 'Phenotype.Pre_publication_description', 'Phenotype.Pre_publication_abbreviation', 'Phenotype.Post_publication_abbreviation', + 'PublishXRef.mean', 'Phenotype.Lab_code', 'Publication.PubMed_ID', 'Publication.Abstract', @@ -725,6 +726,7 @@ class PhenotypeDataSet(DataSet): 'original_description', 'pre_publication_abbreviation', 'post_publication_abbreviation', + 'mean', 'lab_code', 'submitter', 'owner', 'authorized_users', diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 8e779a11..5525472e 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -354,7 +354,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): SELECT PublishXRef.Id, InbredSet.InbredSetCode, Publication.PubMed_ID, Phenotype.Pre_publication_description, Phenotype.Post_publication_description, Phenotype.Original_description, - Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation, + Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation, PublishXRef.mean, Phenotype.Lab_code, Phenotype.Submitter, Phenotype.Owner, Phenotype.Authorized_Users, Publication.Authors, Publication.Title, Publication.Abstract, Publication.Journal, Publication.Volume, Publication.Pages, @@ -503,8 +503,9 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): #LRS and its location trait.LRS_score_repr = "N/A" trait.LRS_location_repr = "N/A" - trait.locus = trait.locus_chr = trait.locus_mb = trait.lrs = trait.pvalue = trait.mean = trait.additive = "" + trait.locus = trait.locus_chr = trait.locus_mb = trait.lrs = trait.pvalue = trait.additive = "" if dataset.type == 'ProbeSet' and not trait.cellid: + trait.mean = "" query = """ SELECT ProbeSetXRef.Locus, ProbeSetXRef.LRS, ProbeSetXRef.pValue, ProbeSetXRef.mean, ProbeSetXRef.additive diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index b56a858a..05caa100 100644 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -218,6 +218,7 @@ class PhenotypeSearch(DoSearch): header_fields = ['Index', 'Record', 'Description', + 'Mean', 'Authors', 'Year', 'Max LRS', diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 12813e9a..3d9b508a 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -139,7 +139,8 @@ class GSearch(object): Publication.`PubMed_ID`, PublishXRef.`LRS`, PublishXRef.`additive`, - InbredSet.`InbredSetCode` + InbredSet.`InbredSetCode`, + PublishXRef.`mean` FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication WHERE PublishXRef.`InbredSetId`=InbredSet.`Id` AND PublishFreeze.`InbredSetId`=InbredSet.`Id` @@ -183,6 +184,10 @@ class GSearch(object): this_trait['description'] = line[5].decode('utf-8', 'replace') else: this_trait['description'] = "N/A" + if line[13] != None and line[13] != "": + this_trait['mean'] = line[13] + else: + this_trait['mean'] = "N/A" this_trait['authors'] = line[7] this_trait['year'] = line[8] if this_trait['year'].isdigit(): diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index 34c647f4..698389ab 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -143,6 +143,9 @@ views.py). trait_dict['pubmed_id'] = this_trait.pubmed_id trait_dict['pubmed_link'] = this_trait.pubmed_link trait_dict['pubmed_text'] = this_trait.pubmed_text + trait_dict['mean'] = "N/A" + if this_trait.mean != "" and this_trait.mean != None: + trait_dict['mean'] = '%.3f' % this_trait.mean trait_dict['lrs_score'] = this_trait.LRS_score_repr trait_dict['lrs_location'] = this_trait.LRS_location_repr trait_dict['additive'] = "N/A" diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 4d5238ef..f6ffff47 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -189,6 +189,12 @@ } } }, + { + 'title': "Mean", + 'type': "natural", + 'width': "10%", + 'data': "mean" + }, { 'title': "Authors", 'type': "natural", diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 13457030..162bde08 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -349,6 +349,13 @@ } } }, + { + 'title': "Mean", + 'type': "natural", + 'width': "110px", + 'data': "mean", + 'orderSequence': [ "desc", "asc"] + }, { 'title': "Authors", 'type': "natural", -- cgit v1.2.3 From 10d1decc85f6018b5603e7a7d11938b267b57f6f Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 13 Apr 2020 18:06:40 -0500 Subject: Fixed issue that caused export for HET3-ITP traits to not work due to the backslash in one of the case attribute names + added a couple links for stats table items --- wqflask/wqflask/static/new/javascript/show_trait.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 003e0a90..28d13345 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -73,10 +73,12 @@ Stat_Table_Rows.push( }, { vn: "skewness", pretty: "Skewness", + url: "https://en.wikipedia.org/wiki/Skewness", digits: 3 }, { vn: "kurtosis", - pretty: "Kurtosis", + pretty: "Excess Kurtosis", + url: "https://en.wikipedia.org/wiki/Kurtosis", digits: 3 } ); @@ -389,7 +391,7 @@ make_table = function() { } row_line = ""; if (row.url != null) { - row_line += "" + row.pretty + ""; + row_line += "" + row.pretty + ""; } else { row_line += "" + row.pretty + ""; } @@ -839,7 +841,7 @@ get_sample_table_data = function(table_name) { for (key in _ref) { if (!__hasProp.call(_ref, key)) continue; attribute_info = _ref[key]; - row_data[attribute_info.name] = $.trim($(element).find('.column_name-' + attribute_info.name.replace(" ", "_")).text()); + row_data[attribute_info.name] = $.trim($(element).find('.column_name-' + attribute_info.name.replace(" ", "_").replace("/", "\\/")).text()); } return samples.push(row_data); }; -- cgit v1.2.3 From 9db80a6f01da97b90dd8de7162af557ce062d3e4 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 13 Apr 2020 18:09:18 -0500 Subject: Changed Locus to Marker in table and fixed an issue with trying to zoom in on a chromosome after downloading permutation results --- wqflask/wqflask/templates/mapping_results.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index c046f7fb..ba0ebef9 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -207,7 +207,7 @@


- Total of {{ nperm }} permutations  Download Permutation Results + Total of {{ nperm }} permutations  Download Permutation Results
{% endif %} @@ -229,7 +229,7 @@ Row - Locus + Marker {{ LRS_LOD }} Chr {% if plotScale != "physic" %} @@ -426,6 +426,7 @@ $('input[name=selected_chr]').val(this_chr) $('input[name=chr_mb_list]').val(chr_mb_list) + $('#marker_regression_form').attr('action', '/run_mapping'); return $('#marker_regression_form').submit(); }; @@ -435,24 +436,26 @@ $('input[name=endMb]').val(end_mb) //$('input[name=mb_range]').val(start_mb + "," + end_mb) + $('#marker_regression_form').attr('action', '/run_mapping'); return $('#marker_regression_form').submit(); }; remap = function() { $('input[name=selected_chr]').val($('select[name=chromosomes]').val()); + $('#marker_regression_form').attr('action', '/run_mapping'); return $('#marker_regression_form').submit(); }; {% if mapping_method != "gemma" and mapping_method != "plink" %} - export_perm_data = function() { - var num_perm, perm_data; + $('#download_perm').click(function(){ + var num_perm, perm_data; num_perm = js_data.num_perm perm_data = js_data.perm_results json_perm_data = JSON.stringify(perm_data); $('input[name=perm_results]').val(json_perm_data); $('#marker_regression_form').attr('action', '/export_perm_data'); return $('#marker_regression_form').submit(); - } + }); modebar_options = { modeBarButtonsToAdd:[{ -- cgit v1.2.3