aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-04-15 06:10:28 +0300
committerAlexander Kabui2021-04-15 06:10:28 +0300
commit328b176628ed9db6c1c60590cb10f4cca212738a (patch)
treeebd3692010ab4229c45b726de253ea471e63afaa
parentfcb93bef5ab230b948f83e0e77a1ef54b017aca1 (diff)
downloadgenenetwork2-328b176628ed9db6c1c60590cb10f4cca212738a.tar.gz
change api port
-rw-r--r--wqflask/wqflask/correlation/correlation_gn3_api.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py
index c8d5347c..8ee4a9b7 100644
--- a/wqflask/wqflask/correlation/correlation_gn3_api.py
+++ b/wqflask/wqflask/correlation/correlation_gn3_api.py
@@ -7,7 +7,7 @@ from base import data_set
from base.trait import create_trait
from base.trait import retrieve_sample_data
-GN3_CORRELATION_API = "http://127.0.0.1:8080/api/correlation"
+GN3_CORRELATION_API = "http://127.0.0.1:8202/api/correlation"
def process_samples(start_vars, sample_names, excluded_samples=None):
@@ -30,6 +30,12 @@ def process_samples(start_vars, sample_names, excluded_samples=None):
def create_target_this_trait(start_vars):
"""this function creates the required trait and target dataset for correlation"""
+
+ print("creating the dataset and trait")
+ import time
+
+ initial_time = time.time()
+
this_dataset = data_set.create_dataset(dataset_name=start_vars['dataset'])
target_dataset = data_set.create_dataset(
dataset_name=start_vars['corr_dataset'])
@@ -44,6 +50,11 @@ def create_target_this_trait(start_vars):
target_dataset.get_trait_data(list(sample_data.keys()))
+
+ time_taken = time.time() - initial_time
+
+ print(f"the time taken to create dataset abnd trait is",time_taken)
+
return (this_dataset, this_trait, target_dataset, sample_data)
@@ -91,6 +102,8 @@ def compute_correlation(start_vars, method="pearson"):
requests_url = f"{GN3_CORRELATION_API}/lit_corr/{species}/{this_trait_geneid}"
corr_input_data = geneid_dict
+
+ print("Sending this request")
corr_results = requests.post(requests_url, json=corr_input_data)
data = corr_results.json()