diff options
author | Frederick Muriuki Muriithi | 2022-08-09 07:53:41 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-08-09 07:53:41 +0300 |
commit | f1044209224945762dbb27226a0c7dc2c6fa6085 (patch) | |
tree | 544a2642f6d758652c37f07b060f754dbdae1313 /wqflask | |
parent | efd11112ccd7c13c694bd3668cbf54207d6d58f4 (diff) | |
download | genenetwork2-f1044209224945762dbb27226a0c7dc2c6fa6085.tar.gz |
Integrate rust correlation for "sample" correlation selection
Integrate the use of the rust code to compute the correlations for the
"sample" correlation selection.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/correlation/correlation_gn3_api.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py index fe05635e..e2346840 100644 --- a/wqflask/wqflask/correlation/correlation_gn3_api.py +++ b/wqflask/wqflask/correlation/correlation_gn3_api.py @@ -11,12 +11,13 @@ from base import data_set from base.trait import create_trait from base.trait import retrieve_sample_data +from gn3.db_utils import database_connector from gn3.commands import run_sample_corr_cmd -from gn3.computations.correlations import fast_compute_all_sample_correlation from gn3.computations.correlations import map_shared_keys_to_values from gn3.computations.correlations import compute_all_lit_correlation from gn3.computations.correlations import compute_tissue_correlation -from gn3.db_utils import database_connector +from wqflask.correlation.rust_correlation import compute_correlation_rust +from gn3.computations.correlations import fast_compute_all_sample_correlation def create_target_this_trait(start_vars): @@ -211,8 +212,9 @@ def compute_correlation(start_vars, method="pearson", compute_all=False): if corr_type == "sample": (this_trait_data, target_dataset_data) = fetch_sample_data( start_vars, this_trait, this_dataset, target_dataset) - correlation_results = run_sample_corr_cmd( - method, this_trait_data, target_dataset_data) + rust_correlation_results = compute_correlation_rust( + start_vars, corr_type, method, corr_return_results) + correlation_results = rust_correlation_results["correlation_results"] elif corr_type == "tissue": trait_symbol_dict = this_dataset.retrieve_genes("Symbol") |