diff options
author | Alexander_Kabui | 2022-07-28 21:01:06 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-08-10 09:23:25 +0300 |
commit | bfad75864d50d0cbe2b63a6b7a7b866215b61022 (patch) | |
tree | 03082836c837dac1c2bbbd67922edf5e01445b22 | |
parent | 69ab1d5dfa04fbff326df35349c55fc9b4d31f2a (diff) | |
download | genenetwork3-bfad75864d50d0cbe2b63a6b7a7b866215b61022.tar.gz |
merge for results
-rw-r--r-- | gn3/computations/rust_correlation.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py index db357fe..d8d2cf0 100644 --- a/gn3/computations/rust_correlation.py +++ b/gn3/computations/rust_correlation.py @@ -165,3 +165,21 @@ def parse_tissue_corr_data(symbol_name: str, def parse_lit_corr_data(_trait, _dataset): """todo:parse lit data""" + + +def merge_corr_results(results_a: dict, results_b: dict): + """merge results when computing all correlations""" + + results = [] + + for (name, corr_values) in results_a.items(): + if results_b.get(name): + tmp = results_a[name] #dict + tmp.update(results_b[name]) + + output = tmp + else: + output = corr_values + + results.append({name: output}) + return results |