From b3837cce5b4397ae0e0f17a296ff1d31d29285bd Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Wed, 8 Feb 2023 15:44:37 +0100 Subject: [PATCH] Relax strictness so can supply empty db_params but block if only single parameter with out ; --- docs/usage.md | 2 +- subworkflows/local/db_check.nf | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 21c983d..53dc8c3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -103,7 +103,7 @@ metaphlan3,db1,,///metaphlan3/metaphlan_database/ motus,db_mOTU,,///motus/motus_database/ ``` -Bracken **must** have a _semi-colon_ `;` list as in `db_params`, regardless of whether you have parameters or not. This is to allow to specify the Kraken2 parameters before, and Bracken parameters after the `;` as Bracken is a two step process. This is particularly important if you supply a Bracken database with a non-default read length parameter. +For Bracken, if you wish to supply amy parameters to either the Kraken or Bracken step you **must** have a _semi-colon_ `;` list as in `db_params`. This is to allow to specify the Kraken2 parameters before, and Bracken parameters after the `;` as Bracken is a two step process. This is particularly important if you supply a Bracken database with a non-default read length parameter. If you do not have any parameters to specify, you can leave this as empty. Column specifications are as follows: diff --git a/subworkflows/local/db_check.nf b/subworkflows/local/db_check.nf index 20402f6..35240ed 100644 --- a/subworkflows/local/db_check.nf +++ b/subworkflows/local/db_check.nf @@ -71,7 +71,8 @@ def validate_db_rows(LinkedHashMap row){ if ( row.db_params.contains('"') ) exit 1, "[nf-core/taxprofiler] ERROR: Invalid database db_params entry. No quotes allowed. Error in: ${row}" if ( row.db_params.contains("'") ) exit 1, "[nf-core/taxprofiler] ERROR: Invalid database db_params entry. No quotes allowed. Error in: ${row}" - if ( row.tool == 'bracken' && !row.db_params.contains(";") ) exit 1, "[nf-core/taxprofiler] ERROR: Invalid database db_params entry. Bracken requires a semi-colon. Error in: ${row}" + // check if any form of bracken params, that it must have `;` + if ( row.tool == 'bracken' && row.db_params && !row.db_params.contains(";") ) exit 1, "[nf-core/taxprofiler] ERROR: Invalid database db_params entry. Bracken requires a semi-colon if passing parameter. Error in: ${row}" }