aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-09 07:53:41 +0300
committerFrederick Muriuki Muriithi2022-08-09 07:53:41 +0300
commitf1044209224945762dbb27226a0c7dc2c6fa6085 (patch)
tree544a2642f6d758652c37f07b060f754dbdae1313
parentefd11112ccd7c13c694bd3668cbf54207d6d58f4 (diff)
downloadgenenetwork2-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.
-rw-r--r--wqflask/wqflask/correlation/correlation_gn3_api.py10
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")