Skip to content

Commit

Permalink
Replace single string/option with comma separated list to support mul…
Browse files Browse the repository at this point in the history
…tiple pipelines samplesheet generation
  • Loading branch information
jfy133 committed Oct 14, 2024
1 parent e4184bc commit c98514a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"generate_pipeline_samplesheets": {
"type": "string",
"default": "taxprofiler",
"description": "Specify which pipeline to generate a samplesheet for.",
"description": "Specify a comma separated string in quotes to specify which pipeline to generate a samplesheet for. Currently supported pipeline(s): taxprofiler",
"fa_icon": "fas fa-toolbox"
},
"generate_samplesheet_dbtype": {
Expand Down
6 changes: 6 additions & 0 deletions subworkflows/local/utils_nfcore_createtaxdb_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,16 @@ def validateInputParameters() {
error('[nf-core/createtaxdb] Supplied --build_diamond, but missing at least one of: --prot2taxid, --nodesdmp, or --namesdmp (all are mandatory for DIAMOND).')
}

// Validate samplesheet generation parameters
if (params.generate_downstream_samplesheets && !params.generate_pipeline_samplesheets) {
error('[nf-core/createtaxdb] If supplying `--generate_downsteam_samplesheets`, you must also specify which pipeline to generate for with `--generate_pipeline_samplesheets! Check input.')
}

def supported_samplesheets = ['taxprofiler']
if (params.generate_downstream_samplesheets && !params.generate_pipeline_samplesheets.split(",").every { it in supported_samplesheets }) {
error("[nf-core/createtaxdb] Unrecognised or unsupported pipeline selection for samplesheet generation. Options: ${supported_samplesheets.join(", ")}. Specified: --generate_pipeline_samplesheets ${params.generate_pipeline_samplesheets}")
}

if (params.generate_downstream_samplesheets && !params.generate_tar_archive && params.generate_samplesheet_dbtype == 'tar') {
error('[nf-core/createtaxdb] Supplied --generate_downstream_samplesheets with --generate_samplesheet_dbtype tar, but missing --generate_tar_archive (mandatory for tar archive output).')
}
Expand Down

0 comments on commit c98514a

Please sign in to comment.