diff options
-rw-r--r-- | gn3/computations/partial_correlations.py | 4 | ||||
-rw-r--r-- | tests/unit/computations/test_partial_correlations.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index fce6ad2..8a00931 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -148,7 +148,9 @@ def tissue_correlation( assert method in method_fns.keys(), ( "Method must be one of: {}".format(",".join(method_fns.keys()))) - return method_fns[method](primary_trait_values, target_trait_values) + return tuple( + round(n, 10) for n in + method_fns[method](primary_trait_values, target_trait_values)) def batch_computed_tissue_correlation( primary_trait_values: Tuple[float, ...], target_traits_dict: dict, diff --git a/tests/unit/computations/test_partial_correlations.py b/tests/unit/computations/test_partial_correlations.py index ac5eb20..c4ec79a 100644 --- a/tests/unit/computations/test_partial_correlations.py +++ b/tests/unit/computations/test_partial_correlations.py @@ -254,10 +254,9 @@ class TestPartialCorrelations(TestCase): """ for primary, target, method, expected in ( ((12.34, 18.36, 42.51), (37.25, 46.25, 46.56), "pearson", - (0.6761779252651052, 0.5272701133657985)), + (0.6761779253, 0.5272701134)), ((1, 2, 3, 4, 5), (5, 6, 7, 8, 7), "spearman", - (0.8207826816681233, 0.08858700531354381)) - ): + (0.8207826817, 0.0885870053))): with self.subTest(primary=primary, target=target, method=method): self.assertEqual( tissue_correlation(primary, target, method), expected) |