aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-12 12:52:38 +0300
committerFrederick Muriuki Muriithi2022-08-12 13:13:27 +0300
commit4bc374aeeba3e9fac75dea266e35bedb633f950c (patch)
tree2f4170168cfdaf0273393fd21442e8ed76640fee
parent17ca7e77631f1fc6a247accfb39cf8da23dc4a92 (diff)
downloadgenenetwork2-4bc374aeeba3e9fac75dea266e35bedb633f950c.tar.gz
Fix some issues with the tests. Add notes in code for improvements.
-rw-r--r--test/requests/correlation_tests.py9
-rw-r--r--wqflask/wqflask/correlation/rust_correlation.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/test/requests/correlation_tests.py b/test/requests/correlation_tests.py
index 0b8ba8cd..2d314833 100644
--- a/test/requests/correlation_tests.py
+++ b/test/requests/correlation_tests.py
@@ -12,6 +12,7 @@ def do_request(url, data):
"dataset": "HC_M2_0606_P",
"trait_id": "1435464_at",
"corr_dataset": "HC_M2_0606_P",
+ "corr_sample_method": "pearson",
"corr_return_results": "100",
"corr_samples_group": "samples_primary",
"sample_vals": sample_vals(),
@@ -34,7 +35,6 @@ def check_sample_correlations(baseurl):
def check_tissue_correlations(baseurl):
data = {
"corr_type": "tissue",
- "corr_sample_method": "pearson",
"location_type": "gene",
}
top_n_message = "The top 100 correlations ranked by the Tissue Correlation"
@@ -58,12 +58,13 @@ def check_correlations(args_obj, parser):
print("")
print("Checking the correlations...")
corr_type_fns = {
- "sample": check_sample_correlations,}
+ "sample": check_sample_correlations,
+ "tissue": check_tissue_correlations,
+ "tissue": check_lit_correlations
+ }
host = args_obj.host
for corr_type, corr_type_fn in corr_type_fns.items():
print(f"\tChecking {corr_type} correlations...", end="")
corr_type_fn(host)
print(" ok")
- check_tissue_correlations(host)
- check_lit_correlations(host)
print("OK")
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py
index b4435887..3628f549 100644
--- a/wqflask/wqflask/correlation/rust_correlation.py
+++ b/wqflask/wqflask/correlation/rust_correlation.py
@@ -135,6 +135,7 @@ def compute_correlation_rust(
(this_dataset, this_trait, target_dataset, sample_data) = (
target_trait_info)
+ ## Replace this with `match ...` once we hit Python 3.10
corr_type_fns = {
"sample": __compute_sample_corr__,
"tissue": __compute_tissue_corr__,
@@ -142,6 +143,7 @@ def compute_correlation_rust(
}
results = corr_type_fns[corr_type](
start_vars, corr_type, method, n_top, target_trait_info)
+ ## END: Replace this with `match ...` once we hit Python 3.10
top_tissue_results = {}
top_lit_results = {}