diff options
author | zsloan | 2019-12-05 14:58:06 -0600 |
---|---|---|
committer | zsloan | 2019-12-05 14:58:06 -0600 |
commit | 9bba082eb647d9824cf72d05ca281192665b4bec (patch) | |
tree | 18f533bef24135f11ac3c3eb35b559d57f0210ee | |
parent | 90451d426124362dfd8ada807b15c733c718eb21 (diff) | |
download | genenetwork2-9bba082eb647d9824cf72d05ca281192665b4bec.tar.gz |
Fixed issue where you couldn't use letter chromosomes in searches
-rw-r--r-- | wqflask/wqflask/do_search.py | 11 |
1 files 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 |