aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2016-04-07 17:58:49 +0000
committerzsloan2016-04-07 17:58:49 +0000
commit8d7f923631cc3578aa9fb8116b31dbfd773e3b59 (patch)
tree8e198ea4bd3ebbb239e3dac74b34df4aca564a03
parent9555318df5f31de2739b4ca2d5892927cc1ef74f (diff)
downloadgenenetwork2-8d7f923631cc3578aa9fb8116b31dbfd773e3b59.tar.gz
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
-rw-r--r--wqflask/utility/Plot.py1
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py8
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py13
-rw-r--r--wqflask/wqflask/templates/marker_regression_gn1.html6
-rwxr-xr-xwqflask/wqflask/templates/show_trait.html2
-rw-r--r--wqflask/wqflask/views.py1
6 files changed, 24 insertions, 7 deletions
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<endMb:
- self.cursor.execute("""
+ snp_count = g.db.execute("""
select
count(*) from BXDSnpPosition
where
Chr = '%s' AND Mb >= %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 @@
</a>
<br>
{% endif %}
+ <input type="checkbox" name="showSNP" class="checkbox" style="display: inline; margin-top: 0px;" {% if SNPChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">SNP Track </span>
+ <a href="http://genenetwork.org/glossary.html#snpSeismograph" target="_blank">
+ <sup style="color:#f00"> ?</sup>
+ </a>
+ <span style="color:red;">*</span>
+ <br>
<input type="checkbox" name="showGenes" class="checkbox" style="display: inline; margin-top: 0px;" {% if geneChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Gene Track </span> <span style="color:red;">*</span><br>
<input type="checkbox" name="viewLegend" class="checkbox" style="display: inline; margin-top: 0px;" {% if legendChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Legend </span><br>
{% 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 @@
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.scientific.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script
+ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/noUiSlider/nouislider.js"></script>
<script type="text/javascript" charset="utf-8">
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 2e846066..acc46137 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -365,6 +365,7 @@ def marker_regression_page():
'endMb',
'graphWidth',
'additiveCheck',
+ 'showSNP',
'showGenes',
'viewLegend',
'haplotypeAnalystCheck',