From 399fc011556793b3039f64a0050bb112c09ade6d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 6 Sep 2022 13:53:40 +0300 Subject: Placeholder: Set trait location to ??? if the Mb is NULL --- wqflask/wqflask/correlation/rust_correlation.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index a4a08a54..cfa360d0 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -47,6 +47,11 @@ def query_probes_metadata(dataset, trait_list): def get_metadata(dataset, traits): + """Retrieve the metadata""" + def __location__(probe_chr, probe_mb): + if probe_mb: + return f"Chr{probe_chr}: {probe_mb:.6f}" + return f"Chr{probe_chr}: ???" return {trait_name: { "name": trait_name, @@ -58,7 +63,7 @@ def get_metadata(dataset, traits): "description": description, "additive": additive, "lrs_score": f"{lrs:3.1f}", - "location": f"Chr{probe_chr}: {probe_mb:.6f}", + "location": __location__(probe_chr, probe_mb), "lrs_location": f"Chr{chr_score}: {mb:.6f}" } for trait_name, probe_chr, probe_mb, symbol, mean, description, -- cgit v1.2.3