From 9bba082eb647d9824cf72d05ca281192665b4bec Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 5 Dec 2019 14:58:06 -0600 Subject: Fixed issue where you couldn't use letter chromosomes in searches --- wqflask/wqflask/do_search.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index 0df72b0d..9aa41a87 100644 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -474,7 +474,14 @@ class LrsSearch(DoSearch): chr_num = self.search_term[2].lower().replace("chr", "") self.search_term[2] = chr_num - self.search_term = [float(value) for value in self.search_term] + converted_search_term = [] + for value in self.search_term: + try: + converted_search_term.append(float(value)) + except: + converted_search_term.append(value) + + self.search_term = converted_search_term if len(self.search_term) > 2: from_clause = ", Geno" @@ -499,7 +506,7 @@ class LrsSearch(DoSearch): if len(self.search_term) > 2: chr_num = self.search_term[2] - where_clause += """ and Geno.Chr = %s """ % (chr_num) + where_clause += """ and Geno.Chr = '%s' """ % (chr_num) if len(self.search_term) == 5: mb_low, mb_high = self.search_term[3:] where_clause += """ and Geno.Mb > %s and -- cgit v1.2.3