aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-10-29 08:48:16 +0300
committerBonfaceKilz2021-11-04 12:45:57 +0300
commit5a81b7ae59702d6393e9f74a00d8394131b5192a (patch)
treec0b3613a0d4c9ddbf184c18fe499cc668c7344ad /gn3
parentfed4c481eceb0ce464deee6262b96676eb869ad3 (diff)
downloadgenenetwork3-5a81b7ae59702d6393e9f74a00d8394131b5192a.tar.gz
Explicitly round the values
* Explicitly round the values to prevent issues with the type-checker
Diffstat (limited to 'gn3')
-rw-r--r--gn3/computations/partial_correlations.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py
index 8a00931..151143a 100644
--- a/gn3/computations/partial_correlations.py
+++ b/gn3/computations/partial_correlations.py
@@ -148,9 +148,8 @@ def tissue_correlation(
assert method in method_fns.keys(), (
"Method must be one of: {}".format(",".join(method_fns.keys())))
- return tuple(
- round(n, 10) for n in
- method_fns[method](primary_trait_values, target_trait_values))
+ corr, pvalue = method_fns[method](primary_trait_values, target_trait_values)
+ return (round(corr, 10), round(pvalue, 10))
def batch_computed_tissue_correlation(
primary_trait_values: Tuple[float, ...], target_traits_dict: dict,