diff options
Diffstat (limited to 'wqflask')
4 files changed, 6 insertions, 3 deletions
diff --git a/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_geno.txt b/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_geno.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_geno.txt diff --git a/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_snps.txt b/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_snps.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_snps.txt diff --git a/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py b/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py index 43051828..24400b33 100644 --- a/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py +++ b/wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py @@ -1,4 +1,5 @@ # test for wqflask/marker_regression/gemma_mapping.py +import os import unittest import random from unittest import mock @@ -40,7 +41,8 @@ class TestGemmaMapping(unittest.TestCase): @mock.patch("wqflask.marker_regression.gemma_mapping.webqtlConfig.GENERATED_IMAGE_DIR", "/home/user/img") @mock.patch("wqflask.marker_regression.gemma_mapping.GEMMAOPTS", "-debug") @mock.patch("wqflask.marker_regression.gemma_mapping.GEMMA_WRAPPER_COMMAND", "ghc") - @mock.patch("wqflask.marker_regression.gemma_mapping.TEMPDIR", "/home/user/data/") + @mock.patch("wqflask.marker_regression.gemma_mapping.TEMPDIR", + os.path.join(os.path.dirname(__file__), "user/data")) @mock.patch("wqflask.marker_regression.gemma_mapping.parse_loco_output") @mock.patch("wqflask.marker_regression.gemma_mapping.flat_files") @mock.patch("wqflask.marker_regression.gemma_mapping.gen_covariates_file") @@ -64,7 +66,8 @@ class TestGemmaMapping(unittest.TestCase): mock_os.path.isfile.return_value = True mock_gen_covar.return_value = None mock_choice.return_value = "R" - mock_flat_files.return_value = "/home/genotype/bimbam" + mock_flat_files.return_value = os.path.join( + os.path.dirname(__file__), "genotype/bimbam") mock_parse_loco.return_value = [] results = run_gemma(this_trait=trait, this_dataset=dataset, samples=[ ], vals=[], covariates="", use_loco=True) diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py index fa7f0beb..cc063d03 100644 --- a/wqflask/wqflask/marker_regression/gemma_mapping.py +++ b/wqflask/wqflask/marker_regression/gemma_mapping.py @@ -58,7 +58,7 @@ def run_gemma(this_trait, this_dataset, samples, vals, covariates, use_loco, bimbam_dir = flat_files('genotype/bimbam') geno_filepath = assert_file( f"{bimbam_dir}/{genofile_name}_geno.txt") - pheno_filepath = assert_file(f"{TEMPDIR}/gn2/{pheno_filename}.txt") + pheno_filepath = f"{TEMPDIR}/gn2/{pheno_filename}.txt" snps_filepath = assert_file( f"{bimbam_dir}/{genofile_name}_snps.txt") k_json_output_filepath = f"{TEMPDIR}/gn2/{k_output_filename}.json" |