about summary refs log tree commit diff
path: root/gn3/computations
diff options
context:
space:
mode:
authorAlexander_Kabui2022-07-07 23:02:19 +0300
committerBonfaceKilz2022-07-22 14:52:08 +0300
commit0c13d30e7008ff8285e33c39316211b48dc82ca1 (patch)
tree0b6980141272152e61f3c6e090cb9c72f40daf0f /gn3/computations
parent484f5bf25cfe731c9ba5b06ab12fcc7a52f4dbb2 (diff)
downloadgenenetwork3-0c13d30e7008ff8285e33c39316211b48dc82ca1.tar.gz
code to fetch correct sample corr data
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/rust_correlation.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py
index 831ef35..0cd3ee2 100644
--- a/gn3/computations/rust_correlation.py
+++ b/gn3/computations/rust_correlation.py
@@ -119,3 +119,24 @@ def get_samples(all_samples: dict[str, str],
 
     return({key: float(val) for (key, val) in all_samples.items()
             if key not in excluded and val.lower().strip() != "x"})
+
+
+def get_sample_corr_data(sample_type: str,
+                         all_samples: dict[str, str],
+                         dataset_samples: list[str]) -> dict[str, str]:
+    """dependeing on the sample_type fetch the correct sample data """
+
+    if sample_type == "samples_primary":
+
+        data = get_samples(all_samples=all_samples,
+                           base_samples=dataset_samples, excluded=[])
+
+    elif sample_type == "samples_other":
+        data = get_samples(
+            all_samples=all_samples,
+            base_samples=[],
+            excluded=dataset_samples)
+    else:
+        data = get_samples(
+            all_samples=all_samples, base_samples=[], excluded=[])
+    return data