Skip to content

Commit

Permalink
add resource usage for new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Feb 7, 2025
1 parent 5e1c4b0 commit ed7833b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
15 changes: 14 additions & 1 deletion snappy_pipeline/workflows/somatic_variant_calling/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if wf.w_config.step_config["somatic_variant_calling"].mutect2.common_variants:


scattergather:
mutect2=8,
mutect2=wf.config.get("mutect2", {}).get("num_jobs", 24),


rule somatic_variant_calling_mutect2_scatter:
Expand All @@ -138,6 +138,12 @@ rule somatic_variant_calling_mutect2_scatter:
padding=5000,
ignore_chroms=wf.w_config.get("ignore_chroms", wf.config.get("ignore_chroms", [])),
fai=config["static_data_config"]["reference"]["path"] + ".fai",
resources:
time=wf.get_resource("mutect2", "scatter", "time"),
memory=wf.get_resource("mutect2", "scatter", "memory"),
partition=wf.get_resource("mutect2", "scatter", "partition"),
tmpdir=wf.get_resource("mutect2", "scatter", "tmpdir"),
threads: 1
log:
**wf.get_log_file("mutect2", "scatter"),
script:
Expand All @@ -154,6 +160,7 @@ rule somatic_variant_calling_mutect2_run:
memory=wf.get_resource("mutect2", "run", "memory"),
partition=wf.get_resource("mutect2", "run", "partition"),
tmpdir=wf.get_resource("mutect2", "run", "tmpdir"),
threads: wf.get_resource("mutect2", "run", "threads")
log:
**wf.get_log_file("mutect2", "run"),
params:
Expand All @@ -173,6 +180,12 @@ rule somatic_variant_calling_mutect2_gather:
unpack(wf.get_input_files("mutect2", "gather")),
output:
**wf.get_output_files("mutect2", "gather"),
resources:
time=wf.get_resource("mutect2", "gather", "time"),
memory=wf.get_resource("mutect2", "gather", "memory"),
partition=wf.get_resource("mutect2", "gather", "partition"),
tmpdir=wf.get_resource("mutect2", "gather", "tmpdir"),
threads: 1
conda:
"envs/mutect2.yaml"
log:
Expand Down
10 changes: 10 additions & 0 deletions snappy_pipeline/workflows/somatic_variant_calling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,21 @@ class Mutect2StepPart(MutectBaseStepPart):

#: Class resource usage dictionary. Key: action (string); Value: resource (ResourceUsage).
resource_usage_dict = {
"scatter": ResourceUsage(
threads=1,
time="00:02:00",
memory="1000M",
),
"run": ResourceUsage(
threads=2,
time="5-00:00:00",
memory="3584M",
),
"gather": ResourceUsage(
threads=1,
time="02:00:00",
memory="4096M",
),
"filter": ResourceUsage(
threads=2,
time="03:59:00",
Expand Down

0 comments on commit ed7833b

Please sign in to comment.