diff options
-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 |