Skip to content

Commit be1694b

Browse files
authored
Update process snippets to comply with strict syntax (#5526) [ci skip]
Signed-off-by: Ben Sherman <[email protected]>
1 parent 99a7f37 commit be1694b

File tree

17 files changed

+193
-83
lines changed

17 files changed

+193
-83
lines changed

docs/cache-and-resume.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ process gather {
148148
input:
149149
tuple val(id), file(foo)
150150
tuple val(id), file(bar)
151+
152+
script:
151153
"""
152154
merge_command $foo $bar
153155
"""
@@ -168,6 +170,8 @@ workflow {
168170
process gather {
169171
input:
170172
tuple val(id), file(foo), file(bar)
173+
174+
script:
171175
"""
172176
merge_command $foo $bar
173177
"""

docs/channel.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ process foo {
4545
output:
4646
path 'x.txt'
4747
48+
script:
4849
"""
4950
echo $x > x.txt
5051
"""

docs/conda.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ Conda package names can specified using the `conda` directive. Multiple package
4949
process foo {
5050
conda 'bwa samtools multiqc'
5151
52-
'''
52+
script:
53+
"""
5354
your_command --here
54-
'''
55+
"""
5556
}
5657
```
5758

@@ -98,9 +99,10 @@ The path of an environment file can be specified using the `conda` directive:
9899
process foo {
99100
conda '/some/path/my-env.yaml'
100101
101-
'''
102+
script:
103+
"""
102104
your_command --here
103-
'''
105+
"""
104106
}
105107
```
106108

@@ -128,9 +130,10 @@ If you already have a local Conda environment, you can use it in your workflow s
128130
process foo {
129131
conda '/path/to/an/existing/env/directory'
130132
131-
'''
133+
script:
134+
"""
132135
your_command --here
133-
'''
136+
"""
134137
}
135138
```
136139

docs/container.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,19 @@ It is possible to specify a different Docker image for each process definition i
293293
process foo {
294294
container 'image_name_1'
295295
296-
'''
296+
script:
297+
"""
297298
do this
298-
'''
299+
"""
299300
}
300301
301302
process bar {
302303
container 'image_name_2'
303304
304-
'''
305+
script:
306+
"""
305307
do that
306-
'''
308+
"""
307309
}
308310
```
309311

@@ -380,17 +382,19 @@ It is possible to specify a different container image for each process definitio
380382
process foo {
381383
container 'image_name_1'
382384
383-
'''
385+
script:
386+
"""
384387
do this
385-
'''
388+
"""
386389
}
387390
388391
process bar {
389392
container 'image_name_2'
390393
391-
'''
394+
script:
395+
"""
392396
do that
393-
'''
397+
"""
394398
}
395399
```
396400

docs/developer/nextflow.ast.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ process splitLetters {
3232
output:
3333
path 'chunk_*'
3434
35+
script:
3536
"""
3637
printf '${params.str}' | split -b 6 - chunk_
3738
"""
@@ -43,6 +44,7 @@ process convertToUpper {
4344
output:
4445
stdout
4546
47+
script:
4648
"""
4749
cat $x | tr '[a-z]' '[A-Z]'
4850
"""
@@ -62,6 +64,7 @@ process( splitLetters( {
6264
output:
6365
path('chunk_*')
6466
67+
script:
6568
"""
6669
printf '${params.str}' | split -b 6 - chunk_
6770
"""
@@ -73,6 +76,7 @@ process( convertToUpper( {
7376
output:
7477
stdout
7578
79+
script:
7680
"""
7781
cat $x | tr '[a-z]' '[A-Z]'
7882
"""

docs/developer/plugins.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ You can then use this executor in your pipeline:
141141
```nextflow
142142
process foo {
143143
executor 'my-executor'
144+
145+
// ...
144146
}
145147
```
146148

docs/dsl1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ process splitLetters {
2929
output:
3030
file 'chunk_*' into letters
3131
32+
script:
3233
"""
3334
printf '${params.str}' | split -b 6 - chunk_
3435
"""
@@ -41,6 +42,7 @@ process convertToUpper {
4142
output:
4243
stdout result
4344
45+
script:
4446
"""
4547
cat $x | tr '[a-z]' '[A-Z]'
4648
"""

docs/google.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ process myTask {
104104
cpus 8
105105
memory '40 GB'
106106
107+
script:
107108
"""
108109
your_command --here
109110
"""
@@ -112,6 +113,7 @@ process myTask {
112113
process anotherTask {
113114
machineType 'n1-highmem-8'
114115
116+
script:
115117
"""
116118
your_command --here
117119
"""
@@ -130,6 +132,7 @@ process myTask {
130132
memory '20 GB'
131133
machineType 'n2-*,c2-*,m3-*'
132134
135+
script:
133136
"""
134137
your_command --here
135138
"""
@@ -148,6 +151,7 @@ process myTask {
148151
memory '20 GB'
149152
machineType 'template://my-template'
150153
154+
script:
151155
"""
152156
your_command --here
153157
"""
@@ -341,16 +345,18 @@ process custom_resources_task {
341345
memory '40 GB'
342346
disk '200 GB'
343347
348+
script:
344349
"""
345-
<Your script here>
350+
your_command --here
346351
"""
347352
}
348353
349354
process predefined_resources_task {
350355
machineType 'n1-highmem-8'
351356
357+
script:
352358
"""
353-
<Your script here>
359+
your_command --here
354360
"""
355361
}
356362
```

docs/metrics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ In the first example, let's consider the simple use case in which a process perf
2121
process CpuUsageEx1 {
2222
cpus 2
2323
24+
script:
2425
"""
2526
stress -c 1 -t 10 # compute square-root of random numbers during 10s using 1 CPU
2627
"""
@@ -35,6 +36,7 @@ In the second example, some time will be spent performing pure computation and s
3536
process CpuUsageEx2 {
3637
cpus 1
3738
39+
script:
3840
"""
3941
stress -c 1 -t 10 # compute square-root of random numbers during 10s using 1 CPU
4042
stress -c 1 -t 5 # compute square-root of random numbers during 5s using 1 CPU
@@ -57,6 +59,7 @@ The third example is similar to the second one except that the pure computation
5759
process CpuUsageEx3 {
5860
cpus 2
5961
62+
script:
6063
"""
6164
stress -c 2 -t 10 # compute square-root of random numbers during 10s using 2 CPUs
6265
sleep 10 # use no CPU during 10s
@@ -232,6 +235,7 @@ The first and second programs are executed in `foo` and `bar` processes respecti
232235
process foo {
233236
memory '1.5 GB'
234237
238+
script:
235239
"""
236240
memory_vmem_1GiB_ram_0Gib
237241
"""
@@ -240,6 +244,7 @@ process foo {
240244
process bar {
241245
memory '1.5 GB'
242246
247+
script:
243248
"""
244249
memory_vmem_1GiB_ram_1Gib
245250
"""

docs/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ process blastSearch {
3333
output:
3434
path "top_hits.txt"
3535
36+
script:
3637
"""
3738
blastp -db $db -query $query -outfmt 6 > blast_result
3839
cat blast_result | head -n 10 | cut -f 2 > top_hits.txt
@@ -47,6 +48,7 @@ process extractTopHits {
4748
output:
4849
path "sequences.txt"
4950
51+
script:
5052
"""
5153
blastdbcmd -db $db -entry_batch $top_hits > sequences.txt
5254
"""

0 commit comments

Comments
 (0)