From d1e5f11051b0bb34dbe616fe88e3d155d5bacaca Mon Sep 17 00:00:00 2001 From: Stephen Watts Date: Tue, 10 Sep 2024 11:44:54 +1000 Subject: [PATCH] Allow panels to use tumor RNA input, minor fixes --- lib/Utils.groovy | 11 ++--------- lib/WorkflowMain.groovy | 11 ++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/Utils.groovy b/lib/Utils.groovy index 0cbfab1b..784e1612 100644 --- a/lib/Utils.groovy +++ b/lib/Utils.groovy @@ -278,25 +278,18 @@ class Utils { } // Do not allow only tumor RNA - if (Utils.hasTumorRnaBam(meta) && !Utils.hasTumorDna(meta)) { + if (Utils.hasTumorRna(meta) && !Utils.hasTumorDna(meta)) { log.error "targeted mode is not compatible with only tumor RNA provided for ${meta.group_id}\n\n" + "The targeted workflow requires tumor DNA and can optionally take tumor RNA, depending on " + "the configured panel." Nextflow.exit(1) } - // Restrict tumor RNA inputs to the TSO500 panel - if (Utils.hasTumorRnaBam(meta) && run_config.panel != 'tso500') { - def panel = run_config.panel.toUpperCase() - log.error "only the TSO500 panel supports tumor RNA analysis but got: ${panel}" - Nextflow.exit(1) - } - } // Do not allow normal DNA only if (Utils.hasNormalDna(meta) && !Utils.hasTumorDna(meta)) { - log.error "germline only mode not supported, found only a normal DNA BAM for ${meta.group_id}" + log.error "found only normal DNA input for ${meta.group_id} but germline only analysis is not supported" Nextflow.exit(1) } diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index f8cd75b0..5f144e67 100755 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -191,14 +191,19 @@ class WorkflowMain { } else if (!Constants.PANELS_DEFINED.contains(params.panel)) { - if (!params.containsKey('force_panel') && !params.force_panel) { + if (params.containsKey('force_panel') && params.force_panel) { + log.warn "provided panel ${params.panel} does not have built-in support but forcing to proceed" + } else { def panels = Constants.PANELS_DEFINED.join('\n - ') log.error "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " The ${params.panel} is not defined. Currently, the available panels are:\n" + - " - ${panels}\n" + + " The ${params.panel} panel does not have built-in support. Currently, the\n" + + " available supported panels are:\n" + + " - ${panels}\n\n" + + " Please adjust the --panel argument or override with --force_panel.\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" Nextflow.exit(1) } + } }