aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexander Kabui2022-01-19 13:34:33 +0300
committerBonfaceKilz2022-02-09 08:49:56 +0300
commitb3a94bc8d78b15b1cd600533e0723410f18c665b (patch)
treefb33d7cf2b1720389d0db7d9d15b428351b795d9 /wqflask
parent9d7e616e1924173499395047ba011262f704fc78 (diff)
downloadgenenetwork2-b3a94bc8d78b15b1cd600533e0723410f18c665b.tar.gz
fetch pheno input data
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/ctl/gn3_ctl_analysis.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/wqflask/wqflask/ctl/gn3_ctl_analysis.py b/wqflask/wqflask/ctl/gn3_ctl_analysis.py
index 9ee85d3d..37b2fa8e 100644
--- a/wqflask/wqflask/ctl/gn3_ctl_analysis.py
+++ b/wqflask/wqflask/ctl/gn3_ctl_analysis.py
@@ -1,6 +1,13 @@
import requests
from dataclasses import dataclass
+
+from utility import genofile_parser
from utility.tools import GN3_LOCAL_URL
+from utility.tools import locate
+
+
+from base.trait import create_trait
+from base.trait import retrieve_sample_data
@dataclass
@@ -37,6 +44,31 @@ def parse_geno_data(dataset_group_name) ->dict:
}
+def parse_phenotype_data(trait_db_list):
+ """function to parse and generate phenodata"""
+
+ traits = []
+ for trait in trait_db_list:
+ if trait != "":
+ ts = trait.split(':')
+ gt = create_trait(name=ts[0], dataset_name=ts[1])
+ gt = retrieve_sample_data(gt, dataset, individuals)
+ for ind in individuals:
+ if ind in list(gt.data.keys()):
+ traits.append(gt.data[ind].value)
+ else:
+ traits.append("-999")
+
+
+ # missing inviduals
+
+ return {
+ "trait_db_list":trait_db_list,
+ "traits":traits
+ }
+
+
+