Skip to content

Commit 68b975f

Browse files
authored
chore: clean up (#1632)
#### Changed * changed slurm extra qos with slurm_qos argument #1632 * moved default resource allocation to snakemake command #1632 * increased memory of samtools fixmate #1632 * no rerun for rule all #1632 * increased head-job runtime to 7 days #1632 * add attempt mem bump to vep_somatic_research_sv #1632 #### Removed * exome argument panel bed callback function #1632 * removed -l flag in head-job sbatch script #1632
1 parent 7df2302 commit 68b975f

File tree

15 files changed

+30
-48
lines changed

15 files changed

+30
-48
lines changed

BALSAMIC/commands/config/case.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ def case_config(
151151

152152
LOG.info(f"Starting configuring analysis case: {case_id}.")
153153

154+
if exome and not panel_bed:
155+
raise click.BadParameter(
156+
"If --exome is provided, --panel-bed must also be provided.",
157+
param_hint=["--panel-bed"],
158+
)
159+
154160
LOG.info(f"Creating case analysis directory: {analysis_dir}/{case_id}.")
155161
Path(analysis_dir, case_id).mkdir(exist_ok=True)
156162

BALSAMIC/commands/options.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from BALSAMIC.constants.paths import WORKFLOW_PROFILE, CACHE_PROFILE
2424
from BALSAMIC.utils.cli import (
2525
validate_cache_version,
26-
validate_exome_option,
2726
validate_umi_min_reads,
2827
)
2928

@@ -222,7 +221,6 @@
222221
is_flag=True,
223222
default=False,
224223
help="Assign exome parameters to TGA workflow",
225-
callback=validate_exome_option,
226224
)
227225

228226
OPTION_FASTQ_PATH = click.option(

BALSAMIC/constants/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class LogFile:
1414
class SubmitSnakemake:
1515
"""Constants for sbatch script running snakemake on cluster"""
1616

17-
MAX_RUN_HOURS: int = 120
17+
MAX_RUN_HOURS: int = 168
1818

1919

2020
class SnakemakeDAG:

BALSAMIC/constants/workflow_profile/config.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ max-status-checks-per-second: 1
66
max-jobs-per-second: 1
77
restart-times: 2
88

9-
default-resources:
10-
runtime: 120
11-
mem_mb: 4000
12-
slurm_partition: "core"
13-
149
set-resources:
10+
all:
11+
runtime: 60
12+
mem_mb: 4000
1513
post_process_tnscope_info_fields_wgs:
1614
runtime: 60
1715
mem_mb: min(230000, 5000 * attempt)
@@ -471,7 +469,7 @@ set-resources:
471469
mem_mb: min(230000, 25000 * attempt)
472470
runtime: 1440
473471
samtools_fixmate:
474-
mem_mb: min(230000, 50000 * attempt)
472+
mem_mb: min(230000, 80000 * attempt)
475473
runtime: 560
476474
bam_compress_tumor:
477475
mem_mb: min(230000, 8000 * attempt)

BALSAMIC/models/sbatchsubmitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _build_sbatch_header(self) -> str:
6565
- optional partition if `self.headjob_partition` is set
6666
"""
6767
lines = [
68-
"#!/bin/bash -l",
68+
"#!/bin/bash",
6969
f"#SBATCH --account={self.account}",
7070
f"#SBATCH --job-name=BALSAMIC_snakemake_submit.{self.case_id}.%j",
7171
f"#SBATCH --output={self.log_path}/BALSAMIC_snakemake_submit.{self.case_id}.%j.out",

BALSAMIC/models/snakemake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_command(self) -> str:
137137

138138
def get_slurm_job_arguments(self) -> str:
139139
return (
140-
f'--default-resources slurm_extra="--qos={self.qos}" '
140+
f'--default-resources slurm_extra="--qos={self.qos}" runtime=120 mem_mb=4000 '
141141
f"slurm_partition={self.workflow_partition} slurm_account={self.account}"
142142
)
143143

BALSAMIC/snakemake_rules/annotation/somatic_sv_annotation.rule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rule vep_somatic_research_sv:
1212
benchmark:
1313
Path(benchmark_dir, "vep_somatic_research_sv." + config["analysis"]["case_id"] + ".svdb.tsv").as_posix()
1414
resources:
15-
mem_mb = lambda wc: (140000 if config_model.analysis.sequencing_type == SequencingType.WGS else 35000)
15+
mem_mb = lambda wc, attempt: min(230000, (140000 if config_model.analysis.sequencing_type == SequencingType.WGS else 35000) * attempt)
1616
singularity:
1717
Path(singularity_image, config["bioinfo_tools"].get("ensembl-vep") + ".sif").as_posix()
1818
params:

BALSAMIC/snakemake_rules/variant_calling/germline_wgs.rule

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ rule sentieon_DNAscope_wgs:
1010
recal_table = bam_dir + "{sample_type}.recal_data.table"
1111
output:
1212
vcf = vcf_dir + "SNV.germline.{sample_type}.dnascope.vcf.gz",
13-
resources:
14-
mem_mb = lambda wc, input: min(max(1.1 * input.size_mb, 10000), 250000) # Cap at 250GB. Scale memory with input size (min 10GB)
1513
params:
1614
tmpdir = tempfile.mkdtemp(prefix=tmp_dir),
1715
pcr_model = params.common.pcr_model,

BALSAMIC/utils/cli.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -572,15 +572,6 @@ def get_analysis_fastq_files_directory(case_dir: str, fastq_path: str) -> str:
572572
return Path(fastq_path).as_posix()
573573

574574

575-
def validate_exome_option(ctx: click.Context, _param: click.Parameter, exome: bool):
576-
"""Validate that a panel-bed has been supplied together with the exome option."""
577-
if exome and not ctx.params.get("panel_bed"):
578-
raise click.BadParameter(
579-
"If --exome is provided, --panel-bed must also be provided."
580-
)
581-
return exome
582-
583-
584575
def validate_cache_version(
585576
_ctx: click.Context, _param: click.Parameter, version: str
586577
) -> str:

BALSAMIC/workflows/balsamic.smk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ rule all:
635635
tmp_dir=tmp_dir,
636636
case_name=config["analysis"]["case_id"],
637637
status_file=Path(get_result_dir(config), "analysis_status.txt").as_posix(),
638+
retries: 0
638639
message:
639640
"Finalizing analysis for {params.case_name}"
640641
run:

0 commit comments

Comments
 (0)