diff options
| author | Munyoki Kilyungi | 2024-12-12 08:16:11 +0300 |
|---|---|---|
| committer | Munyoki Kilyungi | 2024-12-12 08:16:11 +0300 |
| commit | 1842488ffc2c23e99196f319ed62d46fa26f25b4 (patch) | |
| tree | 22c3a4a73bdcabdc06f769533150abccc3c345c0 /gn3/commands.py | |
| parent | 38abf6e496faa8bcf701496d4942224231629202 (diff) | |
| download | genenetwork3-1842488ffc2c23e99196f319ed62d46fa26f25b4.tar.gz | |
Fetch RSCRIPT command from global environment variable.
* gn3/commands.py (compose_rqtl_cmd): Fetch RSCRIPT from global environment. Otherwise default to "Rscript". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/commands.py')
| -rw-r--r-- | gn3/commands.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index 9617663..74c634c 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -1,5 +1,6 @@ """Procedures used to work with the various bio-informatics cli commands""" +import os import sys import json import pickle @@ -49,7 +50,8 @@ def compose_rqtl_cmd(rqtl_wrapper_cmd: str, 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( + rscript = os.environ.get("RSCRIPT", "Rscript") + 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) |
