diff options
-rw-r--r-- | wqflask/wqflask/ctl/gn3_ctl_analysis.py | 22 |
1 files changed, 13 insertions, 9 deletions
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 |