aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py16
-rw-r--r--wqflask/wqflask/templates/corr_scatterplot.html108
-rw-r--r--wqflask/wqflask/user_session.py14
3 files changed, 79 insertions, 59 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index bda899fb..d4b8a8dd 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -2013,9 +2013,17 @@ class DisplayMappingResults(object):
LRSLODFont=ImageFont.truetype(font=VERDANA_FILE, size=int(18*zoom*1.5))
yZero = yTopOffset + plotHeight
- LRSHeightThresh = drawAreaHeight
- AdditiveHeightThresh = drawAreaHeight/2
- DominanceHeightThresh = drawAreaHeight/2
+ # LRSHeightThresh = drawAreaHeight
+ # AdditiveHeightThresh = drawAreaHeight/2
+ # DominanceHeightThresh = drawAreaHeight/2
+ if self.selectedChr == 1:
+ LRSHeightThresh = drawAreaHeight - yTopOffset + 30*(zoom - 1)
+ AdditiveHeightThresh = LRSHeightThresh/2
+ DominanceHeightThresh = LRSHeightThresh/2
+ else:
+ LRSHeightThresh = drawAreaHeight
+ AdditiveHeightThresh = drawAreaHeight/2
+ DominanceHeightThresh = drawAreaHeight/2
# LRSHeightThresh = (yZero - yTopOffset + 30*(zoom - 1))
# AdditiveHeightThresh = LRSHeightThresh/2
# DominanceHeightThresh = LRSHeightThresh/2
@@ -2251,7 +2259,7 @@ class DisplayMappingResults(object):
startPosX += newStartPosX
oldStartPosX = newStartPosX
- #ZS: This is beause the chromosome value stored in qtlresult['chr'] can be (for example) either X or 20 depending upon the mapping method/scale used
+ #ZS: This is because the chromosome value stored in qtlresult['chr'] can be (for example) either X or 20 depending upon the mapping method/scale used
this_chr = str(self.ChrList[self.selectedChr][0])
if self.plotScale != "physic":
this_chr = str(self.ChrList[self.selectedChr][1]+1)
diff --git a/wqflask/wqflask/templates/corr_scatterplot.html b/wqflask/wqflask/templates/corr_scatterplot.html
index 5877e367..6f0511e1 100644
--- a/wqflask/wqflask/templates/corr_scatterplot.html
+++ b/wqflask/wqflask/templates/corr_scatterplot.html
@@ -132,44 +132,8 @@
<br>
<div id="scatterplot2"></div>
<br>
- <div class="row" style="min-width: 700px; overflow: hidden;">
- <div style="float: left;">
- <table class="table table-hover table-striped table-bordered" style="width: 80%; margin-left: 60px; text-align: right;">
- <thead>
- <tr><th style="text-align: right;">Statistic</th><th style="text-align: right;">Value</th></tr>
- </thead>
- <tbody>
- <tr>
- <td>Number</td>
- <td>{{jsdata.num_overlap}}</td>
- </tr>
- <tr>
- <td>Slope</td>
- <td>{{ jsdata.slope_string }}</td>
- </tr>
- <tr>
- <td>Intercept</td>
- <td>{{'%0.3f' % jsdata.intercept}}</td>
- </tr>
- <tr>
- <td>r value</td>
- <td>{{'%0.3f' % jsdata.r_value}}</td>
- </tr>
- <tr>
- <td>P value</td>
- <td>{% if jsdata.p_value < 0.001 %}{{'%0.3e' % jsdata.p_value}}{% else %}{{'%0.3f' % jsdata.p_value}}{% endif %}</td>
- </tr>
- <tr>
- <td style="text-align: left;" colspan="2">
- Regression Line
- <br>
- y = {{ jsdata.slope_string }} * x {% if jsdata.intercept < 0 %}- {{'%0.3f' % (jsdata.intercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.intercept}}{% endif %}
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style="margin-left: 50px; min-width: 300px; float: left;">
+ <div style="min-width: 700px; overflow: hidden;">
+ <div style="margin-left: 50px; min-width: 300px;">
{% if trait_1.dataset.type == "ProbeSet" %}
<div>
X axis:
@@ -240,15 +204,7 @@
</div>
{% endif %}
</div>
- </div>
- </div>
-
- <div class="tab-pane" id="tp2">
- <br>
- <div id="srscatterplot2"></div>
- <br>
- <div class="row" style="min-width: 700px; overflow: hidden;">
- <div style="float: left;">
+ <div style="float: left; margin-top:30px;">
<table class="table table-hover table-striped table-bordered" style="width: 80%; margin-left: 60px; text-align: right;">
<thead>
<tr><th style="text-align: right;">Statistic</th><th style="text-align: right;">Value</th></tr>
@@ -260,31 +216,39 @@
</tr>
<tr>
<td>Slope</td>
- <td>{{ jsdata.srslope_string }}</td>
+ <td>{{ jsdata.slope_string }}</td>
</tr>
<tr>
<td>Intercept</td>
- <td>{{'%0.3f' % jsdata.srintercept}}</td>
+ <td>{{'%0.3f' % jsdata.intercept}}</td>
</tr>
<tr>
<td>r value</td>
- <td>{{'%0.3f' % jsdata.srr_value}}</td>
+ <td>{{'%0.3f' % jsdata.r_value}}</td>
</tr>
- <tr>
+ <tr>
<td>P value</td>
- <td>{% if jsdata.srp_value < 0.001 %}{{'%0.3e' % jsdata.srp_value}}{% else %}{{'%0.3f' % jsdata.srp_value}}{% endif %}</td>
+ <td>{% if jsdata.p_value < 0.001 %}{{'%0.3e' % jsdata.p_value}}{% else %}{{'%0.3f' % jsdata.p_value}}{% endif %}</td>
</tr>
<tr>
<td style="text-align: left;" colspan="2">
Regression Line
<br>
- y = {{ jsdata.srslope_string }} * x {% if jsdata.srintercept < 0 %}- {{'%0.3f' % (jsdata.srintercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.srintercept}}{% endif %}
+ y = {{ jsdata.slope_string }} * x {% if jsdata.intercept < 0 %}- {{'%0.3f' % (jsdata.intercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.intercept}}{% endif %}
</td>
</tr>
</tbody>
</table>
+ </div>
</div>
- <div style="margin-left: 50px; min-width: 300px; float: left;">
+ </div>
+
+ <div class="tab-pane" id="tp2">
+ <br>
+ <div id="srscatterplot2"></div>
+ <br>
+ <div class="row" style="min-width: 700px; overflow: hidden;">
+ <div style="margin-left: 50px; min-width: 300px;">
{% if trait_1.dataset.type == "ProbeSet" %}
<div>
X axis:
@@ -335,6 +299,42 @@
</div>
{% endif %}
</div>
+ <div style="float: left; margin-top: 30px;">
+ <table class="table table-hover table-striped table-bordered" style="width: 80%; margin-left: 60px; text-align: right;">
+ <thead>
+ <tr><th style="text-align: right;">Statistic</th><th style="text-align: right;">Value</th></tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Number</td>
+ <td>{{jsdata.num_overlap}}</td>
+ </tr>
+ <tr>
+ <td>Slope</td>
+ <td>{{ jsdata.srslope_string }}</td>
+ </tr>
+ <tr>
+ <td>Intercept</td>
+ <td>{{'%0.3f' % jsdata.srintercept}}</td>
+ </tr>
+ <tr>
+ <td>r value</td>
+ <td>{{'%0.3f' % jsdata.srr_value}}</td>
+ </tr>
+ <tr>
+ <td>P value</td>
+ <td>{% if jsdata.srp_value < 0.001 %}{{'%0.3e' % jsdata.srp_value}}{% else %}{{'%0.3f' % jsdata.srp_value}}{% endif %}</td>
+ </tr>
+ <tr>
+ <td style="text-align: left;" colspan="2">
+ Regression Line
+ <br>
+ y = {{ jsdata.srslope_string }} * x {% if jsdata.srintercept < 0 %}- {{'%0.3f' % (jsdata.srintercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.srintercept}}{% endif %}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</div>
</div>
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index ba659fe5..3aa2c151 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -13,7 +13,7 @@ from wqflask import app
from utility import hmac
#from utility.elasticsearch_tools import get_elasticsearch_connection
-from utility.redis_tools import get_redis_conn, get_user_id, get_user_collections, save_collections
+from utility.redis_tools import get_redis_conn, get_user_id, get_user_by_unique_column, set_user_attribute, get_user_collections, save_collections
Redis = get_redis_conn()
from utility.logger import getLogger
@@ -53,6 +53,18 @@ def create_signed_cookie():
logger.debug("uuid_signed:", uuid_signed)
return the_uuid, uuid_signed
+@app.route("/user/manage", methods=('GET','POST'))
+def manage_user():
+ params = request.form if request.form else request.args
+ if 'new_full_name' in params:
+ set_user_attribute(g.user_session.user_id, 'full_name', params['new_full_name'])
+ if 'new_organization' in params:
+ set_user_attribute(g.user_session.user_id, 'organization', params['new_organization'])
+
+ user_details = get_user_by_unique_column("user_id", g.user_session.user_id)
+
+ return render_template("admin/manage_user.html", user_details = user_details)
+
class UserSession(object):
"""Logged in user handling"""