aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2016-04-22 19:46:54 +0000
committerzsloan2016-04-22 19:46:54 +0000
commit1fcdd76716d76d6f24c62df3009b0a1fc648e692 (patch)
treebb574f9e944629a662c6c1e418545115ef4eb10e /wqflask
parentf50b54cc58462860546aa529ff24eb7cea2396df (diff)
downloadgenenetwork2-1fcdd76716d76d6f24c62df3009b0a1fc648e692.tar.gz
Fixed issue where manhattan plot setting wasn't being carried over to single chromosome view for mapping results
Removed a useless "if 1 == 1" line that was in marker_regression_gn1.py for testing.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py2
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py95
-rw-r--r--wqflask/wqflask/templates/marker_regression_gn1.html2
-rwxr-xr-xwqflask/wqflask/templates/show_trait_mapping_tools.html12
4 files changed, 55 insertions, 56 deletions
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index 32cdb9af..fa439b55 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -68,7 +68,7 @@ class MarkerRegression(object):
self.vals.append(value)
self.mapping_method = start_vars['method']
- if start_vars['manhattan_plot'] == "true":
+ if start_vars['manhattan_plot'] == "True":
self.manhattan_plot = True
else:
self.manhattan_plot = False
diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
index 01303b0f..b89f6b97 100644
--- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py
+++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
@@ -2066,63 +2066,62 @@ class MarkerRegression(object):
if self.plotScale == "physic":
this_chr = str(self.ChrList[self.selectedChr][0])
else:
- this_chr = str(self.ChrList[self.selectedChr][1]+1)
+ this_chr = str(self.ChrList[self.selectedChr][1]+1)
if self.selectedChr == -1 or str(qtlresult['chr']) == this_chr:
#AdditiveCoordXY = []
#DominanceCoordXY = []
#for k, _locus in enumerate(_chr):
- if 1 == 1:
- Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale
- #if self.plotScale == 'physic':
- #Xc = startPosX + (_locus.Mb-startMb)*plotXScale
- #Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale
- #else:
- #Xc = startPosX + (_locus.cM-_chr[0].cM)*plotXScale
- #Xc = startPosX + (qtlresult['cM']-qtlresult[0]['cM'])*plotXScale
-
- # updated by NL 06-18-2011:
- # fix the over limit LRS graph issue since genotype trait may give infinite LRS;
- # for any lrs is over than 460(LRS max in this system), it will be reset to 460
- if 'lrs_value' in qtlresult:
- if self.LRS_LOD == "LOD":
- if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
- Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR)
- else:
- Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR)
+ Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale
+ #if self.plotScale == 'physic':
+ #Xc = startPosX + (_locus.Mb-startMb)*plotXScale
+ #Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale
+ #else:
+ #Xc = startPosX + (_locus.cM-_chr[0].cM)*plotXScale
+ #Xc = startPosX + (qtlresult['cM']-qtlresult[0]['cM'])*plotXScale
+
+ # updated by NL 06-18-2011:
+ # fix the over limit LRS graph issue since genotype trait may give infinite LRS;
+ # for any lrs is over than 460(LRS max in this system), it will be reset to 460
+ if 'lrs_value' in qtlresult:
+ if self.LRS_LOD == "LOD":
+ if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
+ Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR)
else:
- if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
- Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max
- else:
- Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max
+ Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR)
else:
- if qtlresult['lod_score'] > 100 or qtlresult['lod_score']=='inf':
+ if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max
else:
- if self.LRS_LOD == "LRS":
- Yc = yZero - qtlresult['lod_score']*self.LODFACTOR*LRSHeightThresh/LRS_LOD_Max
- else:
- Yc = yZero - qtlresult['lod_score']*LRSHeightThresh/LRS_LOD_Max
- #if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
- #if self.qtlresults[j]['lrs_value'] > 460 or self.qtlresults[j]['lrs_value']=='inf':
- # Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max
- #else:
- # Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max
-
- if self.manhattan_plot == True:
- canvas.drawEllipse(Xc-1, Yc-1, Xc+1, Yc+1, fillColor=pid.black)
+ Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max
+ else:
+ if qtlresult['lod_score'] > 100 or qtlresult['lod_score']=='inf':
+ Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max
else:
- LRSCoordXY.append((Xc, Yc))
-
- if not self.multipleInterval and self.additiveChecked:
- if additiveMax == 0.0:
- additiveMax = 0.000001
- Yc = yZero - qtlresult['additive']*AdditiveHeightThresh/additiveMax
- AdditiveCoordXY.append((Xc, Yc))
- # if not self.multipleInterval and INTERCROSS and self.additiveChecked:
- # Yc = yZero - qtlresult['dominance']*DominanceHeightThresh/dominanceMax
- # DominanceCoordXY.append((Xc, Yc))
- m += 1
- #canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth))
+ if self.LRS_LOD == "LRS":
+ Yc = yZero - qtlresult['lod_score']*self.LODFACTOR*LRSHeightThresh/LRS_LOD_Max
+ else:
+ Yc = yZero - qtlresult['lod_score']*LRSHeightThresh/LRS_LOD_Max
+ #if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf':
+ #if self.qtlresults[j]['lrs_value'] > 460 or self.qtlresults[j]['lrs_value']=='inf':
+ # Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max
+ #else:
+ # Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max
+
+ if self.manhattan_plot == True:
+ canvas.drawEllipse(Xc-1, Yc-1, Xc+1, Yc+1, fillColor=pid.black)
+ else:
+ LRSCoordXY.append((Xc, Yc))
+
+ if not self.multipleInterval and self.additiveChecked:
+ if additiveMax == 0.0:
+ additiveMax = 0.000001
+ Yc = yZero - qtlresult['additive']*AdditiveHeightThresh/additiveMax
+ AdditiveCoordXY.append((Xc, Yc))
+ # if not self.multipleInterval and INTERCROSS and self.additiveChecked:
+ # Yc = yZero - qtlresult['dominance']*DominanceHeightThresh/dominanceMax
+ # DominanceCoordXY.append((Xc, Yc))
+ m += 1
+ #canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth))
if self.manhattan_plot != True:
canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth))
diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html
index f3f33fad..7d34e88f 100644
--- a/wqflask/wqflask/templates/marker_regression_gn1.html
+++ b/wqflask/wqflask/templates/marker_regression_gn1.html
@@ -20,7 +20,7 @@
{% endfor %}
<input type="hidden" name="maf">
<input type="hidden" name="selected_chr" value="{{ selectedChr }}">
- <input type="hidden" name="manhattan_plot">
+ <input type="hidden" name="manhattan_plot" value="{{ manhattan_plot }}">
<input type="hidden" name="num_perm" value="{{ nperm }}">
<input type="hidden" name="num_bootstrap" value="{{ nboot }}">
<input type="hidden" name="do_control" value="{{ doControl }}">
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 5d9b0278..067dfc67 100755
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -66,11 +66,11 @@
<label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label>
<div class="col-xs-12 controls">
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_pylmm" value="true">
+ <input type="radio" name="manhattan_plot_pylmm" value="True">
Yes
</label>
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_pylmm" value="false" checked="">
+ <input type="radio" name="manhattan_plot_pylmm" value="False" checked="">
No
</label>
</div>
@@ -160,11 +160,11 @@
<label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label>
<div class="col-xs-12 controls">
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_rqtl" value="true">
+ <input type="radio" name="manhattan_plot_rqtl" value="True">
Yes
</label>
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_rqtl" value="false" checked="">
+ <input type="radio" name="manhattan_plot_rqtl" value="False" checked="">
No
</label>
</div>
@@ -242,11 +242,11 @@
<label style="text-align:left;" class="col-xs-12 control-label">Marker Regr.</label>
<div class="col-xs-12 controls">
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_reaper" value="true">
+ <input type="radio" name="manhattan_plot_reaper" value="True">
Yes
</label>
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_reaper" value="false" checked="">
+ <input type="radio" name="manhattan_plot_reaper" value="False" checked="">
No
</label>
</div>