Skip to content

Commit

Permalink
Add more prominent warnings about using custom config to provide para…
Browse files Browse the repository at this point in the history
…meters
  • Loading branch information
drpatelh committed Mar 22, 2023
1 parent 5b85276 commit a584b82
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ A number of improvements were made to the pipeline recently, mainly with regard
4. Start running your own analysis!

> - Parameters passed via custom config files including the `-c` Nextflow option will be ignored. Please provide pipeline parameters via the `-params-file` Nextflow option instead; see [docs](https://nf-co.re/usage/configuration?q=params#custom-configuration-files).
- Typical command for Illumina shotgun analysis:

```bash
Expand Down
4 changes: 4 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

> _Documentation of pipeline parameters is generated automatically from the pipeline schema and can no longer be found in markdown files._
## Pipeline parameters

Parameters passed via custom config files including the `-c` Nextflow option will be ignored. Please provide pipeline parameters via the `-params-file` Nextflow option instead; see [docs](https://nf-co.re/usage/configuration?q=params#custom-configuration-files).

## Samplesheet format

### Illumina
Expand Down
12 changes: 12 additions & 0 deletions lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ class NfcoreTemplate {
}
}

//
// Warn if using custom configs to provide pipeline parameters
//
public static void warnParamsProvidedInConfig(workflow, log) {
if (workflow.configFiles.size() > 1) {
log.warn "[$workflow.manifest.name] Multiple config files detected!\n" +
"Parameters passed via custom config files including the '-c' Nextflow option will be ignored.\n" +
"Please provide pipeline parameters via the '-params-file' Nextflow option instead.\n" +
"Docs: https://nf-co.re/usage/configuration?q=params#custom-configuration-files\n"
}
}

//
// Generate version string
//
Expand Down
3 changes: 3 additions & 0 deletions lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class WorkflowMain {
// Print parameter summary log to screen
log.info paramsSummaryLog(workflow, params, log)

// Warn about using custom configs to provide pipeline parameters
NfcoreTemplate.warnParamsProvidedInConfig(workflow, log)

// Validate workflow parameters via the JSON schema
if (params.validate_params) {
NfcoreSchema.validateParameters(workflow, params, log)
Expand Down

0 comments on commit a584b82

Please sign in to comment.