aboutsummaryrefslogtreecommitdiff
path: root/gn3/commands.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-06-20 09:11:03 +0300
committerAlexander Kabui2021-06-20 09:11:03 +0300
commit123ad47af288d6b94f0354a0abd5bc669bc988d4 (patch)
tree999eb41c1fab3d443215c0e4a8533abecf64f9af /gn3/commands.py
parent75801d83c8302b48051d413490e6ce2a0b8ff01f (diff)
parentd653a635d0efd2291754c18f51d31f91a1c0a25c (diff)
downloadgenenetwork3-123ad47af288d6b94f0354a0abd5bc669bc988d4.tar.gz
merge main
Diffstat (limited to 'gn3/commands.py')
-rw-r--r--gn3/commands.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gn3/commands.py b/gn3/commands.py
index 4b0d62d..14bd295 100644
--- a/gn3/commands.py
+++ b/gn3/commands.py
@@ -30,6 +30,20 @@ def compose_gemma_cmd(gemma_wrapper_cmd: str = "gemma-wrapper",
cmd += " ".join([f"{arg}" for arg in gemma_args])
return cmd
+def compose_rqtl_cmd(rqtl_wrapper_cmd: str,
+ rqtl_wrapper_kwargs: Dict,
+ rqtl_wrapper_bool_kwargs: list) -> str:
+ """Compose a valid R/qtl command given the correct input"""
+ # Add kwargs with values
+ cmd = f"Rscript { rqtl_wrapper_cmd } " + " ".join(
+ [f"--{key} {val}" for key, val in rqtl_wrapper_kwargs.items()])
+
+ # Add boolean kwargs (kwargs that are either on or off, like --interval)
+ if rqtl_wrapper_bool_kwargs:
+ cmd += " "
+ cmd += " ".join([f"--{val}" for val in rqtl_wrapper_bool_kwargs])
+
+ return cmd
def queue_cmd(conn: Redis,
job_queue: str,