aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/wgcna/gn3_wgcna.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/wqflask/wqflask/wgcna/gn3_wgcna.py b/wqflask/wqflask/wgcna/gn3_wgcna.py
index 15728f22..6692a890 100644
--- a/wqflask/wqflask/wgcna/gn3_wgcna.py
+++ b/wqflask/wqflask/wgcna/gn3_wgcna.py
@@ -6,7 +6,7 @@ import requests
from types import SimpleNamespace
from utility.helper_functions import get_trait_db_obs
-from utility.tools import GN_SERVER_URL
+from utility.tools import GN3_LOCAL_URL
def fetch_trait_data(requestform):
@@ -75,13 +75,21 @@ def process_image(response):
def run_wgcna(form_data):
"""function to run wgcna"""
- wgcna_api = f"{GN_SERVER_URL}api/wgcna/run_wgcna"
+ wgcna_api = f"{GN3_LOCAL_URL}/api/wgcna/run_wgcna"
# parse form data
trait_dataset = fetch_trait_data(form_data)
form_data["minModuleSize"] = int(form_data["MinModuleSize"])
+
+
+
+ form_data["SoftThresholds"] = [int(threshold.strip())
+ for threshold in form_data['SoftThresholds'].rstrip().split(",")]
+
+
+
response = requests.post(wgcna_api, json={
"sample_names": list(set(trait_dataset["sample_names"])),
"trait_names": trait_dataset["trait_names"],
@@ -91,6 +99,7 @@ def run_wgcna(form_data):
}
).json()
+
return {
"results": response,
"data": process_wgcna_data(response["data"]),