From 55143d887e0bc0f362de7d5d28783cd05b3c4895 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 19 Jan 2022 16:38:31 +0300 Subject: minor bug fixes --- wqflask/wqflask/ctl/gn3_ctl_analysis.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/ctl/gn3_ctl_analysis.py b/wqflask/wqflask/ctl/gn3_ctl_analysis.py index ba7d4971..033b7704 100644 --- a/wqflask/wqflask/ctl/gn3_ctl_analysis.py +++ b/wqflask/wqflask/ctl/gn3_ctl_analysis.py @@ -10,23 +10,24 @@ from base.trait import retrieve_sample_data from base import data_set - def process_significance_data(significant_data): """function to process significance the data for datatables""" - col_names = ["trait","marker","trait_2","LOD","dCor"] - - data_set_rows = [[] for _ in range(len(significant_data["trait"]))] - + col_names = ["trait", "marker", "trait_2", "LOD", "dcor"] + dataset_rows = [[] for _ in range(len(significant_data["trait"]))] + for col in col_names: + for (index, col_data) in enumerate(significant_data[col]): + dataset_rows[index].append(col_data) return { - "col_names":[], - "" + "col_names": col_names, + "data_set_rows": dataset_rows } + def parse_geno_data(dataset_group_name) -> dict: """function to parse geno file data""" genofile_location = locate(dataset_group_name + ".geno", "genotype") @@ -117,8 +118,11 @@ def run_ctl(requestform): **form_data, - }) + }).json()["results"] + + response["significance_data"] = process_significance_data( + response["significance_data"]) # todo check for errors - return response.json() \ No newline at end of file + return response -- cgit v1.2.3