aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-11-13 14:14:23 -0600
committerzsloan2020-11-13 14:14:23 -0600
commit92848edd669925dfd3c9e0722a99fd39dbbfd4b8 (patch)
treee196f06b0bf7ac45ce778266f5d68b7c794e41df /wqflask
parentdb0e80bef73eb163bfb747ec4d137d5c5069ade8 (diff)
downloadgenenetwork2-92848edd669925dfd3c9e0722a99fd39dbbfd4b8.tar.gz
Changed some if/else statements to just initializing the variables + the
if statement and fixed "lrs_location" to "location" for target genotypes
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 394c113d..17d3de54 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -489,25 +489,20 @@ def generate_corr_json(corr_results, this_trait, dataset, target_dataset, for_ap
results_dict['dataset'] = trait.dataset.name
if target_dataset.type == "ProbeSet":
results_dict['symbol'] = trait.symbol
- if len(trait.description_display) > 40:
- results_dict['description'] = trait.description_display[:40] + "..."
- else:
- results_dict['description'] = trait.description_display
- results_dict['description'] = trait.description_display
+ results_dict['description'] = "N/A"
results_dict['location'] = trait.location_repr
+ results_dict['mean'] = "N/A"
+ results_dict['lrs_score'] = "N/A"
+ results_dict['additive'] = "N/A"
+ if trait.description_display:
+ results_dict['description'] = trait.description_display
if trait.mean and trait.mean != "":
results_dict['mean'] = float(trait.mean)
- else:
- results_dict['mean'] = "N/A"
if trait.LRS_score_repr != "N/A":
results_dict['lrs_score'] = "%.1f" % float(trait.LRS_score_repr)
- else:
- results_dict['lrs_score'] = "N/A"
results_dict['lrs_location'] = trait.LRS_location_repr
if trait.additive and trait.additive != "":
results_dict['additive'] = "%0.3f" % float(trait.additive)
- else:
- results_dict['additive'] = "N/A"
results_dict['sample_r'] = "%0.3f" % float(trait.sample_r)
results_dict['num_overlap'] = trait.num_overlap
results_dict['sample_p'] = "%0.3e" % float(trait.sample_p)
@@ -558,7 +553,7 @@ def generate_corr_json(corr_results, this_trait, dataset, target_dataset, for_ap
results_dict['num_overlap'] = trait.num_overlap
results_dict['sample_p'] = "%0.3e" % float(trait.sample_p)
else:
- results_dict['lrs_location'] = trait.LRS_location_repr
+ results_dict['location'] = trait.location_repr
results_dict['sample_r'] = "%0.3f" % trait.sample_r
results_dict['num_overlap'] = trait.num_overlap
results_dict['sample_p'] = "%0.3e" % float(trait.sample_p)