diff options
author | Frederick Muriuki Muriithi | 2022-08-16 16:04:19 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-08-16 16:04:19 +0300 |
commit | ee4436538b124b1cd311b396998b1d1d9eb641ef (patch) | |
tree | 731f1e3e623c6f409894637bdf7061ea541925a4 | |
parent | 7223c87be6849e591d9ebd3cd81d526ca0bb0571 (diff) | |
download | genenetwork2-ee4436538b124b1cd311b396998b1d1d9eb641ef.tar.gz |
Merge dicts into single result
-rw-r--r-- | wqflask/wqflask/correlation/rust_correlation.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index b93c306d..79d08a59 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -122,9 +122,12 @@ def __compute_lit_corr__( this_trait, this_dataset) with database_connector() as conn: - return dict(compute_all_lit_correlation( - conn=conn, trait_lists=list(geneid_dict.items()), - species=species, gene_id=this_trait_geneid)) + return reduce( + lambda acc, lit: {**acc, **lit}, + compute_all_lit_correlation( + conn=conn, trait_lists=list(geneid_dict.items()), + species=species, gene_id=this_trait_geneid), + {}) return {} def compute_correlation_rust( |