diff options
| author | Alexander_Kabui | 2025-02-07 14:24:01 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2025-02-07 14:24:53 +0300 |
| commit | 6c2c31f83786472b3f9cccd5c3cb2f70ceec4a63 (patch) | |
| tree | 2682f37a3dcdf5b27ae3d4829af10af65e7b1006 | |
| parent | febd6ebebfba2b585d98c3e5e35c6713c9781036 (diff) | |
| download | genenetwork3-6c2c31f83786472b3f9cccd5c3cb2f70ceec4a63.tar.gz | |
refactor: Add rqtl2 default method and update unittests.
| -rw-r--r-- | gn3/computations/rqtl2.py | 2 | ||||
| -rw-r--r-- | tests/unit/test_rqtl2.py | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/gn3/computations/rqtl2.py b/gn3/computations/rqtl2.py index 206af1c..ae1e475 100644 --- a/gn3/computations/rqtl2.py +++ b/gn3/computations/rqtl2.py @@ -67,7 +67,7 @@ def compose_rqtl2_cmd(rqtl_path, input_file, "directory": workspace_dir, "output_file": output_file, "nperm": data.get("nperm", 0), - "method": data.get("method"), + "method": data.get("method", "HK"), "threshold": data.get("threshold", 1), "cores": config.get('MULTIPROCESSOR_PROCS', 1) } diff --git a/tests/unit/test_rqtl2.py b/tests/unit/test_rqtl2.py index f7830db..ddce91b 100644 --- a/tests/unit/test_rqtl2.py +++ b/tests/unit/test_rqtl2.py @@ -73,7 +73,7 @@ def test_compose_rqtl2_cmd(): input_file = "/tmp/575732e-691e-49e5-8d82-30c564927c95/input_file.json" output_file = "/tmp/575732e-691e-49e5-8d82-30c564927c95/output_file.json" directory = "/tmp/575732e-691e-49e5-8d82-30c564927c95" - expected_results = f"Rscript /rqtl2_wrapper.R --input_file {input_file} --directory {directory} --output_file {output_file} --nperm 12 --threshold 0.05 --cores 1" + expected_results = f"Rscript /rqtl2_wrapper.R --input_file {input_file} --directory {directory} --output_file {output_file} --nperm 12 --method LMM --threshold 0.05 --cores 1" # test for using default configs assert compose_rqtl2_cmd(rqtl_path="/rqtl2_wrapper.R", @@ -82,12 +82,13 @@ def test_compose_rqtl2_cmd(): workspace_dir=directory, data={ "nperm": 12, - "threshold": 0.05 + "threshold": 0.05, + "method" : "LMM" }, config={}) == expected_results - # test for default permutation and threshold and custom configs - expected_results = f"/bin/rscript /rqtl2_wrapper.R --input_file {input_file} --directory {directory} --output_file {output_file} --nperm 0 --threshold 1 --cores 12" + # test for default permutation, method and threshold and custom configs + expected_results = f"/bin/rscript /rqtl2_wrapper.R --input_file {input_file} --directory {directory} --output_file {output_file} --nperm 0 --method HK --threshold 1 --cores 12" assert (compose_rqtl2_cmd(rqtl_path="/rqtl2_wrapper.R", input_file=input_file, output_file=output_file, |
