diff options
author | Frederick Muriuki Muriithi | 2022-05-30 09:41:33 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-05-30 09:55:13 +0300 |
commit | 85e369311b60faa2490f25c88a2ef87042b91738 (patch) | |
tree | 44dc1150e008a91c1373bd04bda07691f0549215 /tests | |
parent | 7bcd718a2954c2f1ff67bea84d79c7cd9a1d43a0 (diff) | |
download | genenetwork3-85e369311b60faa2490f25c88a2ef87042b91738.tar.gz |
Pass trait data as args to `fix_strains` and fix some bugs
The `fix_strains` function works on the trait data, not the basic trait
info. This commit fixes the arguments passed to the function, and also some
bugs in the function.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/computations/test_partial_correlations.py | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/tests/unit/computations/test_partial_correlations.py b/tests/unit/computations/test_partial_correlations.py index 81ddbcc..20cd6bc 100644 --- a/tests/unit/computations/test_partial_correlations.py +++ b/tests/unit/computations/test_partial_correlations.py @@ -81,19 +81,24 @@ control_traits = ( "ndata": None}}}) dictified_control_samples = ( - {"B6cC3-1": {"sample_name": "B6cC3-1", "value": 7.51879, "variance": None}, - "BXD1": {"sample_name": "BXD1", "value": 7.77141, "variance": None}, - "BXD12": {"sample_name": "BXD12", "value": 8.39265, "variance": None}, - "BXD16": {"sample_name": "BXD16", "value": 8.17443, "variance": None}, - "BXD19": {"sample_name": "BXD19", "value": 8.30401, "variance": None}, - "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}, - {"BXD12": {"sample_name": "BXD12", "value": 8.39265, "variance": None}, - "BXD16": {"sample_name": "BXD16", "value": 8.17443, "variance": None}, - "BXD19": {"sample_name": "BXD19", "value": 8.30401, "variance": None}, - "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}, - {"B6cC3-1": {"sample_name": "B6cC3-1", "value": 7.51879, "variance": None}, - "BXD1": {"sample_name": "BXD1", "value": 7.77141, "variance": None}, - "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}) + {"data": { + "B6cC3-1": { + "sample_name": "B6cC3-1", "value": 7.51879,"variance": None}, + "BXD1": {"sample_name": "BXD1", "value": 7.77141, "variance": None}, + "BXD12": {"sample_name": "BXD12", "value": 8.39265, "variance": None}, + "BXD16": {"sample_name": "BXD16", "value": 8.17443, "variance": None}, + "BXD19": {"sample_name": "BXD19", "value": 8.30401, "variance": None}, + "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}}, + {"data": { + "BXD12": {"sample_name": "BXD12", "value": 8.39265, "variance": None}, + "BXD16": {"sample_name": "BXD16", "value": 8.17443, "variance": None}, + "BXD19": {"sample_name": "BXD19", "value": 8.30401, "variance": None}, + "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}}, + {"data": { + "B6cC3-1": { + "sample_name": "B6cC3-1", "value": 7.51879, "variance": None}, + "BXD1": {"sample_name": "BXD1", "value": 7.77141, "variance": None}, + "BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}}}) class TestPartialCorrelations(TestCase): """Class for testing partial correlations computation functions""" @@ -145,12 +150,13 @@ class TestPartialCorrelations(TestCase): """ self.assertEqual( fix_samples( - {"B6cC3-1": {"sample_name": "B6cC3-1", "value": 7.51879, - "variance": None}, - "BXD1": {"sample_name": "BXD1", "value": 7.77141, - "variance": None}, - "BXD2": {"sample_name": "BXD2", "value": 7.80944, - "variance": None}}, + {"data": {"B6cC3-1": {"sample_name": "B6cC3-1", + "value": 7.51879, + "variance": None}, + "BXD1": {"sample_name": "BXD1", "value": 7.77141, + "variance": None}, + "BXD2": {"sample_name": "BXD2", "value": 7.80944, + "variance": None}}}, dictified_control_samples), (("BXD2",), (7.80944,), (7.51879, 7.77141, 8.39265, 8.17443, 8.30401, 7.80944, 8.39265, |