diff options
author | Alexander Kabui | 2022-01-19 13:52:35 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-02-09 08:49:56 +0300 |
commit | 51418eff4f0caa3082e233ff8eefd413fce9dd09 (patch) | |
tree | a94b9786a9d2249acb1a3843a5c0277ee11fc2d9 /wqflask | |
parent | e4f533890820c9ba138f334958e41e82175bc415 (diff) | |
download | genenetwork2-51418eff4f0caa3082e233ff8eefd413fce9dd09.tar.gz |
minor refactoring
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/ctl/gn3_ctl_analysis.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/wqflask/wqflask/ctl/gn3_ctl_analysis.py b/wqflask/wqflask/ctl/gn3_ctl_analysis.py index 50623562..71e96fc7 100644 --- a/wqflask/wqflask/ctl/gn3_ctl_analysis.py +++ b/wqflask/wqflask/ctl/gn3_ctl_analysis.py @@ -27,6 +27,8 @@ def parse_geno_data(dataset_group_name) ->dict: # get marker and marker names + return parser + markers = [] markernames = [] for marker in parser.markers: @@ -86,16 +88,33 @@ def parse_form_data(form_data: dict): return form_data -def run_ctl(): +def run_ctl(requestform): """function to make an api call to gn3 and run ctl""" CtlObj = CtlDatabase() - ctl_api = f"{GN3_LOCAL_URL}/api/wgcna/run_wgcna" + ctl_api = f"{GN3_LOCAL_URL}/api/ctl/run_ctl" + + form_data = parse_form_data(requestform) + + pheno_data = parse_geno_data(CtlObj.dataset.group.name) + + + geno_data = parse_phenotype_data(form_data["trait_db_list"]) + + # refactor below + + pheno_data["individuals"] = geno_data["individuals"] + response = requests.post(ctl_api, json={ + "genoData":geno_data, + "phenoData":pheno_data, + + **form_data, + }) # todo check for errors |