-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.nf
56 lines (41 loc) · 1.21 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
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
// include modules
include {printHelp} from './modules/help.nf'
// import subworkflows
include {mpxvIllumina} from './workflows/illuminaMpxv.nf'
if (params.help){
printHelp()
exit 0
}
if (params.profile){
println("Profile should have a single dash: -profile")
System.exit(1)
}
if ( !params.directory ) {
println("Please supply a directory containing fastqs or CRAMs with --directory.")
println("Use --help to print help")
System.exit(1)
}
if ( (params.bed && ! params.ref) || (!params.bed && params.ref) ) {
println("--bed and --ref must be supplied together")
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 {
Channel.fromFilePairs( params.fastqSearchPath, flat: true)
.filter{ !( it[0] =~ /Undetermined/ ) }
.set{ ch_filePairs }
main:
mpxvIllumina(ch_filePairs)
}