From a0c3b3ce30d508376b2aa9ddfee4252fca6916ac Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 10 Aug 2022 10:52:25 +0300 Subject: Fix returned value for 'parse_correlation_output' * Always return dict * Fix internal '__parse_line__' to always have a valid return --- gn3/computations/rust_correlation.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py index 23fdf42..7176284 100644 --- a/gn3/computations/rust_correlation.py +++ b/gn3/computations/rust_correlation.py @@ -80,15 +80,16 @@ def parse_correlation_output(result_file: str, "tissue_corr": corr_coeff, "tissue_number": num_overlap, "tissue_p_val": p_val - }, - corr_data) + }) + + return tuple(trait_name, {}) with open(result_file, "r", encoding="utf-8") as file_reader: - return [ + return dict([ __parse_line__(line) - for idx, line in enumerate(file_reader) if idx < top_n] + for idx, line in enumerate(file_reader) if idx < top_n]) - return [] + return {} def get_samples(all_samples: dict[str, str], -- cgit v1.2.3