-
Notifications
You must be signed in to change notification settings - Fork 0
/
wf.nf
99 lines (92 loc) · 2.22 KB
/
wf.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
#!/usr/bin/env nextflow
VERSION="1.0"
nextflow.enable.dsl=2
// Workflow parameters
params.indir = "./data"
params.outdir = "./results"
// Learning parameters
params.bdg_mode = "bdgraph.mpl"
params.bdg_uprior = 0.5
params.bdg_cut = 0.9
params.bdg_iter = 5000
println()
params.help = ""
if (params.help) {
log.info " "
log.info "USAGE: "
log.info " "
log.info "nextflow run wf.nf -c configs/profiles.config -profile {profile}"
log.info " "
exit 1
}
log.info """
W O R K F L O W ~ Configuration
===============================
Profile : ${workflow.profile}
Project Path : ${workflow.projectDir}
Input Directory : ${params.indir}
Output Directory : ${params.outdir}
-------------------------------
Learning parameters
===============================
BDG Mode : ${params.bdg_mode}
BDG Uniform Prior : ${params.bdg_uprior}
BDG Cut : ${params.bdg_cut}
BDG Iter : ${params.bdg_iter}
-------------------------------\n
"""
include { SPLIT } from './modules/SPLIT'
include { LEARN } from './modules/LEARN'
include { LEARN_PRIOR } from './modules/LEARN_PRIOR'
include { RECONSTRUCT } from './modules/RECONSTRUCT'
workflow ABC {
main:
eset = "${params.indir}/esets/ABC.rds"
modules = "${params.indir}/modules.rds"
SPLIT( eset, modules )
LEARN( SPLIT.out.flatten() )
RECONSTRUCT( eset, LEARN.out[0].collect() )
emit:
LEARN.out[0]
}
workflow AB {
take:
prior
main:
eset = "${params.indir}/esets/AB.rds"
LEARN_PRIOR( eset, prior )
RECONSTRUCT( eset, LEARN_PRIOR.out[0].collect() )
emit:
LEARN_PRIOR.out[0]
}
workflow A {
take:
prior
main:
eset = "${params.indir}/esets/A.rds"
LEARN_PRIOR( eset, prior )
RECONSTRUCT( eset, LEARN_PRIOR.out[0].collect() )
}
workflow B {
take:
prior
main:
eset = "${params.indir}/esets/B.rds"
LEARN_PRIOR( eset, prior )
RECONSTRUCT( eset, LEARN_PRIOR.out[0].collect() )
}
workflow C {
take:
prior
main:
eset = "${params.indir}/esets/C.rds"
LEARN_PRIOR( eset, prior )
RECONSTRUCT( eset, LEARN_PRIOR.out[0].collect() )
}
workflow {
ABC()
AB(ABC.out)
A(AB.out)
B(AB.out)
C(ABC.out)
}