From eb116a53757306182d8a40f3134a1ca7e7af1309 Mon Sep 17 00:00:00 2001 From: jaamarks Date: Thu, 3 Oct 2024 10:30:00 -0400 Subject: [PATCH] Apply ``max_time_hr`` to sample_level_ibd rule The ``sample_level_ibd`` rule within the ``sample_qc.smk`` sub-workflow needs the ``max_time_hr`` feature applied to it too because it is quite time-intensive. We also updated the description in the ``workflow_params.py`` file to state all of the rules that this feature applies to. --- src/cgr_gwas_qc/models/config/workflow_params.py | 2 +- src/cgr_gwas_qc/workflow/sub_workflows/sample_qc.smk | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cgr_gwas_qc/models/config/workflow_params.py b/src/cgr_gwas_qc/models/config/workflow_params.py index 07c846c7..c0d5b372 100644 --- a/src/cgr_gwas_qc/models/config/workflow_params.py +++ b/src/cgr_gwas_qc/models/config/workflow_params.py @@ -92,7 +92,7 @@ class WorkflowParams(BaseModel): max_time_hr: Optional[int] = Field( None, - description="Allocates the specified number of hours for the execution of the ``sample_concordance_plink`` and ``population_level_ibd`` rules.", + description="Allocates the specified number of hours to the following rules: ``sample_concordance_plink``, ``sample_concordance_king``, ``sample_concordance_summary``, ``sample_level_ibd``, and ``population_level_ibd``.", ) time_start: str = Field( diff --git a/src/cgr_gwas_qc/workflow/sub_workflows/sample_qc.smk b/src/cgr_gwas_qc/workflow/sub_workflows/sample_qc.smk index ab3f9921..4e7ec28c 100644 --- a/src/cgr_gwas_qc/workflow/sub_workflows/sample_qc.smk +++ b/src/cgr_gwas_qc/workflow/sub_workflows/sample_qc.smk @@ -335,6 +335,9 @@ use rule genome from plink as sample_level_ibd with: out_prefix="sample_level/call_rate_2/samples_maf{maf}_ld{ld}", output: "sample_level/call_rate_2/samples_maf{maf}_ld{ld}.genome", + resources: + mem_mb=lambda wildcards, attempt, input: max((attempt + 1) * input.size_mb, 1024), + time_hr=lambda wildcards, attempt: BIG_TIME[attempt], rule sample_concordance_plink: