From 8d7f923631cc3578aa9fb8116b31dbfd773e3b59 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 7 Apr 2016 17:58:49 +0000 Subject: SNP Track option should now work for GN1 mapping figure Fixed typo in show_trait html that caused the p-value slider to not work for correlations --- wqflask/utility/Plot.py | 1 + wqflask/wqflask/marker_regression/marker_regression.py | 8 +++++++- wqflask/wqflask/marker_regression/marker_regression_gn1.py | 13 ++++++++----- wqflask/wqflask/templates/marker_regression_gn1.html | 6 ++++++ wqflask/wqflask/templates/show_trait.html | 2 +- wqflask/wqflask/views.py | 1 + 6 files changed, 24 insertions(+), 7 deletions(-) (limited to 'wqflask') diff --git a/wqflask/utility/Plot.py b/wqflask/utility/Plot.py index ad11a81e..444c71c9 100644 --- a/wqflask/utility/Plot.py +++ b/wqflask/utility/Plot.py @@ -497,6 +497,7 @@ def plotBar(canvas, data, barColor=pid.blue, axesColor=pid.black, labelColor=pid xLow, xTop, stepX = detScale(min_D, max_D) #reduce data + #ZS: Used to determine number of bins for permutation output step = ceil((xTop-xLow)/50.0) j = xLow dataXY = [] diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 86fced39..26ba212d 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -104,7 +104,12 @@ class MarkerRegression(object): self.num_perm = int(start_vars['num_perm']) self.LRSCheck = start_vars['LRSCheck'] - + + if "showSNP" in start_vars: + self.showSNP = start_vars['showSNP'] + else: + self.showSNP = False + if "showGenes" in start_vars: self.showGenes = start_vars['showGenes'] else: @@ -125,6 +130,7 @@ class MarkerRegression(object): self.LRSCheck = self.score_type self.permCheck = "ON" + self.showSNP = "ON" self.showGenes = "ON" self.viewLegend = "ON" diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index 45d98554..3e08f7ae 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -304,11 +304,14 @@ class MarkerRegression(object): self.legendChecked = start_vars['viewLegend'] else: self.legendChecked = False + if 'showSNP' in start_vars.keys(): + self.SNPChecked = start_vars['showSNP'] + else: + self.SNPChecked = False if 'showGenes' in start_vars.keys(): self.geneChecked = start_vars['showGenes'] else: self.geneChecked = False - self.SNPChecked = False self.draw2X = False self.lrsMax = 0 try: @@ -1047,14 +1050,14 @@ class MarkerRegression(object): SNPCounts = [] while startMb= %2.6f AND Mb < %2.6f AND StrainId1 = %d AND StrainId2 = %d - """ % (chrName, startMb, startMb+stepMb, strainId1, strainId2)) - SNPCounts.append(self.cursor.fetchone()[0]) + """ % (chrName, startMb, startMb+stepMb, strainId1, strainId2)).fetchone()[0] + SNPCounts.append(snp_count) startMb += stepMb if (len(SNPCounts) > 0): @@ -2538,7 +2541,7 @@ class MarkerRegression(object): heading2.append(HT.Strong("Trait Name: "), fd.identification) return HT.TD(intMapHeading, heading2, valign="top") - def drawPermutationHistogram(self): + def drawPermutationHistogram(self, x_label='LRS'): ######################################### # Permutation Graph ######################################### diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index 11c0f859..cc881011 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -104,6 +104,12 @@
{% endif %} + SNP Track + + ? + + * +
Gene Track *
Legend
{% if plotScale != "morgan" %} diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index 73bd8e4b..62a08d85 100755 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -151,7 +151,7 @@ -