From ff5ab1875025efdfa23209e58c651c7816c6b916 Mon Sep 17 00:00:00 2001 From: uditgulati Date: Mon, 10 May 2021 03:34:26 -0500 Subject: add ServerSideTable to gsearch geno and pheno tables --- wqflask/wqflask/gsearch.py | 54 ++++++++++++++++++++++------ wqflask/wqflask/templates/gsearch_gene.html | 15 ++++++-- wqflask/wqflask/templates/gsearch_pheno.html | 15 ++++++-- wqflask/wqflask/views.py | 13 +++++++ 4 files changed, 80 insertions(+), 17 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 44a8f7f7..4024fa7a 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -130,7 +130,7 @@ class GSearch: trait_list.append(this_trait) self.trait_count = len(trait_list) - self.trait_list = json.dumps(trait_list) + self.trait_list = trait_list self.header_fields = ['Index', 'Record', @@ -146,6 +146,22 @@ class GSearch: 'Max LRS Location', 'Additive Effect'] + self.header_data_names = [ + 'index', + 'name', + 'species', + 'group', + 'tissue', + 'dataset_fullname', + 'symbol', + 'description', + 'location_repr', + 'mean', + 'LRS_score_repr', + 'max_lrs_text', + 'additive', + ] + elif self.type == "phenotype": search_term = self.terms group_clause = "" @@ -263,15 +279,31 @@ class GSearch: trait_list.append(this_trait) self.trait_count = len(trait_list) - self.trait_list = json.dumps(trait_list) + self.trait_list = trait_list self.header_fields = ['Index', - 'Species', - 'Group', - 'Record', - 'Description', - 'Authors', - 'Year', - 'Max LRS', - 'Max LRS Location', - 'Additive Effect'] + 'Species', + 'Group', + 'Record', + 'Description', + 'Authors', + 'Year', + 'Max LRS', + 'Max LRS Location', + 'Additive Effect'] + + self.header_data_names = [ + 'index', + 'name', + 'species', + 'group', + 'tissue', + 'dataset_fullname', + 'symbol', + 'description', + 'location_repr', + 'mean', + 'LRS_score_repr', + 'max_lrs_text', + 'additive', + ] diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 6fd0abe8..48953d98 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -55,7 +55,15 @@