Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions snakemake_wrapper_utils/samtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ def get_samtools_opts(
sys.exit(
"You have specified number of threads (`-@/--threads`) in `params.extra`; this is automatically infered from `threads`."
)
samtools_opts += (
""
if snakemake.threads <= 1
else " --threads {}".format(snakemake.threads - 1)

if snakemake.threads > 1:
samtools_opts += f" --threads {snakemake.threads - 1}"
)

######################
Expand All @@ -55,11 +54,11 @@ def get_samtools_opts(
if parse_regions:
if is_arg("--region-file", extra) or is_arg("--regions-file", extra):
sys.exit(
"You have specified regions file (`--regions-file`) in `params.extra`; this is automatically infered from `regions` input file."
"You have specified regions file (`--region[s]-file`) in `params.extra`; this is automatically infered from `regions` input file."
)

if snakemake.input.get("regions"):
samtools_opts += f" --regions-file {snakemake.input.regions}"
samtools_opts += f" --region-file {snakemake.input.regions}"

###################
### Write index ###
Expand Down