diff options
author | Frederick Muriuki Muriithi | 2021-10-25 15:13:05 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2021-10-25 15:13:05 +0300 |
commit | 5a472ebab04c68cd5228f253cc98d0ae22a520d7 (patch) | |
tree | 3d6b1a5a8933896a6e7fdc98f473ef069accd348 /tests/unit/computations/test_wgcna.py | |
parent | 0814eea6b57e45d4337424e63c164d204d03b64d (diff) | |
parent | 5440bfcd6940db08c4479a39ba66dbc802b2c426 (diff) | |
download | genenetwork3-5a472ebab04c68cd5228f253cc98d0ae22a520d7.tar.gz |
Merge branch 'main' of github.com:genenetwork/genenetwork3 into partial-correlations
Diffstat (limited to 'tests/unit/computations/test_wgcna.py')
-rw-r--r-- | tests/unit/computations/test_wgcna.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/unit/computations/test_wgcna.py b/tests/unit/computations/test_wgcna.py index ec81d94..5f23a86 100644 --- a/tests/unit/computations/test_wgcna.py +++ b/tests/unit/computations/test_wgcna.py @@ -10,13 +10,16 @@ from gn3.computations.wgcna import call_wgcna_script class TestWgcna(TestCase): """test class for wgcna""" + @mock.patch("gn3.computations.wgcna.process_image") @mock.patch("gn3.computations.wgcna.run_cmd") @mock.patch("gn3.computations.wgcna.compose_wgcna_cmd") @mock.patch("gn3.computations.wgcna.dump_wgcna_data") def test_call_wgcna_script(self, mock_dumping_data, mock_compose_wgcna, - mock_run_cmd): + mock_run_cmd, + mock_img, + ): """test for calling wgcna script""" # pylint: disable = line-too-long @@ -50,7 +53,7 @@ class TestWgcna(TestCase): "output": "Flagging genes and samples with too many missing values...\n ..step 1\nAllowing parallel execution with up to 3 working processes.\npickSoftThreshold: will use block size 7.\n pickSoftThreshold: calculating connectivity for given powers...\n ..working on genes 1 through 7 of 7\n Flagging genes and samples with too many missing values...\n ..step 1\n ..Working on block 1 .\n TOM calculation: adjacency..\n ..will not use multithreading.\nclustering..\n ....detecting modules..\n ....calculating module eigengenes..\n ....checking kME in modules..\n ..merging modules that are too close..\n mergeCloseModules: Merging modules whose distance is less than 0.15\n mergeCloseModules: less than two proper modules.\n ..color levels are turquoise\n ..there is nothing to merge.\n Calculating new MEs...\n" } - json_output = "{\"inputdata\":{\"trait_sample_data \":{},\"minModuleSize\":30,\"TOMtype\":\"unsigned\"},\"outputdata\":{\"eigengenes\":[],\"colors\":[]}}" + json_output = "{\"inputdata\":{\"trait_sample_data \":{},\"minModuleSize\":30,\"TOMtype\":\"unsigned\"},\"output\":{\"eigengenes\":[],\"imageLoc\":[],\"colors\":[]}}" expected_output = { @@ -61,9 +64,11 @@ class TestWgcna(TestCase): "TOMtype": "unsigned" }, - "outputdata": { + "output": { "eigengenes": [], - "colors": [] + "imageLoc": [], + "colors": [], + "image_data": "AFDSFNBSDGJJHH" } }, @@ -74,6 +79,7 @@ class TestWgcna(TestCase): with mock.patch("builtins.open", mock.mock_open(read_data=json_output)): mock_run_cmd.return_value = mock_run_cmd_results + mock_img.return_value = b"AFDSFNBSDGJJHH" results = call_wgcna_script( "Rscript/GUIX_PATH/scripts/r_file.R", request_data) |