File tree 4 files changed +34
-2
lines changed
nextflow/src/main/groovy/nextflow/script
nf-lang/src/main/java/nextflow/script/control
4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,11 @@ class WorkflowBinding extends Binding {
159
159
}
160
160
161
161
void _publish_ (String name , Object source ) {
162
- if ( source instanceof ChannelOut )
163
- throw new ScriptRuntimeException (" Cannot assign a multi-channel to a workflow output: $name " )
162
+ if ( source instanceof ChannelOut ) {
163
+ if ( source. size() > 1 )
164
+ throw new ScriptRuntimeException (" Cannot assign a multi-channel to a workflow output: $name " )
165
+ source = source[0 ]
166
+ }
164
167
165
168
owner. session. outputs[name] = source instanceof DataflowWriteChannel
166
169
? source
Original file line number Diff line number Diff line change @@ -489,6 +489,8 @@ public void visitMethodCallExpression(MethodCallExpression node) {
489
489
490
490
private void visitPathDirective (MethodCallExpression node ) {
491
491
var code = asDslBlock (node , 1 );
492
+ if ( code == null )
493
+ return ;
492
494
for ( var stmt : code .getStatements () ) {
493
495
if ( visitPublishStatement (stmt ) )
494
496
hasPublishStatements = true ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ $NXF_RUN --save_bam_bai | tee stdout
21
21
[[ -L results/quant/beta ]] || false
22
22
[[ -L results/quant/delta ]] || false
23
23
[[ -f results/samples.csv ]] || false
24
+ [[ -f results/summary.txt ]] || false
24
25
25
26
26
27
#
@@ -46,6 +47,7 @@ $NXF_RUN --save_bam_bai | tee stdout
46
47
[[ -L results/quant/beta ]] || false
47
48
[[ -L results/quant/delta ]] || false
48
49
[[ -f results/samples.csv ]] || false
50
+ [[ -f results/summary.txt ]] || false
49
51
50
52
51
53
#
@@ -73,3 +75,4 @@ $NXF_RUN --save_bam_bai -resume | tee stdout
73
75
[[ -L results/quant/beta ]] || false
74
76
[[ -L results/quant/delta ]] || false
75
77
[[ -f results/samples.csv ]] || false
78
+ [[ -f results/summary.txt ]] || false
Original file line number Diff line number Diff line change @@ -62,6 +62,19 @@ process quant {
62
62
'''
63
63
}
64
64
65
+ process summary {
66
+ input:
67
+ path logs
68
+
69
+ output:
70
+ path(' summary.txt' ), emit: report
71
+
72
+ script:
73
+ '''
74
+ ls -1 *.log > summary.txt
75
+ '''
76
+ }
77
+
65
78
workflow {
66
79
main :
67
80
ids = Channel . of(' alpha' , ' beta' , ' delta' )
@@ -83,8 +96,15 @@ workflow {
83
96
]
84
97
}
85
98
99
+ ch_logs = ch_samples
100
+ .map { sample -> sample. fastqc }
101
+ .collect()
102
+
103
+ summary(ch_logs)
104
+
86
105
publish :
87
106
samples = ch_samples
107
+ summary = summary. out
88
108
}
89
109
90
110
output {
@@ -101,4 +121,8 @@ output {
101
121
sep ' ,'
102
122
}
103
123
}
124
+
125
+ summary {
126
+ path ' .'
127
+ }
104
128
}
You can’t perform that action at this time.
0 commit comments