-
Notifications
You must be signed in to change notification settings - Fork 13
/
main-registration.nf
executable file
·91 lines (74 loc) · 2.66 KB
/
main-registration.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
#!/usr/bin/env nextflow
/*
Image registration using Bigstream
*/
nextflow.enable.dsl=2
// path to the fixed n5 image
params.fixed = ""
// path to the moving n5 image
params.moving = ""
// path to the folder where you'd like all outputs to be written
params.outdir = ""
fixed = file(params.fixed)
moving = file(params.moving)
outdir = file(params.outdir)
affdir = file("${outdir}/aff")
if(!affdir.exists()) affdir.mkdirs()
tiledir = file("${outdir}/tiles")
if(!tiledir.exists()) tiledir.mkdirs()
// final outputs
transform_dir = "${outdir}/transform"
invtransform_dir = "${outdir}/invtransform"
warped_dir = "${outdir}/warped"
log.info """\
BIGSTREAM REGISTRATION PIPELINE
===================================
workDir : $workDir
outdir : ${params.outdir}
affdir : $affdir
tiledir : $tiledir
"""
.stripIndent()
include {
default_mf_params;
registration_container_param;
registration_xy_stride_param;
registration_xy_overlap_param;
registration_z_stride_param;
registration_z_overlap_param;
} from './param_utils'
final_params = default_mf_params() + params
include {
registration;
} from './workflows/registration' addParams(lsf_opts: final_params.lsf_opts,
registration_container: registration_container_param(final_params),
aff_scale_transform_cpus: final_params.aff_scale_transform_cpus,
def_scale_transform_cpus: final_params.def_scale_transform_cpus,
registration_stitch_cpus: final_params.registration_stitch_cpus,
registration_transform_cpus: final_params.registration_transform_cpus)
channels = final_params.channels?.split(',')
workflow {
registration(
Channel.of(fixed),
Channel.of(moving),
Channel.of(outdir),
final_params.dapi_channel,
registration_xy_stride_param(final_params),
registration_xy_overlap_param(final_params),
registration_z_stride_param(final_params),
registration_z_overlap_param(final_params),
final_params.aff_scale,
final_params.def_scale,
final_params.spots_cc_radius,
final_params.spots_spot_number,
final_params.ransac_cc_cutoff,
final_params.ransac_dist_threshold,
final_params.deform_iterations,
final_params.deform_auto_mask,
channels
)
}
workflow.onComplete {
println "Pipeline $workflow.scriptName completed at: $workflow.complete "
println "Execution status: ${ workflow.success ? 'OK' : 'failed' }"
}