Skip to content

Commit

Permalink
Add an early check that two paths are provided when providing a comma…
Browse files Browse the repository at this point in the history
…-separated list.
  • Loading branch information
Matthew Marshall committed Nov 29, 2023
1 parent 56f241b commit 7907df5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ if (params.dada_ref_tax_custom) {

if (params.qiime_ref_tax_custom) {
if ("${params.qiime_ref_tax_custom}".contains(",")) {
ch_qiime_ref_taxonomy = Channel.fromPath(Arrays.asList("${params.qiime_ref_tax_custom}".split(",")), checkIfExists: true)
qiime_ref_paths = "${params.qiime_ref_tax_custom}".split(",")
if (qiime_ref_paths.length != 2) {
error "--qiime_ref_tax_custom accepts a single filepath to a directory or tarball, or two files paths separated by a comma. Please review input."
}

ch_qiime_ref_taxonomy = Channel.fromPath(Arrays.asList(qiime_ref_paths), checkIfExists: true)
} else {
ch_qiime_ref_taxonomy = Channel.fromPath("${params.qiime_ref_tax_custom}", checkIfExists: true)
}
Expand Down

0 comments on commit 7907df5

Please sign in to comment.