-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.nf
102 lines (80 loc) · 2.98 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env nextflow
// enable dsl2
nextflow.enable.dsl = 2
script_files = "$baseDir/bin"
// include workflows
include { COVIDMVP } from './workflows/covidmvp'
//include { POXMVP } from './workflows/poxmvp'
include { WASTEWATER } from './workflows/virusmvp_wastewater'
//include { FLUMVP } from './workflows/flumvp'
// include subworkflows
include { CONFIGURE_VIRUSMVP } from './subworkflows/local/virusmvp_config'
// include modules
include {printHelp } from './modules/local/help'
include {cidgohHeader } from './modules/local/header'
include {workflowHeader } from './modules/local/wf_header'
if (params.help){
log.info cidgohHeader()
log.info workflowHeader()
printHelp()
exit 0
}
if (params.profile){
println("Profile should have a single dash: -profile")
System.exit(1)
}
if ( !params.prefix ) {
println("Please supply a prefix for your output files with --prefix")
println("Use --help to print help")
System.exit(1)
} else {
if ( params.prefix =~ /\// ){
println("The --prefix that you supplied contains a \"/\", please replace it with another character")
System.exit(1)
}
}
// main workflow
workflow {
main:
log.info cidgohHeader()
log.info workflowHeader()
if (!params.skip_permissions) {
allFiles = listOfFiles = file("$script_files/*")
for( def file : allFiles ) {
file.setPermissions('rwxr-x--x')
}
}
// Building configuration file for COVID-MVP
if(!params.skip_configuration){
gff_file = file(params.viral_gff, checkIfExists: true)
gff = [ [ id:params.virus_accession_id ], gff_file ]
CONFIGURE_VIRUSMVP(gff)
ch_json=CONFIGURE_VIRUSMVP.out.ch_json
ch_snpeff_db=CONFIGURE_VIRUSMVP.out.ch_snpeff_db
ch_snpeff_config=CONFIGURE_VIRUSMVP.out.ch_snpeff_config
ch_viral_fai=CONFIGURE_VIRUSMVP.out.ch_viral_fai
}
else{
ch_json = file(params.ch_json)
ch_snpeff_db = file(params.ch_snpeff_db)
ch_snpeff_config = file(params.ch_snpeff_config)
ch_viral_fai = file(params.ch_viral_fai)
}
if (params.virus_accession_id = "NC_045512.2"){
println("Executing COVID-MVP")
if (params.wastewater){
WASTEWATER(ch_json, ch_snpeff_db, ch_snpeff_config, ch_viral_fai)
}
else{
COVIDMVP(ch_json, ch_snpeff_db, ch_snpeff_config, ch_viral_fai)
}
}
else if (params.virus_accession_id = "NC_063383.1"){
println("Executing POX-MVP")
//POXMVP(ch_json, ch_snpeff_db, ch_snpeff_config, ch_viral_fai)
}
else {
println("Executing FLU-MVP")
//FLUMVP()
}
}