Skip to content

Commit

Permalink
Allow panels to use tumor RNA input, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scwatts committed Sep 10, 2024
1 parent f81869e commit d1e5f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 2 additions & 9 deletions lib/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
11 changes: 8 additions & 3 deletions lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
}

Expand Down

0 comments on commit d1e5f11

Please sign in to comment.