aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexander Kabui2022-01-19 14:13:57 +0300
committerBonfaceKilz2022-02-09 08:49:56 +0300
commitbaeef69552bbe522087f5c2f0d0b1bd1402f8761 (patch)
tree322cd7a437494500a354b88d014f72d7f4cc418c /wqflask
parent51418eff4f0caa3082e233ff8eefd413fce9dd09 (diff)
downloadgenenetwork2-baeef69552bbe522087f5c2f0d0b1bd1402f8761.tar.gz
delete class initiliazation object
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/ctl/gn3_ctl_analysis.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/wqflask/wqflask/ctl/gn3_ctl_analysis.py b/wqflask/wqflask/ctl/gn3_ctl_analysis.py
index 71e96fc7..113764a7 100644
--- a/wqflask/wqflask/ctl/gn3_ctl_analysis.py
+++ b/wqflask/wqflask/ctl/gn3_ctl_analysis.py
@@ -1,5 +1,4 @@
import requests
-from dataclasses import dataclass
from utility import genofile_parser
from utility.tools import GN3_LOCAL_URL
@@ -9,15 +8,6 @@ from base.trait import create_trait
from base.trait import retrieve_sample_data
-@dataclass
-class CtlDatabase:
- """class for keeping track of ctl db data"""
-
- dataset: dict
-
- trait_db_list: list
-
-
def parse_geno_data(dataset_group_name) ->dict:
"""function to parse geno file data"""
genofile_location = locate(dataset.group.name + ".geno", "genotype")
@@ -92,18 +82,17 @@ def run_ctl(requestform):
"""function to make an api call
to gn3 and run ctl"""
- CtlObj = CtlDatabase()
-
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)
+ trait_db_list = form_data["trait_db_list"]
+ dataset = data_set.create_dataset(trait_db_list[0].split(":")[1])
+ pheno_data = parse_geno_data(dataset.group.name)
- geno_data = parse_phenotype_data(form_data["trait_db_list"])
+ geno_data = parse_phenotype_data(trait_db_list)
- # refactor below
pheno_data["individuals"] = geno_data["individuals"]
@@ -119,4 +108,8 @@ def run_ctl(requestform):
# todo check for errors
- return response.json()
+ response_data = response.json()
+
+ print(">>>>>>>>>>>>>>>>>>>>>>",response_data)
+
+ return ""