-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.nf
63 lines (54 loc) · 2.03 KB
/
main.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env nextflow
// Version of this release
pipelineVersion = '1.0.0-rc12'
// Import workflow modules
include { PIPELINE } from "$projectDir/workflows/pipeline"
include { INIT } from "$projectDir/workflows/init"
include { PRINT_VERSION; SAVE_INFO } from "$projectDir/workflows/info_and_version"
// Import supporting modules
include { startMessage; helpMessage; workflowSelectMessage; endMessage } from "$projectDir/modules/messages"
include { validate } from "$projectDir/modules/validate"
include { singularityPreflight } from "$projectDir/modules/singularity"
// Safeguard Nextflow minimum version, in case user is not using the included executable
nextflowMinVersion = '23.10'
if( !nextflow.version.matches(">=${nextflowMinVersion}") ) {
log.error("The pipeline requires Nextflow version ${nextflowMinVersion} or greater -- You are running version $nextflow.version")
System.exit(1)
}
// Start message
startMessage(pipelineVersion)
// Validate parameters
validate(params)
// If Singularity is used as the container engine and not showing help message, do preflight check to prevent parallel pull issues
// Related issue: https://github.com/nextflow-io/nextflow/issues/1210
if (workflow.containerEngine == 'singularity' & !params.help) {
singularityPreflight(workflow.container, params.singularity_cachedir)
}
// Select workflow with PIPELINE as default
workflow {
if (params.help) {
helpMessage()
} else if (params.init) {
workflowSelectMessage('init')
INIT()
} else if (params.version) {
workflowSelectMessage('version')
PRINT_VERSION(params.resistance_to_mic, pipelineVersion)
} else {
workflowSelectMessage('pipeline')
PIPELINE()
SAVE_INFO(PIPELINE.out.databases_info, params.resistance_to_mic, pipelineVersion)
}
}
// End message
workflow.onComplete {
if (params.help) {
return
} else if (params.init) {
endMessage('init')
} else if (params.version) {
endMessage('version')
} else {
endMessage('pipeline')
}
}