diff options
author | zsloan | 2021-05-18 19:41:01 +0000 |
---|---|---|
committer | zsloan | 2021-05-18 19:41:01 +0000 |
commit | e61aa16f0bc3dd282060585e655e497fa3d06b49 (patch) | |
tree | 0515ff7b3378caaccfd9c5f241f4767586e686a4 | |
parent | 74bc179807e80c1ee0f89cd98953263f68a05661 (diff) | |
download | genenetwork3-e61aa16f0bc3dd282060585e655e497fa3d06b49.tar.gz |
Account for boolean kwargs in compose_rqtl_cmd
-rw-r--r-- | gn3/commands.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index db32d1f..add715c 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -31,11 +31,18 @@ def compose_gemma_cmd(gemma_wrapper_cmd: str = "gemma-wrapper", return cmd def compose_rqtl_cmd(rqtl_wrapper_cmd: str, - rqtl_wrapper_kwargs: Dict) -> 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 = rqtl_wrapper_cmd + " " + " ".join( [f"--{key} {val}" for key, val in rqtl_wrapper_kwargs.items()]) + # Add boolean kwargs (kwargs without values) + if len(rqtl_wrapper_bool_kwargs): + cmd += " " + cmd += " ".join([f"--{val}" for val in rqtl_wrapper_bool_kwargs]) + return cmd def queue_cmd(conn: Redis, |