diff options
author | Frederick Muriuki Muriithi | 2022-10-06 10:43:18 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-10-06 10:43:18 +0300 |
commit | 575f08119c7aff56ff86c4fc30ab2eaab061d11d (patch) | |
tree | aafd31e30c41cc39b61e3e2514b110bfd62487c7 | |
parent | 721223e5879cb44d7186a2f32282371c7fb6090a (diff) | |
download | genenetwork2-575f08119c7aff56ff86c4fc30ab2eaab061d11d.tar.gz |
Check for incompatible datasets for various correlation types.
-rw-r--r-- | wqflask/wqflask/correlation/rust_correlation.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index 5c4d0b8a..aee08cba 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -160,6 +160,9 @@ def compute_top_n_sample(start_vars, dataset, trait_list): def compute_top_n_lit(corr_results, target_dataset, this_trait) -> dict: + if not __datasets_compatible_p__(this_trait.dataset, target_dataset, "lit"): + return {} + (this_trait_geneid, geneid_dict, species) = do_lit_correlation( this_trait, target_dataset) @@ -178,8 +181,9 @@ def compute_top_n_lit(corr_results, target_dataset, this_trait) -> dict: def compute_top_n_tissue(target_dataset, this_trait, traits, method): - # refactor lots of rpt + if not __datasets_compatible_p__(this_trait.dataset, target_dataset, "tissue"): + return {} trait_symbol_dict = dict({ trait_name: symbol @@ -326,6 +330,8 @@ def compute_correlation_rust( target_trait_info = create_target_this_trait(start_vars) (this_dataset, this_trait, target_dataset, sample_data) = ( target_trait_info) + if not __datasets_compatible_p__(this_dataset, target_dataset, corr_type): + raise WrongCorrelationType(this_trait, target_dataset, corr_type) # Replace this with `match ...` once we hit Python 3.10 corr_type_fns = { |