diff options
-rw-r--r-- | wqflask/wqflask/search_results.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index ce836ce2..0d0894a4 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -126,11 +126,14 @@ views.py). trait_dict['mean'] = "N/A" trait_dict['additive'] = "N/A" if this_trait.mean != "" and this_trait.mean != None: - trait_dict['mean'] = '%.3f' % this_trait.mean - trait_dict['lrs_score'] = this_trait.LRS_score_repr + trait_dict['mean'] = f"{this_trait.mean:.3f}" + try: + trait_dict['lod_score'] = f"{float(this_trait.LRS_score_repr) / 4.61:.1f}" + except: + trait_dict['lod_score'] = "N/A" trait_dict['lrs_location'] = this_trait.LRS_location_repr if this_trait.additive != "": - trait_dict['additive'] = '%.3f' % this_trait.additive + trait_dict['additive'] = f"{this_trait.additive:.3f}" elif this_trait.dataset.type == "Geno": trait_dict['location'] = this_trait.location_repr elif this_trait.dataset.type == "Publish": @@ -143,12 +146,15 @@ views.py). trait_dict['pubmed_text'] = this_trait.pubmed_text trait_dict['mean'] = "N/A" if this_trait.mean != "" and this_trait.mean != None: - trait_dict['mean'] = '%.3f' % this_trait.mean - trait_dict['lrs_score'] = this_trait.LRS_score_repr + trait_dict['mean'] = f"{this_trait.mean:.3f}" + try: + trait_dict['lod_score'] = f"{float(this_trait.LRS_score_repr) / 4.61:.1f}" + except: + trait_dict['lod_score'] = "N/A" trait_dict['lrs_location'] = this_trait.LRS_location_repr trait_dict['additive'] = "N/A" if this_trait.additive != "": - trait_dict['additive'] = '%.3f' % this_trait.additive + trait_dict['additive'] = f"{this_trait.additive:.3f}" # Convert any bytes in dict to a normal utf-8 string for key in trait_dict.keys(): if isinstance(trait_dict[key], bytes): |