diff --git a/aviary/modules/annotation/annotation.smk b/aviary/modules/annotation/annotation.smk index 7df5d61a..31e1d40a 100644 --- a/aviary/modules/annotation/annotation.smk +++ b/aviary/modules/annotation/annotation.smk @@ -188,7 +188,7 @@ rule gtdbtk: done = "data/gtdbtk/done" params: gtdbtk_folder = config['gtdbtk_folder'], - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), extension = config['mag_extension'] conda: "../../envs/gtdbtk.yaml" diff --git a/aviary/modules/binning/binning.smk b/aviary/modules/binning/binning.smk index aeb15df7..c6d3c4dd 100644 --- a/aviary/modules/binning/binning.smk +++ b/aviary/modules/binning/binning.smk @@ -397,7 +397,7 @@ rule checkm_rosella: input: done = ancient("data/rosella_bins/done") params: - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), checkm2_db_path = config["checkm2_db_folder"], bin_folder = "data/rosella_bins/", extension = "fna", @@ -422,7 +422,7 @@ rule checkm_metabat2: input: done = ancient("data/metabat_bins_2/done") params: - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), checkm2_db_path = config["checkm2_db_folder"], bin_folder = "data/metabat_bins_2/", extension = "fa", @@ -447,7 +447,7 @@ rule checkm_semibin: input: done = ancient("data/semibin_bins/done") params: - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), checkm2_db_path = config["checkm2_db_folder"], bin_folder = "data/semibin_bins/output_recluster_bins/", extension = "fa", @@ -485,7 +485,7 @@ rule refine_rosella: output_folder = "data/rosella_refined/", min_bin_size = config["min_bin_size"], max_iterations = config["refinery_max_iterations"], - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), max_contamination = 15, final_refining = False threads: @@ -522,7 +522,7 @@ rule refine_metabat2: output_folder = "data/metabat2_refined/", min_bin_size = config["min_bin_size"], max_iterations = config["refinery_max_iterations"], - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), max_contamination = 15, final_refining = False log: @@ -554,7 +554,7 @@ rule refine_semibin: output_folder = "data/semibin_refined/", min_bin_size = config["min_bin_size"], max_iterations = config["refinery_max_iterations"], - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), max_contamination = 15, final_refining = False log: @@ -673,7 +673,7 @@ rule refine_dastool: output_folder = "data/refined_bins/", min_bin_size = config["min_bin_size"], max_iterations = config["refinery_max_iterations"], - pplacer_threads = config["pplacer_threads"], + pplacer_threads = lambda wildcards, threads: min(threads, config["pplacer_threads"]), max_contamination = 15, final_refining = True log: