aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/base/trait.py1
-rw-r--r--wqflask/wqflask/collect.py23
2 files changed, 20 insertions, 4 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index f0749858..ee5dda38 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -94,6 +94,7 @@ class GeneralTrait:
self.num_overlap = None
self.strand_probe = None
self.symbol = None
+ self.abbreviation = None
self.display_name = self.name
self.LRS_score_repr = "N/A"
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 815bb7c1..de61323a 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -200,18 +200,33 @@ def trait_info_str(trait):
return (trt.symbol or trt.abbreviation or "N/A")[:20]
def __lrs(trt):
- return (
- f"{float(trait.LRS_score_repr):0.3f}" if float(trait.LRS_score_repr) > 0
- else f"{trait.LRS_score_repr}")
+ if trait.dataset.type == "Geno":
+ return 0
+ else:
+ return (
+ f"{float(trait.LRS_score_repr):0.3f}" if float(trait.LRS_score_repr) > 0
+ else f"{trait.LRS_score_repr}")
+
+ def __lrs_location(trt):
+ if hasattr(trt, "LRS_location_repr"):
+ return trt.LRS_location_repr
+ else:
+ return "N/A"
def __location(trt):
if hasattr(trt, "location_repr"):
return trt.location_repr
return None
+ def __mean(trt):
+ if trait.mean:
+ return trt.mean
+ else:
+ return 0
+
return "{}|||{}|||{}|||{}|||{}|||{:0.3f}|||{}|||{}".format(
trait.name, trait.dataset.name, __trait_desc(trait), __symbol(trait),
- __location(trait), trait.mean, __lrs(trait), trait.LRS_location_repr)
+ __location(trait), __mean(trait), __lrs(trait), __lrs_location(trait))
@app.route("/collections/view")
def view_collection():