aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander_Kabui2022-08-15 00:47:21 +0300
committerAlexander_Kabui2022-08-15 00:47:21 +0300
commitcda1370d5712ae3c756215ef848dedc99cd5504d (patch)
tree6a4216b7424ec4ab3bad6b5f0287adf1170e60cd
parent6ea9c44c442791b6140c25c9f4edc7a92fb25c57 (diff)
downloadgenenetwork2-cda1370d5712ae3c756215ef848dedc99cd5504d.tar.gz
add default values for num overlap,corr_coeff
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 1c391386..f5fdd9b3 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -121,9 +121,9 @@ def correlation_json_for_table(correlation_data, this_trait, this_dataset, targe
results_dict['dataset'] = target_dataset['name']
results_dict['hmac'] = hmac.data_hmac(
'{}:{}'.format(target_trait['name'], target_dataset['name']))
- results_dict['sample_r'] = f"{float(trait['corr_coefficient']):.3f}"
- results_dict['num_overlap'] = trait['num_overlap']
- results_dict['sample_p'] = f"{float(trait['p_value']):.3e}"
+ results_dict['sample_r'] = f"{float(trait.get('corr_coefficient',0.0)):.3f}"
+ results_dict['num_overlap'] = trait.get('num_overlap',0)
+ results_dict['sample_p'] = f"{float(trait.get('p_value',0)):.3e}"
if target_dataset['type'] == "ProbeSet":
results_dict['symbol'] = target_trait['symbol']
results_dict['description'] = "N/A"