-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.nf
187 lines (164 loc) · 6.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
genie-bpc-pipeline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github : https://github.com/Sage-Bionetworks/genie-bpc-pipeline
*/
nextflow.enable.dsl = 2
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET DEFAULT PARAMETERS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
params.cohort = 'NSCLC'
/*
Note: For multi-word strings like in the param comment here, everywhere that calls $comment as an argument
needed to be enclosed with double quotes so that nextflow interprets it as an entire string and
not separate command line arguments
*/
params.comment = 'NSCLC public release update'
params.production = false
params.schema_ignore_params = ""
params.help = false
params.step = "update_potential_phi_fields_table"
params.use_grs = false
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATE & PRINT PARAMETER SUMMARY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// Print help to screen if parameter set
if (params.help){
command = "nextflow run main.nf"
log.info NfcoreSchema.paramsHelp(workflow, params, command)
System.exit(0)
}
// Validate input parameters
NfcoreSchema.validateParameters(workflow, params, log)
// Check mandatory parameters
if (params.cohort == null) { exit 1, 'cohort parameter not specified!' }
if (params.comment == null) { exit 1, 'comment parameter not specified!' }
if (params.production == null) { exit 1, 'production parameter not specified!' }
if (params.step == null) { exit 1, 'step parameter not specified!' }
if (params.use_grs == null) { exit 1, 'use_grs parameter not specified!' }
// Print parameter summary log to screen
log.info NfcoreSchema.paramsSummaryLog(workflow, params)
log.info "Running step: ${params.step}"
// Print message for production mode vs test mode
if (params.production) {
log.warn "----------------------------------------------------"
log.warn "RUNNING IN PRODUCTION MODE"
log.warn "----------------------------------------------------"
}
else {
log.warn "----------------------------------------------------"
log.warn "RUNNING IN TEST MODE"
log.warn "----------------------------------------------------"
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT LOCAL MODULES/SUBWORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { update_potential_phi_fields_table } from './modules/update_potential_phi_fields_table'
include { run_quac_upload_report_error } from './modules/run_quac_upload_report_error'
include { run_quac_upload_report_warning } from './modules/run_quac_upload_report_warning'
include { merge_and_uncode_rca_uploads } from './modules/merge_and_uncode_rca_uploads'
// include { remove_patients_from_merged } from './modules/remove_patients_from_merged'
include { update_data_table } from './modules/update_data_table'
include { update_date_tracking_table } from './modules/update_date_tracking_table'
include { run_quac_table_report } from './modules/run_quac_table_report'
include { run_quac_comparison_report } from './modules/run_quac_comparison_report'
include { create_masking_report } from './modules/create_masking_report'
include { update_case_count_table } from './modules/update_case_count_table'
include { run_clinical_release } from './modules/run_clinical_release'
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
workflow BPC_PIPELINE {
ch_cohort = Channel.value(params.cohort)
ch_comment = Channel.value(params.comment)
if (params.step == "update_potential_phi_fields_table") {
update_potential_phi_fields_table(ch_comment, params.production)
// validate_data.out.view()
} else if (params.step == "merge_and_uncode_rca_uploads"){
merge_and_uncode_rca_uploads(
"default",
ch_cohort,
ch_comment,
params.production,
params.use_grs
)
} else if (params.step == "update_data_table") {
update_data_table(
"default",
ch_cohort,
ch_comment,
params.production
)
} else if (params.step == "genie_bpc_pipeline"){
update_potential_phi_fields_table(ch_comment, params.production)
run_quac_upload_report_error(
update_potential_phi_fields_table.out,
ch_cohort
)
run_quac_upload_report_warning(
run_quac_upload_report_error.out,
ch_cohort,
params.production
)
merge_and_uncode_rca_uploads(
run_quac_upload_report_warning.out,
ch_cohort,
ch_comment,
params.production,
params.use_grs
)
// remove_patients_from_merged(merge_and_uncode_rca_uploads.out, ch_cohort, params.production)
update_data_table(
merge_and_uncode_rca_uploads.out,
ch_cohort,
ch_comment,
params.production
)
update_date_tracking_table(
update_data_table.out,
ch_cohort,
ch_comment,
params.production
)
run_quac_table_report(
update_date_tracking_table.out,
ch_cohort,
params.production
)
run_quac_comparison_report(
run_quac_table_report.out,
ch_cohort,
params.production
)
create_masking_report(
run_quac_comparison_report.out,
ch_cohort,
params.production
)
update_case_count_table(
create_masking_report.out,
ch_comment,
params.production
)
} else {
exit 1, 'step not supported'
}
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
workflow CLINICAL_RELEASE {
run_clinical_release('', params.cohort, params.production)
}