diff options
author | Frederick Muriuki Muriithi | 2022-08-10 10:52:25 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-08-10 10:52:25 +0300 |
commit | a0c3b3ce30d508376b2aa9ddfee4252fca6916ac (patch) | |
tree | 8064ae5aa32f5a9ad4ff33b608bb33ae9b8242bb /gn3/computations | |
parent | 9917ac266a0f96890075ace28eda3a31408f13b9 (diff) | |
download | genenetwork3-a0c3b3ce30d508376b2aa9ddfee4252fca6916ac.tar.gz |
Fix returned value for 'parse_correlation_output'
* Always return dict
* Fix internal '__parse_line__' to always have a valid return
Diffstat (limited to 'gn3/computations')
-rw-r--r-- | gn3/computations/rust_correlation.py | 11 |
1 files 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], |