From 131394ac737aac7e6fced7cfb07f9e9d538b9506 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 13 Dec 2021 15:56:01 +0300 Subject: Run partial correlations against chosen database Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Run the partial correlations against the database that the user selects, and not the one from which the primary trait is. This was a bug in the code. --- gn3/computations/partial_correlations.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index 719c605..bda6ba2 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -640,12 +640,20 @@ def partial_correlations_entry(# pylint: disable=[R0913, R0914, R0911] "any associated Tissue Correlation Information."), "error_type": "Tissue Correlation"} + target_dataset = retrieve_trait_dataset( + ("Temp" if "Temp" in target_db_name else + ("Publish" if "Publish" in target_db_name else + "Geno" if "Geno" in target_db_name else "ProbeSet")), + {"db": {"dataset_name": target_db_name}, "trait_name": "_"}, + threshold, + conn) + database_filename = get_filename(conn, target_db_name, TEXTDIR) _total_traits, all_correlations = partial_corrs( conn, common_primary_control_samples, fixed_primary_vals, fixed_control_vals, len(fixed_primary_vals), species, input_trait_geneid, input_trait_symbol, tissue_probeset_freeze_id, - method, primary_trait["db"], database_filename) + method, {**target_dataset, "dataset_type": target_dataset["type"]}, database_filename) def __make_sorter__(method): -- cgit v1.2.3