aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/gemma.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-03-01 11:47:21 +0300
committerBonfaceKilz2021-03-08 21:09:58 +0300
commit52e3569cca6b24d1318034f5ab004795e70135f5 (patch)
tree8d65ba9802bc617b6b6936248aea426b1c5df3bd /gn3/computations/gemma.py
parentb9d9ece5da00828fbe8c9984c8c43fd1659faeb9 (diff)
downloadgenenetwork3-52e3569cca6b24d1318034f5ab004795e70135f5.tar.gz
Fix failing tests
Diffstat (limited to 'gn3/computations/gemma.py')
-rw-r--r--gn3/computations/gemma.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gn3/computations/gemma.py b/gn3/computations/gemma.py
index 5741692..528f888 100644
--- a/gn3/computations/gemma.py
+++ b/gn3/computations/gemma.py
@@ -55,10 +55,12 @@ def do_paths_exist(paths: ValuesView) -> bool:
return True
-def generate_gemma_computation_cmd(gemma_cmd: str,
- gemma_kwargs: Dict[str, str],
- output_file: str) -> Optional[str]:
- """Create a higher order function that generates a command"""
+def generate_gemma_computation_cmd(
+ gemma_cmd: str,
+ gemma_kwargs: Dict[str, str],
+ output_file: str,
+ gemma_wrapper_kwargs: Dict[str, str]) -> Optional[str]:
+ """Create a computation cmd"""
geno_filename = gemma_kwargs.get("geno_filename", "")
trait_filename = gemma_kwargs.get("trait_filename")
ext, snps_filename = geno_filename.partition(".")[-1], ""
@@ -66,13 +68,13 @@ def generate_gemma_computation_cmd(gemma_cmd: str,
snps_filename = geno_filename.replace(f".{ext}", "")
snps_filename += f"_snps.{ext}"
_kwargs = {"g": geno_filename, "p": trait_filename}
- if gemma_kwargs.get("covar_filename"):
- _kwargs["a"] = gemma_kwargs.get("covar_filename")
+ _kwargs["a"] = snps_filename
if not do_paths_exist(_kwargs.values()): # Prevents injection!
return None
if _kwargs.get("lmm"):
_kwargs["lmm"] = gemma_kwargs.get("lmm")
return compose_gemma_cmd(gemma_wrapper_cmd=gemma_cmd,
+ gemma_wrapper_kwargs=gemma_wrapper_kwargs,
gemma_kwargs=_kwargs,
gemma_args=["-gk", ">",
output_file])