about summary refs log tree commit diff
path: root/gn3/computations/qtlreaper.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-10-22 13:27:54 -0500
committerFrederick Muriuki Muriithi2025-10-22 13:27:54 -0500
commit05013c13710eccadb69746bf186eb672c2af69c4 (patch)
tree71a706fd30bf0d535a0fab737bb0e42a1667e60b /gn3/computations/qtlreaper.py
parent977efbb54da284fb3e8476f200206d00cb8e64cd (diff)
downloadgenenetwork3-05013c13710eccadb69746bf186eb672c2af69c4.tar.gz
Fetch configs from app setting and pass them down
Fix the code to avoid using global variables holding configuration
variables to avoid the failures caused by action-at-a-distance effects
due to change of a value elsewhere.

This way, all code consistently receives the same configuration values
passed on from callers.

We pass on the following configuration settings:
* TMPDIR
* SQL_URI
* TEXTDIR
Diffstat (limited to 'gn3/computations/qtlreaper.py')
-rw-r--r--gn3/computations/qtlreaper.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py
index e0d9d0b..ff83b33 100644
--- a/gn3/computations/qtlreaper.py
+++ b/gn3/computations/qtlreaper.py
@@ -7,7 +7,6 @@ import subprocess
 from typing import Union
 
 from gn3.chancy import random_string
-from gn3.settings import TMPDIR
 
 def generate_traits_file(samples, trait_values, traits_filename):
     """
@@ -41,10 +40,12 @@ def create_output_directory(path: str):
 # pylint: disable=[too-many-arguments, too-many-positional-arguments]
 def run_reaper(
         reaper_cmd: str,
-        genotype_filename: str, traits_filename: str,
+        genotype_filename: str,
+        traits_filename: str,
+        output_dir: str,
         other_options: tuple = ("--n_permutations", "1000"),
-        separate_nperm_output: bool = False,
-        output_dir: str = TMPDIR):
+        separate_nperm_output: bool = False
+):
     """
     Run the QTLReaper command to compute the QTLs.