-
Notifications
You must be signed in to change notification settings - Fork 18
/
main.nf
62 lines (49 loc) · 1.89 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
#! /usr/bin/env nextflow
nextflow.enable.dsl = 2
include { ABINITIO_TRAINING } from "$projectDir/subworkflows/abinitio_training/main"
include { ANNOTATION_PREPROCESSING } from "$projectDir/subworkflows/annotation_preprocessing/main"
include { FUNCTIONAL_ANNOTATION } from "$projectDir/subworkflows/functional_annotation/main"
include { TRANSCRIPT_ASSEMBLY } from "$projectDir/subworkflows/transcript_assembly/main"
workflow {
log.info '''
_ _ ___ ___ ___
| \\| | _ )_ _/ __|
| .` | _ \\| |\\__ \\
|_|\\_|___/___|___/ Annotation Service
'''
def valid_subworkflows = [ 'abinitio_training', 'annotation_preprocessing', 'functional_annotation', 'transcript_assembly' ]
if( ! params.subworkflow in valid_subworkflows ){
error """
The parameter 'subworkflow' (value: ${params.subworkflow}) is not a valid subworkflow.
Please select a valid subworkflow ([ ${valid_subworkflows.join(', ')} ]).
"""
}
if ( params.subworkflow == 'abinitio_training' ){
ABINITIO_TRAINING()
}
if ( params.subworkflow == 'annotation_preprocessing' ){
ANNOTATION_PREPROCESSING()
}
if ( params.subworkflow == 'functional_annotation' ){
FUNCTIONAL_ANNOTATION()
}
if ( params.subworkflow == 'transcript_assembly' ){
TRANSCRIPT_ASSEMBLY()
}
}
workflow.onComplete {
if( workflow.success ){
log.info("""
Workflow completed successfully.
Thank you for using our workflow.
Results are located in the folder: $params.outdir
""")
} else {
log.info("""
The workflow completed unsuccessfully.
Please read over the error message. If you are unable to solve it, please
post an issue at https://github.com/NBISweden/pipelines-nextflow/issues
where we will do our best to help.
""")
}
}