aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-12 07:11:33 +0300
committerFrederick Muriuki Muriithi2022-09-12 07:11:33 +0300
commitdf7ae4856b2191c449d96eac42ce23d3f830073d (patch)
tree3af09c0fd7c9ee3d10540b8b7913774a721f6ccd
parent9a3df65704c73a325eb13abcdb184c8485736820 (diff)
downloadgenenetwork2-df7ae4856b2191c449d96eac42ce23d3f830073d.tar.gz
Check for traits before computing
-rw-r--r--wqflask/wqflask/correlation/rust_correlation.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py
index 214a47e7..debc4930 100644
--- a/wqflask/wqflask/correlation/rust_correlation.py
+++ b/wqflask/wqflask/correlation/rust_correlation.py
@@ -131,6 +131,9 @@ def compute_top_n_sample(start_vars, dataset, trait_list):
(sample_data, sample_ids) = __fetch_sample_ids__(
start_vars["sample_vals"], start_vars["corr_samples_group"])
+ if len(trait_list) == 0:
+ return {}
+
with database_connector() as conn:
with conn.cursor() as curr:
# fetching strain data in bulk