From 1e7644dd49d7a4af771a1dd00600ae595a9b8d27 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 3 Jan 2022 11:40:33 +0300 Subject: Add more items to trait string Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi --- wqflask/wqflask/partial_correlations_views.py | 4 +++- wqflask/wqflask/static/new/javascript/partial_correlations.js | 3 ++- wqflask/wqflask/templates/collections/view.html | 2 +- wqflask/wqflask/templates/partial_correlations.html | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/wqflask/wqflask/partial_correlations_views.py b/wqflask/wqflask/partial_correlations_views.py index 82287312..f3ec0f78 100644 --- a/wqflask/wqflask/partial_correlations_views.py +++ b/wqflask/wqflask/partial_correlations_views.py @@ -9,7 +9,9 @@ from wqflask import app from utility.tools import GN_SERVER_URL def parse_trait(trait_str: str) -> Union[dict, None]: - keys = ("name", "dataset", "symbol", "description", "data_hmac") + keys = ( + "name", "dataset", "symbol", "description", "location", "mean_expr", + "max_lrs", "data_hmac") parts = tuple(part.strip() for part in trait_str.split(":::")) if len(parts) == len(keys): return dict(zip(keys, parts)) diff --git a/wqflask/wqflask/static/new/javascript/partial_correlations.js b/wqflask/wqflask/static/new/javascript/partial_correlations.js index a6a07558..dea4c675 100644 --- a/wqflask/wqflask/static/new/javascript/partial_correlations.js +++ b/wqflask/wqflask/static/new/javascript/partial_correlations.js @@ -18,7 +18,8 @@ function key_value(keys, values) { function trait(trait_str) { return key_value( - ["name", "dataset", "symbol", "description", "data_hmac"], + ["name", "dataset", "symbol", "description", "location", "mean_expr", + "max_lrs", "data_hmac"], trait_str.split(":::")); } diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index f4270b67..432393a7 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -42,7 +42,7 @@ value="{{uc.uc_id}}" /> + value="{% for this_trait in trait_obs %}{{ this_trait.name }}:::{{ this_trait.dataset.name }}:::{{this_trait.symbol}}:::{{this_trait.description_display}}:::{{this_trait.location_repr}}:::{{this_trait.mean}}:::{{this_trait['LRS_location_repr']}}:::{{data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name))}}|||{% endfor %}" /> + value="{% for trait in traits_list %}{{trait['name']}}:::{{trait['dataset']}}:::{{trait['symbol']}}:::{{trait['description']}}:::{{trait['location']}}:::{{trait['mean_expr']}}:::{{trait['max_lrs']}}:::{{trait['data_hmac']}}|||{% endfor %}"> {%if primary_trait:%}