aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorAlexander_Kabui2022-08-10 08:12:14 +0300
committerFrederick Muriuki Muriithi2022-08-10 09:27:59 +0300
commitb0fc7affdf73e5a0472f75cce26c170f03f5d86d (patch)
treee6040748365d1693235547ff109f25973573a5cb /gn3/computations
parent8a5f25d07ed1167ff48dbe27dd48a3a8d735d1ac (diff)
downloadgenenetwork3-b0fc7affdf73e5a0472f75cce26c170f03f5d86d.tar.gz
code refactoring
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/rust_correlation.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py
index 9a4af32..54d9243 100644
--- a/gn3/computations/rust_correlation.py
+++ b/gn3/computations/rust_correlation.py
@@ -65,21 +65,23 @@ def parse_correlation_output(result_file: str,
def __parse_line__(line):
(trait_name, corr_coeff, p_val, num_overlap) = line.rstrip().split(",")
if corr_type == "sample":
- return {
- trait_name: {
- "num_overlap": num_overlap,
- "corr_coefficient": corr_coeff,
- "p_value": p_val
- }
- }
- if corr_type == "tissue":
- return {
- trait_name: {
+ return (
+ trait_name,
+ {
+ "num_overlap": num_overlap,
+ "corr_coefficient": corr_coeff,
+ "p_value": p_val
+ })
+
+ elif corr_type == "tissue":
+ return (
+ trait_name,
+ {
"tissue_corr": corr_coeff,
"tissue_number": num_overlap,
"tissue_p_val": p_val
- }
- }
+ },
+ corr_data)
with open(result_file, "r", encoding="utf-8") as file_reader:
return [
@@ -89,7 +91,6 @@ def parse_correlation_output(result_file: str,
return []
-
def get_samples(all_samples: dict[str, str],
base_samples: list[str],
excluded: list[str]):