From 04136ee53bc1b240583e2af68f534cd81d31a5af Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 2 Oct 2014 21:07:49 +0000 Subject: Fixed an error when there's no locus for mRNA expression traits --- wqflask/base/trait.py | 3 +++ wqflask/wqflask/show_trait/show_trait.py | 4 ++-- wqflask/wqflask/templates/show_trait_mapping_tools.html | 4 ++-- 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 @@ rqtl {% if dataset.group.species == 'human' %} -
  • +
  • self.this_trait.locus_chr != "" and PLINK
  • @@ -209,7 +209,7 @@
    - {% if dataset.type == 'ProbeSet' %} + {% if dataset.type == 'ProbeSet' and this_trait.locus_chr != "" %} {% else %} -- cgit v1.2.3