From 3f1049827499e1647769d37f27aabf524dbe9690 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 26 Aug 2015 22:15:25 +0000 Subject: Fixed issue with colums for the gene global search (still need to change for phenotype) Fixed issue where LRS and LOD are sometimes labeled incorrectly Changed the header of the trait page Added link to GN1 in header Fixxed an issue that made permutations not work with pylmm Fixed "sign in" button when creating a collection while not logged in --- wqflask/base/data_set.py | 52 +++++++------ wqflask/wqflask/collect.py | 2 + .../wqflask/marker_regression/marker_regression.py | 5 +- .../static/new/javascript/dataset_select_menu.js | 1 + wqflask/wqflask/static/new/javascript/histogram.js | 2 +- .../static/packages/bootstrap/css/bootstrap.css | 4 +- wqflask/wqflask/templates/base.html | 3 +- wqflask/wqflask/templates/collections/add.html | 6 +- wqflask/wqflask/templates/gsearch_gene.html | 4 +- wqflask/wqflask/templates/marker_regression.html | 7 +- wqflask/wqflask/templates/search_result_page.html | 87 ++++++++++++++++++---- wqflask/wqflask/templates/show_trait.html | 48 ++++-------- wqflask/wqflask/templates/show_trait_details.html | 6 +- .../templates/show_trait_mapping_tools.html | 2 +- 14 files changed, 145 insertions(+), 84 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index c60efe65..e98258f6 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -559,29 +559,39 @@ class DataSet(object): This is not meant to retrieve the data set info if no name at all is passed. """ - - query_args = tuple(escape(x) for x in ( - (self.type + "Freeze"), - str(webqtlConfig.PUBLICTHRESH), - self.name, - self.name, - self.name)) - print("query_args are:", query_args) - - #print(""" - # SELECT Id, Name, FullName, ShortName - # FROM %s - # WHERE public > %s AND - # (Name = '%s' OR FullName = '%s' OR ShortName = '%s') - # """ % (query_args)) try: - self.id, self.name, self.fullname, self.shortname = g.db.execute(""" - SELECT Id, Name, FullName, ShortName - FROM %s - WHERE public > %s AND - (Name = '%s' OR FullName = '%s' OR ShortName = '%s') - """ % (query_args)).fetchone() + if self.type == "ProbeSet": + query_args = tuple(escape(x) for x in ( + str(webqtlConfig.PUBLICTHRESH), + self.name, + self.name, + self.name)) + + self.id, self.name, self.fullname, self.shortname, self.tissue = g.db.execute(""" + SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName, ProbeSetFreeze.ShortName, Tissue.Name + FROM ProbeSetFreeze, ProbeFreeze, Tissue + WHERE ProbeSetFreeze.public > %s AND + ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND + ProbeFreeze.TissueId = Tissue.Id AND + (ProbeSetFreeze.Name = '%s' OR ProbeSetFreeze.FullName = '%s' OR ProbeSetFreeze.ShortName = '%s') + """ % (query_args)).fetchone() + else: + query_args = tuple(escape(x) for x in ( + (self.type + "Freeze"), + str(webqtlConfig.PUBLICTHRESH), + self.name, + self.name, + self.name)) + + self.tissue = "N/A" + self.id, self.name, self.fullname, self.shortname = g.db.execute(""" + SELECT Id, Name, FullName, ShortName + FROM %s + WHERE public > %s AND + (Name = '%s' OR FullName = '%s' OR ShortName = '%s') + """ % (query_args)).fetchone() + except TypeError: print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) pass diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index c7c1e744..750f4757 100755 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -181,6 +181,8 @@ def collections_new(): if "anonymous_add" in params: AnonCollection().add_traits(params, "Default") return redirect(url_for('view_collection')) + elif "sign_in" in params: + return redirect(url_for('login')) collection_name = params['new_collection'] diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 850dfc7f..1c5757a6 100755 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -165,7 +165,10 @@ class MarkerRegression(object): else: self.json_data['chr'].append(str(qtl['chr'])) self.json_data['pos'].append(qtl['Mb']) - self.json_data['lod.hk'].append(str(qtl['lod_score'])) + if self.score_type == "LRS": + self.json_data['lod.hk'].append(str(qtl['lrs_value'])) + else: + self.json_data['lod.hk'].append(str(qtl['lod_score'])) self.json_data['markernames'].append(qtl['name']) #Get chromosome lengths for drawing the interval map plot diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js index fb9fdcf3..f91504be 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js @@ -94,6 +94,7 @@ $(function() { $('#dataset_info').click(dataset_info); make_default = function() { var holder, item, jholder, _i, _len, _ref; + alert("The current settings are now your default.") holder = {}; _ref = ['species', 'group', 'type', 'dataset']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { diff --git a/wqflask/wqflask/static/new/javascript/histogram.js b/wqflask/wqflask/static/new/javascript/histogram.js index d872a3ba..d26d0c03 100755 --- a/wqflask/wqflask/static/new/javascript/histogram.js +++ b/wqflask/wqflask/static/new/javascript/histogram.js @@ -68,7 +68,7 @@ Histogram.prototype.get_histogram_data = function() { var n_bins; console.log("sample_vals:", this.sample_vals); - n_bins = Math.sqrt(this.sample_vals.length); + n_bins = 2*Math.sqrt(this.sample_vals.length); //Was originally just the square root, but increased to 2*; ideally would be a GUI for changing this this.histogram_data = d3.layout.histogram().bins(this.x_scale.ticks(n_bins))(this.sample_vals); return console.log("histogram_data:", this.histogram_data[0]); }; diff --git a/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css b/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css index dd6fa736..4145e73f 100755 --- a/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css +++ b/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css @@ -1215,7 +1215,7 @@ a.bg-danger:hover { } .page-header { padding-bottom: 9px; - margin: 20px 0 20px; + margin: 10px 0 10px; border-bottom: 1px solid #eee; } ul, @@ -4674,7 +4674,7 @@ a.list-group-item.active > .badge, margin-left: 3px; } .jumbotron { - margin-bottom: 30px; + margin-bottom: 10px; color: inherit; background-color: #eee; } diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 75af8ba5..90acd0da 100755 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -83,7 +83,8 @@ - + + diff --git a/wqflask/wqflask/templates/collections/add.html b/wqflask/wqflask/templates/collections/add.html index faee4f78..07fcba22 100755 --- a/wqflask/wqflask/templates/collections/add.html +++ b/wqflask/wqflask/templates/collections/add.html @@ -1,11 +1,12 @@