Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update process snippets to comply with strict syntax #5526

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/cache-and-resume.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ process gather {
input:
tuple val(id), file(foo)
tuple val(id), file(bar)

script:
"""
merge_command $foo $bar
"""
Expand All @@ -168,6 +170,8 @@ workflow {
process gather {
input:
tuple val(id), file(foo), file(bar)

script:
"""
merge_command $foo $bar
"""
Expand Down
1 change: 1 addition & 0 deletions docs/channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ process foo {
output:
path 'x.txt'

script:
"""
echo $x > x.txt
"""
Expand Down
15 changes: 9 additions & 6 deletions docs/conda.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ Conda package names can specified using the `conda` directive. Multiple package
process foo {
conda 'bwa samtools multiqc'

'''
script:
"""
your_command --here
'''
"""
}
```

Expand Down Expand Up @@ -98,9 +99,10 @@ The path of an environment file can be specified using the `conda` directive:
process foo {
conda '/some/path/my-env.yaml'

'''
script:
"""
your_command --here
'''
"""
}
```

Expand Down Expand Up @@ -128,9 +130,10 @@ If you already have a local Conda environment, you can use it in your workflow s
process foo {
conda '/path/to/an/existing/env/directory'

'''
script:
"""
your_command --here
'''
"""
}
```

Expand Down
20 changes: 12 additions & 8 deletions docs/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,19 @@ It is possible to specify a different Docker image for each process definition i
process foo {
container 'image_name_1'

'''
script:
"""
do this
'''
"""
}

process bar {
container 'image_name_2'

'''
script:
"""
do that
'''
"""
}
```

Expand Down Expand Up @@ -380,17 +382,19 @@ It is possible to specify a different container image for each process definitio
process foo {
container 'image_name_1'

'''
script:
"""
do this
'''
"""
}

process bar {
container 'image_name_2'

'''
script:
"""
do that
'''
"""
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/developer/nextflow.ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ process splitLetters {
output:
path 'chunk_*'

script:
"""
printf '${params.str}' | split -b 6 - chunk_
"""
Expand All @@ -43,6 +44,7 @@ process convertToUpper {
output:
stdout

script:
"""
cat $x | tr '[a-z]' '[A-Z]'
"""
Expand All @@ -62,6 +64,7 @@ process( splitLetters( {
output:
path('chunk_*')

script:
"""
printf '${params.str}' | split -b 6 - chunk_
"""
Expand All @@ -73,6 +76,7 @@ process( convertToUpper( {
output:
stdout

script:
"""
cat $x | tr '[a-z]' '[A-Z]'
"""
Expand Down
2 changes: 2 additions & 0 deletions docs/developer/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ You can then use this executor in your pipeline:
```nextflow
process foo {
executor 'my-executor'

// ...
}
```

Expand Down
2 changes: 2 additions & 0 deletions docs/dsl1.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ process splitLetters {
output:
file 'chunk_*' into letters

script:
"""
printf '${params.str}' | split -b 6 - chunk_
"""
Expand All @@ -41,6 +42,7 @@ process convertToUpper {
output:
stdout result

script:
"""
cat $x | tr '[a-z]' '[A-Z]'
"""
Expand Down
10 changes: 8 additions & 2 deletions docs/google.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ process myTask {
cpus 8
memory '40 GB'

script:
"""
your_command --here
"""
Expand All @@ -112,6 +113,7 @@ process myTask {
process anotherTask {
machineType 'n1-highmem-8'

script:
"""
your_command --here
"""
Expand All @@ -130,6 +132,7 @@ process myTask {
memory '20 GB'
machineType 'n2-*,c2-*,m3-*'

script:
"""
your_command --here
"""
Expand All @@ -148,6 +151,7 @@ process myTask {
memory '20 GB'
machineType 'template://my-template'

script:
"""
your_command --here
"""
Expand Down Expand Up @@ -341,16 +345,18 @@ process custom_resources_task {
memory '40 GB'
disk '200 GB'

script:
"""
<Your script here>
your_command --here
"""
}

process predefined_resources_task {
machineType 'n1-highmem-8'

script:
"""
<Your script here>
your_command --here
"""
}
```
Expand Down
5 changes: 5 additions & 0 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ In the first example, let's consider the simple use case in which a process perf
process CpuUsageEx1 {
cpus 2

script:
"""
stress -c 1 -t 10 # compute square-root of random numbers during 10s using 1 CPU
"""
Expand All @@ -35,6 +36,7 @@ In the second example, some time will be spent performing pure computation and s
process CpuUsageEx2 {
cpus 1

script:
"""
stress -c 1 -t 10 # compute square-root of random numbers during 10s using 1 CPU
stress -c 1 -t 5 # compute square-root of random numbers during 5s using 1 CPU
Expand All @@ -57,6 +59,7 @@ The third example is similar to the second one except that the pure computation
process CpuUsageEx3 {
cpus 2

script:
"""
stress -c 2 -t 10 # compute square-root of random numbers during 10s using 2 CPUs
sleep 10 # use no CPU during 10s
Expand Down Expand Up @@ -232,6 +235,7 @@ The first and second programs are executed in `foo` and `bar` processes respecti
process foo {
memory '1.5 GB'

script:
"""
memory_vmem_1GiB_ram_0Gib
"""
Expand All @@ -240,6 +244,7 @@ process foo {
process bar {
memory '1.5 GB'

script:
"""
memory_vmem_1GiB_ram_1Gib
"""
Expand Down
2 changes: 2 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ process blastSearch {
output:
path "top_hits.txt"

script:
"""
blastp -db $db -query $query -outfmt 6 > blast_result
cat blast_result | head -n 10 | cut -f 2 > top_hits.txt
Expand All @@ -47,6 +48,7 @@ process extractTopHits {
output:
path "sequences.txt"

script:
"""
blastdbcmd -db $db -entry_batch $top_hits > sequences.txt
"""
Expand Down
Loading
Loading