-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.nf
124 lines (109 loc) · 4.13 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nf-core/gwascatalogharm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github :
Website:
Slack :
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl = 2
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATE & PRINT PARAMETER SUMMARY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOW FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { PREPARE_REFERENCE } from './workflows/PREPARE_REFERENCE'
include { GWASCATALOGHARM_GWASCATALOG } from './workflows/gwascatalogharm_gwascatalog'
include { GWASCATALOGHARM } from './workflows/gwascatalogharm'
//
// WORKFLOW: Run main nf-core/gwascatalogharm analysis pipeline
//
workflow NFCORE_GWASCATALOGHARM {
// Check mandatory parameters
params.reference = null
params.gwascatalog = null
params.harm = null
if (!params.chrom) {
println "ERROR: You didn't set chromsomes to be harmnnised"
println "Please set --chrom 22 or --chromlist 22,X,Y or set chrom in ./config/default_params.config "
System.exit(1)
}
if (!params.reference) {
if (!params.to_build) {
println "ERROR: You didn't set the target build to harmonise to"
println "Please set --to_build 38"
System.exit(1)
}
if (!params.threshold) {
println "ERROR: You didn't set threshold to imput the direction of palindromic variants"
println "Please set --threshold 0.99 or set threshold in ./config/default_params.config "
System.exit(1)
}
if (!params.version) {
println " ERROR: Please specific the pipeline version you are running (e.g. v1.1.9) \
Please set --version and try again (: "
System.exit(1)
}
}
// check conditinal input parameters
if (params.reference) {
println ("Prepare the reference ...")
PREPARE_REFERENCE()
}
else if (params.gwascatalog) {
if (!params.all_harm_folder) {
println " ERROR: You didn't set any folder to be harmonised \
Please set --all_harm_folder and try again (: "
System.exit(1)
}
else if (!params.ftp) {
println " ERROR: You didn't set any folder to store your final result \
Please set --ftp and try again (: "
System.exit(1)
}
else {
println ("Harmonizing files in the folder ${params.all_harm_folder}")
GWASCATALOGHARM_GWASCATALOG()
}
}
else if (params.harm) {
if (!params.file && !params.list) {
println " ERROR: You didn't set any files to be harmonised \
Please set --file for a single input file or \
set --list for a list containing all files are waiting to be harmonised \
and try again (: "
System.exit(1)
}
else {
println ("Start harmonising files")
GWASCATALOGHARM()
}
}
else {
println " ERROR: You didn't set any model to run the pipeline \
Please set --harm and try again (: "
System.exit(1)
}
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN ALL WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// WORKFLOW: Execute a single named workflow for the pipeline
// See: https://github.com/nf-core/rnaseq/issues/619
workflow {
NFCORE_GWASCATALOGHARM ()
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/