diff --git a/src/workflow/CommandExecutor.py b/src/workflow/CommandExecutor.py index 6cc49301..74ffff49 100644 --- a/src/workflow/CommandExecutor.py +++ b/src/workflow/CommandExecutor.py @@ -166,9 +166,15 @@ def run_topp(self, tool: str, input_output: dict, custom_params: dict = {}) -> N # Add non-default TOPP tool parameters if tool in params.keys(): for k, v in params[tool].items(): - command += [f"-{k}"] + # Handle the case where f is a flag and v is false by just skipping + if v != False: + command += [f"-{k}"] + # add the value if we aren't a flag if isinstance(v, str) and "\n" in v: command += v.split("\n") + # If we are a flag don't append the value + elif isinstance(v, bool): + continue else: command += [str(v)] # Add custom parameters @@ -265,4 +271,4 @@ def run_python(self, script_file: str, input_output: dict = {}) -> None: # run command self.run_command(["python", str(path), str(tmp_params_file)]) # remove tmp params file - tmp_params_file.unlink() \ No newline at end of file + tmp_params_file.unlink()