From b3a94bc8d78b15b1cd600533e0723410f18c665b Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 19 Jan 2022 13:34:33 +0300 Subject: fetch pheno input data --- wqflask/wqflask/ctl/gn3_ctl_analysis.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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 + } + + + -- cgit v1.2.3