aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Sloan2014-10-02 21:07:49 +0000
committerZachary Sloan2014-10-02 21:07:49 +0000
commit04136ee53bc1b240583e2af68f534cd81d31a5af (patch)
treec196098eae91974bfe2b4e9edb1b6d76a1b46e7d
parent85aa283c7489e6f55237d4dc85a26cea4f7a3c02 (diff)
downloadgenenetwork2-04136ee53bc1b240583e2af68f534cd81d31a5af.tar.gz
Fixed an error when there's no locus for mRNA expression traits
-rwxr-xr-xwqflask/base/trait.py3
-rwxr-xr-xwqflask/wqflask/show_trait/show_trait.py4
-rwxr-xr-xwqflask/wqflask/templates/show_trait_mapping_tools.html4
3 files changed, 7 insertions, 4 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 71691899..6d070d54 100755
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -408,6 +408,7 @@ class GeneralTrait(object):
#self.cursor.execute(query)
#trait_qtl = self.cursor.fetchone()
if trait_qtl:
+ print("trait_qtl:", trait_qtl)
self.locus, self.lrs, self.pvalue, self.mean = trait_qtl
print("self.locus:", self.locus)
if self.locus:
@@ -421,6 +422,8 @@ class GeneralTrait(object):
if result:
self.locus_chr = result[0]
self.locus_mb = result[1]
+ else:
+ self.locus = self.locus_chr = self.locus_mb = ""
else:
self.locus = self.locus_chr = self.locus_mb = self.lrs = self.pvalue = self.mean = ""
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 833c3b06..d38da8e8 100755
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -92,7 +92,7 @@ class ShowTrait(object):
#Get nearest marker for composite mapping
- if self.dataset.type != "Geno" and self.dataset.type != "Publish":
+ if self.this_trait.locus_chr != "" and self.dataset.type != "Geno" and self.dataset.type != "Publish":
self.nearest_marker1 = get_nearest_marker(self.this_trait, self.dataset)[0]
self.nearest_marker2 = get_nearest_marker(self.this_trait, self.dataset)[1]
@@ -109,7 +109,7 @@ class ShowTrait(object):
hddn['suggestive'] = 0
hddn['num_perm'] = 0
hddn['manhattan_plot'] = False
- if self.dataset.type != "Geno" and self.dataset.type != "Publish":
+ if self.this_trait.locus_chr != "" and self.dataset.type != "Geno" and self.dataset.type != "Publish":
hddn['control_marker'] = self.nearest_marker1+","+self.nearest_marker2
else:
hddn['control_marker'] = ""
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index d6426f0c..299c3e0c 100755
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -13,7 +13,7 @@
<a href="#rqtl_geno" data-toggle="tab">rqtl</a>
</li>
{% if dataset.group.species == 'human' %}
- <li>
+ <li>self.this_trait.locus_chr != "" and
<a href="#plink" data-toggle="tab">PLINK</a>
</li>
<li>
@@ -209,7 +209,7 @@
<div class="control-group">
<label for="control_rqtl_geno" class="control-label">Control Marker(s)</label>
<div class="controls">
- {% if dataset.type == 'ProbeSet' %}
+ {% if dataset.type == 'ProbeSet' and this_trait.locus_chr != "" %}
<input name="control_rqtl_geno" value="{{ nearest_marker1+","+nearest_marker2 }}" type="text" />
{% else %}
<input name="control_rqtl_geno" value="" type="text" />