Skip to content

Commit

Permalink
Add autodetect multithreading
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Nov 19, 2024
1 parent 68d122c commit ae9354b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ingest/profiles/default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cores: all
printshellcmds: true
rerun-incomplete: true
2 changes: 2 additions & 0 deletions ingest/rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ rule nextclade_classify:
dataset=config["nextclade"]["nextclade_dataset_path"],
output:
nextclade_tsv="data/nextclade_results/nextclade.tsv",
threads: workflow.cores,
shell:
"""
nextclade3 run \
--input-dataset {input.dataset} \
--output-tsv {output.nextclade_tsv} \
--jobs {threads:q} \
--silent \
{input.sequences}
"""
Expand Down
3 changes: 3 additions & 0 deletions phylogenetic/profiles/default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cores: all
printshellcmds: true
rerun-incomplete: true
5 changes: 2 additions & 3 deletions phylogenetic/rules/construct_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ rule tree:
"logs/tree.txt",
benchmark:
"benchmarks/tree.txt"
params:
threads = workflow.cores,
threads: workflow.cores
shell:
"""
augur tree \
--alignment {input.alignment} \
--output {output.tree} \
--method raxml \
--nthreads {threads} 2>&1 | tee {log}
--nthreads {threads:q} 2>&1 | tee {log}
"""

rule refine:
Expand Down
5 changes: 2 additions & 3 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ rule align:
"logs/align.txt",
benchmark:
"benchmarks/align.txt"
params:
threads = workflow.cores
threads: workflow.cores
shell:
"""
augur align \
--sequences {input.sequences} \
--output {output.alignment} \
--fill-gaps \
--reference-sequence {input.reference} \
--nthreads {threads} 2>&1 | tee {log}
--nthreads {threads:q} 2>&1 | tee {log}
"""

0 comments on commit ae9354b

Please sign in to comment.