-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
52 lines (47 loc) · 1.37 KB
/
main.nf
File metadata and controls
52 lines (47 loc) · 1.37 KB
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
// Subworkflows
include { SIMULATE_WF } from './workflows/simulate.nf'
include { INPUT_WF } from './workflows/input.nf'
include { MASK_WF } from './workflows/mask.nf'
include { CAIMAN_WF } from './workflows/caiman.nf'
include { SUMMARY_WF } from './workflows/summary.nf'
// Main workflow
workflow {
def use_2d = params.use_2d
// Create the image channel
if (params.simulate == true) {
// just simulates 2d data
use_2d = true
// run the simulation workflow
SIMULATE_WF()
ch_img = SIMULATE_WF.out.img
ch_fmt_log = SIMULATE_WF.out.fmt_log
ch_cat_log = SIMULATE_WF.out.cat_log
} else {
INPUT_WF()
ch_img = INPUT_WF.out.img
ch_fmt_log = INPUT_WF.out.fmt_log
ch_cat_log = INPUT_WF.out.cat_log
}
// Create the mask channel
MASK_WF(ch_img, channel.of(use_2d))
// Run Caiman
CAIMAN_WF(
MASK_WF.out.img_orig,
MASK_WF.out.img_masked,
MASK_WF.out.img_masks
)
// Summarize log files
SUMMARY_WF(
MASK_WF.out.img_masked,
ch_fmt_log,
ch_cat_log,
MASK_WF.out.mask_log,
CAIMAN_WF.out.caiman_log,
CAIMAN_WF.out.calc_dff_f0_log
)
}
// On complete
workflow.onComplete {
println "Pipeline completed at: $workflow.complete"
println "Execution status: ${ workflow.success ? 'OK' : 'failed' }"
}