diff --git a/denv_pipeline/command.py b/denv_pipeline/command.py index 3e6c345..9bfc5a1 100644 --- a/denv_pipeline/command.py +++ b/denv_pipeline/command.py @@ -40,6 +40,7 @@ def main(sysargs = sys.argv[1:]): parser.add_argument("--slurm", help="flag for if running on HPC with slurm", action="store_true") parser.add_argument("--slurm-cores", help="number of slurm cores to assign. Default is 10", dest="slurm_cores", type=int) + parser.add_argument("--cores", help="number of non-slurm cores to assign. Default is 1", type=int) parser.add_argument("--verbose", "-v", dest="verbose", action="store_true") parser.add_argument("--help", "-h", action="store_true", dest="help") parser.add_argument("--overwrite", help="overwrite current results", action="store_true") @@ -111,6 +112,10 @@ def main(sysargs = sys.argv[1:]): status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True, workdir=cwd,config=config,lock=False, slurm=True, cores=config["slurm_cores"] ) + elif config["cores"]: + status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True, + workdir=cwd,config=config,lock=False, cores=config["cores"] + ) else: status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True, workdir=cwd,config=config,lock=False diff --git a/denv_pipeline/utils/set_up_scripts.py b/denv_pipeline/utils/set_up_scripts.py index a05379b..b8a9887 100644 --- a/denv_pipeline/utils/set_up_scripts.py +++ b/denv_pipeline/utils/set_up_scripts.py @@ -23,6 +23,7 @@ def get_defaults(config): config["verbose"] = False config["slurm"] = False config["slurm_cores"] = 10 + config["cores"] = False config["download"] = False config["temp"] = False config["overwrite"] = False @@ -210,6 +211,7 @@ def get_valid_keys(): valid_keys.append("download") valid_keys.append("slurm") valid_keys.append("slurm_cores") + valid_keys.append("cores") valid_keys.append("verbose") valid_keys.append("config") valid_keys.append("dry_run")