-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
85 lines (64 loc) · 1.96 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
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
/*
* Nextflow -- Annotation Benchmark Pipeline
* Author: CaSe-group
*/
/**************************
* HELP messages & checks
**************************/
//header()
/*
Nextflow version check
Format is this: XX.YY.ZZ (e.g. 20.07.1)
change below
*/
XX = "21"
YY = "04"
ZZ = "0"
if ( nextflow.version.toString().tokenize('.')[0].toInteger() < XX.toInteger() ) {
println "\033[0;33mgenome_to_json requires at least Nextflow version " + XX + "." + YY + "." + ZZ + " -- You are using version $nextflow.version\u001B[0m"
exit 1
}
else if ( nextflow.version.toString().tokenize('.')[1].toInteger() == XX.toInteger() && nextflow.version.toString().tokenize('.')[1].toInteger() < YY.toInteger() ) {
println "\033[0;33mgenome_to_json requires at least Nextflow version " + XX + "." + YY + "." + ZZ + " -- You are using version $nextflow.version\u001B[0m"
exit 1
}
// Log infos based on user inputs
if ( params.help ) { exit 0, helpMSG() }
// profile helps
if (params.profile) { exit 1, "--profile is WRONG use -profile" }
/**************************
* INPUT
**************************/
// csv input
if (params.csv) {
csv_ch = Channel
.fromPath(params.csv, checkIfExists:true)
.splitCsv(header: true)
.map {csv_data -> tuple( csv_data.Accession, csv_data.Species, csv_data.Path, csv_data.Contig, csv_data.Noise)
}
}else{
exit 1, "'--csv' parameter not found"
}
/**************************
* Log-infos
**************************/
//defaultMSG()
/**************************
* Workflows
**************************/
include {fasta_mod_wf} from './workflows/fasta_mod_wf.nf'
include {annotation_wf} from './workflows/annotation_wf.nf'
include {analysis_wf} from './workflows/analysis_wf.nf'
/**************************
* MAIN WORKFLOW
**************************/
workflow {
combined_fasta_ch=fasta_mod_wf(csv_ch)
annotation_wf(combined_fasta_ch)
analysis_wf(annotation_wf.out.combined)
}
/*************
* --help
*************/