Skip to content

Commit 475e16c

Browse files
committed
Remove vendored nf-core utils subworkflows, use plugin imports
Replace three subworkflows/nf-core/utils_* subworkflows with direct imports from plugin/nf-core-utils and plugin/nf-schema, matching the pattern used by rnavar and createpanelrefs pipelines. - utils_nextflow_pipeline: version display, params dump, conda check - utils_nfcore_pipeline: config validation, email, versions YAML - utils_nfschema_plugin: parameter validation, help display All functionality preserved in the local utils subworkflow using plugin functions directly.
1 parent 3f44636 commit 475e16c

9 files changed

Lines changed: 47 additions & 738 deletions

File tree

modules.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,7 @@
141141
}
142142
}
143143
},
144-
"subworkflows": {
145-
"nf-core": {
146-
"utils_nextflow_pipeline": {
147-
"branch": "master",
148-
"git_sha": "1a545fcbd762911c21a64ced3dbef99b2b51ac75",
149-
"installed_by": ["subworkflows"]
150-
},
151-
"utils_nfcore_pipeline": {
152-
"branch": "master",
153-
"git_sha": "a3fb7351b1fdb2b1de282b765816bbea190e86a8",
154-
"installed_by": ["subworkflows"]
155-
},
156-
"utils_nfschema_plugin": {
157-
"branch": "master",
158-
"git_sha": "a7b27fd25bfa8dcc07d299e88bd790585901a436",
159-
"installed_by": ["subworkflows"]
160-
}
161-
}
162-
}
144+
"subworkflows": {}
163145
}
164146
}
165147
}

subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
*/
1010

11-
include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin'
11+
include { checkCondaChannels } from 'plugin/nf-core-utils'
12+
include { checkConfigProvided } from 'plugin/nf-core-utils'
13+
include { checkProfileProvided } from 'plugin/nf-core-utils'
14+
include { completionEmail } from 'plugin/nf-core-utils'
15+
include { completionSummary } from 'plugin/nf-core-utils'
16+
include { dumpParametersToJSON } from 'plugin/nf-core-utils'
17+
include { getWorkflowVersion } from 'plugin/nf-core-utils'
18+
include { softwareVersionsToYAML } from 'plugin/nf-core-utils'
19+
include { paramsHelp } from 'plugin/nf-schema'
20+
include { paramsSummaryLog } from 'plugin/nf-schema'
1221
include { paramsSummaryMap } from 'plugin/nf-schema'
1322
include { samplesheetToList } from 'plugin/nf-schema'
14-
include { paramsHelp } from 'plugin/nf-schema'
15-
include { completionEmail } from '../../nf-core/utils_nfcore_pipeline'
16-
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
17-
include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline'
18-
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
23+
include { validateParameters } from 'plugin/nf-schema'
1924

2025
/*
2126
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -45,12 +50,15 @@ workflow PIPELINE_INITIALISATION {
4550
//
4651
// Print version and exit if required and dump pipeline parameters to JSON file
4752
//
48-
UTILS_NEXTFLOW_PIPELINE(
49-
version,
50-
true,
51-
outdir,
52-
workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1,
53-
)
53+
if (version) {
54+
log.info("${workflow.manifest.name} ${getWorkflowVersion()}")
55+
System.exit(0)
56+
}
57+
def timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')
58+
dumpParametersToJSON(params, "${outdir}/pipeline_info/params_${timestamp}.json")
59+
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
60+
checkCondaChannels()
61+
}
5462

5563
//
5664
// Validate parameters and generate parameter summary to stdout
@@ -80,20 +88,29 @@ workflow PIPELINE_INITIALISATION {
8088
before_text = before_text.replaceAll(/\033\[[0-9;]*m/, '')
8189
}
8290

83-
command = "nextflow run ${workflow.manifest.name} -profile <docker/singularity/.../institute> --input samplesheet.csv --outdir <OUTDIR>"
84-
85-
UTILS_NFSCHEMA_PLUGIN(
86-
workflow,
87-
validate_params,
88-
null,
89-
help,
90-
help_full,
91-
show_hidden,
92-
before_text,
93-
after_text,
94-
command,
95-
null,
96-
)
91+
def command = "nextflow run ${workflow.manifest.name} -profile <docker/singularity/.../institute> --input samplesheet.csv --outdir <OUTDIR>"
92+
93+
if (help || help_full) {
94+
log.info paramsHelp(
95+
[
96+
beforeText: before_text,
97+
afterText: after_text,
98+
command: command,
99+
showHidden: show_hidden,
100+
fullHelp: help_full,
101+
],
102+
(help instanceof String && help != "true") ? help : "",
103+
)
104+
System.exit(0)
105+
}
106+
107+
log.info before_text
108+
log.info paramsSummaryLog(workflow, parameters_schema: "nextflow_schema.json")
109+
log.info after_text
110+
111+
if (validate_params) {
112+
validateParameters(parameters_schema: "nextflow_schema.json")
113+
}
97114

98115
extra_text = """
99116
\033[1;37mExtra informations\033[0m
@@ -110,7 +127,8 @@ workflow PIPELINE_INITIALISATION {
110127
//
111128
// Check config provided to the pipeline
112129
//
113-
UTILS_NFCORE_PIPELINE(nextflow_cli_args)
130+
checkConfigProvided()
131+
checkProfileProvided(nextflow_cli_args)
114132

115133
//
116134
// Custom validation for pipeline parameters

subworkflows/nf-core/utils_nextflow_pipeline/main.nf

Lines changed: 0 additions & 138 deletions
This file was deleted.

subworkflows/nf-core/utils_nextflow_pipeline/meta.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)