aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexander Kabui2022-01-19 16:38:31 +0300
committerBonfaceKilz2022-02-09 08:49:56 +0300
commit55143d887e0bc0f362de7d5d28783cd05b3c4895 (patch)
tree828446415a90cf885601f110a7080f97caa4696b /wqflask
parent36abd8a04b84aa38a9c713054a0abce69848cf3a (diff)
downloadgenenetwork2-55143d887e0bc0f362de7d5d28783cd05b3c4895.tar.gz
minor bug fixes
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/ctl/gn3_ctl_analysis.py22
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