aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2016-09-24 08:27:22 +0000
committerPjotr Prins2016-09-25 07:40:42 +0000
commita15dda37ffa6f77dbbc349302760c9a25541df9e (patch)
tree9421206fbb7ae4ec92325ebe9da4c92a3dfcca15
parente7693e53821747d294452c9bff7e8b0f38a0eb8e (diff)
downloadgenenetwork2-a15dda37ffa6f77dbbc349302760c9a25541df9e.tar.gz
I was getting below error with the small database. This commit, at least, does
not assume the item exists. ERROR:wqflask:Exception on /marker_regression [POST] Traceback (most recent call last): File "/home/wrk/.guix-profile/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/home/wrk/.guix-profile/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/wrk/.guix-profile/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/wrk/.guix-profile/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/home/wrk/.guix-profile/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/export2/izip/git/opensource/genenetwork/sumo_gn2/wqflask/wqflask/views.py", line 460, in marker_regression_page template_vars = marker_regression.MarkerRegression(start_vars, temp_uuid) File "/export2/izip/git/opensource/genenetwork/sumo_gn2/wqflask/wqflask/marker_regression/marker_regression.py", line 74, in __init__ value = start_vars['value:' + sample] KeyError: 'value:BXD80'
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index a1065adc..d2b27991 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -59,6 +59,7 @@ class MarkerRegression(object):
primary_sample_names = list(all_samples_ordered)
for sample in self.dataset.group.samplelist:
+ # sample is actually the name of an individual
in_trait_data = False
for item in self.this_trait.data:
if self.this_trait.data[item].name == sample:
@@ -68,9 +69,10 @@ class MarkerRegression(object):
in_trait_data = True
break
if not in_trait_data:
- value = start_vars['value:' + sample]
- self.samples.append(sample)
- self.vals.append(value)
+ value = start_vars.get('value:' + sample)
+ if value:
+ self.samples.append(sample)
+ self.vals.append(value)
self.mapping_method = start_vars['method']
if start_vars['manhattan_plot'] == "True":