From b5609975d5752f61a85ec4e0bbf309eac4b01e7c Mon Sep 17 00:00:00 2001 From: Preeti Date: Wed, 8 Jan 2020 08:53:45 -0500 Subject: [PATCH] Ps mp undo filters (#187) * revert the filters * fix the dataset dropdown - change the default selected dataset * add dataset * updated number of datasets and phenotypes on home page Co-authored-by: mariacos --- grails-app/views/trait/_traitTableHeader.gsp | 14 ++-- .../js/lib/dport/manhattanplotTableHeader.js | 71 ++++++++++--------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/grails-app/views/trait/_traitTableHeader.gsp b/grails-app/views/trait/_traitTableHeader.gsp index b9fa09c37..b55aa5ba1 100755 --- a/grails-app/views/trait/_traitTableHeader.gsp +++ b/grails-app/views/trait/_traitTableHeader.gsp @@ -22,6 +22,7 @@ $( document ).ready(function() { mpgSoftware.manhattanplotTableHeader.fillSampleGroupDropdown('<%=phenotypeKey%>'); + mpgSoftware.manhattanplotTableHeader.fillPhenotypesDropdownNew('T2D', '<%=phenotypeKey%>'); mpgSoftware.manhattanplotTableHeader.fillPhenotypesDropdown('<%=params.trait%>' || 'T2D', 'manhattanPhenotypeDropdownWrapper','phenotypeDropdown'); mpgSoftware.manhattanplotTableHeader.fillRegionalTraitAnalysis('<%=phenotypeKey%>',''); }); @@ -41,23 +42,20 @@

Phenotype

+ - %{----}% - -

Dataset  

- + ;
-
+

r2 threshold  

- diff --git a/web-app/js/lib/dport/manhattanplotTableHeader.js b/web-app/js/lib/dport/manhattanplotTableHeader.js index 81ffd80c3..620032716 100644 --- a/web-app/js/lib/dport/manhattanplotTableHeader.js +++ b/web-app/js/lib/dport/manhattanplotTableHeader.js @@ -7,6 +7,7 @@ var mpgSoftware = mpgSoftware || {}; mpgSoftware.manhattanplotTableHeader = (function () { var mySavedVariables = {}; + var globalFirstDataset = ""; var setMySavedVariables = function(saveTheseVariables){ mySavedVariables = saveTheseVariables; } @@ -34,19 +35,18 @@ var mpgSoftware = mpgSoftware || {}; (data)) { if ((data.sampleGroups) && (data.sampleGroups.length > 0)) { - //first empty the old one - $('#manhattanSampleGroupChooser').empty() - //assume we have data and process it + var options = $('#manhattanSampleGroupChooser'); + options.empty(); + options.append(""); + for (var i = 0; i < data.sampleGroups.length; i++) { var sampleGroup = data.sampleGroups[i]; - console.log("sample group default: "+sampleGroup.default); - $('#manhattanSampleGroupChooser').append(new Option(sampleGroup.sgn, sampleGroup.sg, sampleGroup.default)); + var newOption = $("