Skip to content

Commit 6a419b9

Browse files
bentshermanewels
andauthored
Convert to mkdocs (#29)
Co-authored-by: Phil Ewels <phil@seqera.io>
1 parent ec5677f commit 6a419b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+501
-3636
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.x
14+
- run: pip install mkdocs-material
15+
- run: mkdocs gh-deploy --force

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: test
2+
on: push
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-java@v3
9+
with:
10+
distribution: 'temurin'
11+
java-version: '17'
12+
- uses: nf-core/setup-nextflow@v1
13+
- run: bash scripts/test.sh

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.git/
2-
.nextflow*
1+
.git
32
.idea*
4-
work/
3+
.nextflow*
4+
my-results
5+
public
56
results
6-
my-results
7+
work

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22

33
A curated collection of Nextflow implementation patterns
44

5-
[![Build Status](https://travis-ci.org/nextflow-io/patterns.svg?branch=master)](https://travis-ci.org/nextflow-io/patterns)
5+
![Build Status](https://github.com/nextflow-io/patterns/actions/workflows/test.yml/badge.svg)
66

77
## Basic patterns
88

9-
* [Channel duplication](docs/channel-duplication.adoc)
9+
* [Channel duplication](docs/channel-duplication.md)
1010

11-
### Scatter executions
11+
## Scatter executions
1212

13-
* [Process per file path](docs/process-per-file-path.adoc)
14-
* [Process per file chunk](docs/process-per-file-chunk.adoc)
15-
* [Process per file pairs](docs/process-per-file-pairs.adoc)
16-
* [Process per file range](docs/process-per-file-range.adoc)
17-
* [Process per CSV record](docs/process-per-csv-record.adoc)
18-
* [Process per file output](docs/process-per-file-output.adoc)
13+
* [Process per file path](docs/process-per-file-path.md)
14+
* [Process per file chunk](docs/process-per-file-chunk.md)
15+
* [Process per file pairs](docs/process-per-file-pairs.md)
16+
* [Process per file range](docs/process-per-file-range.md)
17+
* [Process per CSV record](docs/process-per-csv-record.md)
18+
* [Process per file output](docs/process-per-file-output.md)
1919

20-
### Gather results
20+
## Gather results
2121

22-
* [Process all outputs altogether](docs/process-collect.adoc)
23-
* [Process outputs into groups](docs/process-into-groups.adoc)
24-
* [Collect outputs into a file](docs/collect-into-file.adoc)
22+
* [Process all outputs altogether](docs/process-collect.md)
23+
* [Process outputs into groups](docs/process-into-groups.md)
24+
* [Collect outputs into a file](docs/collect-into-file.md)
2525

26-
### Organize outputs
26+
## Organize outputs
2727

28-
* [Store process outputs](docs/publish-process-outputs.adoc)
29-
* [Store outputs matching a glob pattern](docs/publish-matching-glob.adoc)
30-
* [Store outputs renaming files](docs/publish-rename-outputs.adoc)
28+
* [Store process outputs](docs/publish-process-outputs.md)
29+
* [Store outputs matching a glob pattern](docs/publish-matching-glob.md)
30+
* [Store outputs renaming files](docs/publish-rename-outputs.md)
3131

3232
## Other
3333

34-
* [Get process work directory](docs/process-get-workdir.adoc)
35-
* [Ignore failing process](docs/ignore-failing-process.adoc)
36-
* [State dependency](docs/state-dependency.adoc)
34+
* [Get process work directory](docs/process-get-workdir.md)
35+
* [Ignore failing process](docs/ignore-failing-process.md)
36+
* [State dependency](docs/state-dependency.md)
3737

3838
## Advanced patterns
3939

40-
* [Conditional process resources](docs/conditional-resources.adoc)
41-
* [Conditional process executions](docs/conditional-process.adoc)
42-
* [Skip process execution](docs/skip-process-execution.adoc)
43-
* [Feedback loop](docs/feedback-loop.adoc)
44-
* [Optional input](docs/optional-input.adoc)
45-
* [Optional output](docs/optional-output.adoc)
46-
* [Process when empty](docs/process-when-empty.adoc)
47-
* [Task batching](docs/task-batching.adoc)
40+
* [Conditional process resources](docs/conditional-resources.md)
41+
* [Conditional process executions](docs/conditional-process.md)
42+
* [Skip process execution](docs/skip-process-execution.md)
43+
* [Feedback loop](docs/feedback-loop.md)
44+
* [Optional input](docs/optional-input.md)
45+
* [Optional output](docs/optional-output.md)
46+
* [Process when empty](docs/process-when-empty.md)
47+
* [Task batching](docs/task-batching.md)

docs/Makefile

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
= Channel duplication
2-
3-
== Problem
1+
## Problem
42

53
You need to you use the same channel as input in two or more processes.
64

7-
== Solution
5+
## Solution
86

9-
In DSL2, you can just do it! The https://www.nextflow.io/docs/latest/operator.html#into[into] operator is no longer needed.
7+
In DSL2, you can just do it! The [into](https://www.nextflow.io/docs/latest/operator.html#into) operator is no longer needed.
108

11-
== Code
9+
## Code
1210

13-
[source,nextflow,linenums,options="nowrap"]
14-
----
11+
```groovy
1512
process foo {
1613
input: path x
1714
script:
@@ -34,12 +31,12 @@ workflow {
3431
foo(input_ch)
3532
bar(input_ch)
3633
}
37-
----
34+
```
3835

39-
== Run it
36+
## Run it
4037

4138
Use the the following command to execute the example:
4239

43-
```
40+
```bash
4441
nextflow run patterns/channel-duplication.nf
4542
```
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
= Collect outputs into a file
2-
3-
== Problem
1+
## Problem
42

53
You need to concatenate into a single file all output files produced by an upstream process.
64

7-
== Solution
5+
## Solution
86

9-
Use the https://www.nextflow.io/docs/latest/operator.html#collectfile[collectFile] operator to merge all
7+
Use the [collectFile](https://www.nextflow.io/docs/latest/operator.html#collectfile) operator to merge all
108
the output files into a single file.
119

12-
== Code
10+
## Code
1311

14-
[source,nextflow,linenums,options="nowrap"]
15-
----
12+
```groovy
1613
process foo {
1714
input:
1815
path x
@@ -30,12 +27,12 @@ workflow {
3027
| collectFile \
3128
| view
3229
}
33-
----
30+
```
3431

35-
== Run it
32+
## Run it
3633

3734
Use the the following command to execute the example:
3835

39-
```
36+
```bash
4037
nextflow run patterns/collect-into-file.nf
4138
```
Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
= Conditional process executions
2-
3-
== Problem
1+
## Problem
42

53
One of two different tasks should be executed based on some condition,
64
and a third task should process the results of the selected task.
75

8-
== Solution
6+
## Solution
97

108
Simply execute either process using `if/else` statements on the condition.
119
Define a channel, e.g. `omega_ch`, which emits the output of the selected process
1210
in each case. Then, execute the third process with this output channel.
1311

1412
Or, use a ternary expression and a pipe to keep things short and sweet.
1513

16-
== Code
14+
## Code
1715

18-
[source,nextflow,linenums,options="nowrap"]
19-
----
16+
```groovy
2017
params.flag = false
2118
2219
process foo {
@@ -66,39 +63,38 @@ workflow {
6663
// the short way
6764
(params.flag ? bar : foo) | omega
6865
}
69-
----
66+
```
7067

71-
== Run it
68+
## Run it
7269

7370
Use the the following command to execute the example:
7471

75-
```
72+
```bash
7673
nextflow run patterns/conditional-process.nf
7774
```
7875

7976
The processes `foo` and `omega` are executed. Run the same command
8077
with the `--flag` command line option.
8178

82-
```
79+
```bash
8380
nextflow run patterns/conditional-process.nf --flag
8481
```
8582

8683
This time the processes `bar` and `omega` are executed.
8784

88-
== Alternative solution
85+
## Alternative solution
8986

9087
Create an input channel for each process that is either populated with data or an
91-
https://www.nextflow.io/docs/latest/channel.html#empty[empty] channel.
88+
[empty](https://www.nextflow.io/docs/latest/channel.html#empty) channel.
9289
Each process will execute only if its input channel has data.
9390

94-
Then use the https://www.nextflow.io/docs/latest/operator.html#mix[mix] operator to create
91+
Then use the [mix](https://www.nextflow.io/docs/latest/operator.html#mix) operator to create
9592
a new channel that emits the outputs produced by the two processes, and use it as the input
9693
for the third process.
9794

98-
== Code
95+
## Code
9996

100-
[source,nextflow,linenums,options="nowrap"]
101-
----
97+
```groovy
10298
params.flag = false
10399
104100
process foo {
@@ -148,10 +144,10 @@ workflow {
148144
149145
foo.out | mix(bar.out) | omega
150146
}
151-
----
147+
```
152148

153-
== Run it
149+
## Run it
154150

155-
```
151+
```bash
156152
nextflow run patterns/conditional-process2.nf
157153
```
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
= Conditional resources definition
2-
3-
== Problem
1+
## Problem
42

53
A task in your workflow needs to use some amount of computing
64
resources (e.g. memory) that depends on the size or the name of one
75
or more input files.
86

9-
== Solution
7+
## Solution
108

119
Declare the resource requirements (`memory`, `cpus`, etc.)
1210
in a dynamic manner using a closure.
@@ -15,10 +13,9 @@ The closure computes the required amount of resources using the file
1513
attributes (e.g. `size`) of the inputs declared in the process
1614
definition.
1715

18-
== Code
16+
## Code
1917

20-
[source,nextflow,linenums,options="nowrap"]
21-
----
18+
```groovy
2219
process foo {
2320
memory { reads.size() < 70.KB ? 1.GB : 5.GB }
2421
@@ -34,10 +31,10 @@ workflow {
3431
Channel.fromPath("$baseDir/data/reads/*_1.fq.gz", checkIfExists:true) \
3532
| foo
3633
}
37-
----
34+
```
3835

39-
== Run it
36+
## Run it
4037

41-
```
38+
```bash
4239
nextflow run patterns/conditional-resources.nf
4340
```

0 commit comments

Comments
 (0)