Skip to content

Commit cdd6bba

Browse files
committed
Prettier
1 parent de35681 commit cdd6bba

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/side_quests/workflows_of_workflows.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ One of the most powerful features of Nextflow is its ability to compose complex
55
Let's explore why workflow composition is so important. When you're developing a pipeline, you often find yourself creating similar sequences of processes for different data types or analysis steps. Without workflow composition, you might end up copying and pasting these process sequences, leading to duplicated code that's hard to maintain. Or you might create one massive workflow that's difficult to understand and modify.
66

77
With workflow composition, you can:
8+
89
- Break down complex pipelines into logical, reusable units
910
- Test each workflow module independently
1011
- Mix and match workflows to create new pipelines
1112
- Share common workflow modules across different pipelines
1213
- Make your code more maintainable and easier to understand
1314

1415
In this side quest, we'll create a pipeline that demonstrates these benefits by:
16+
1517
1. Creating independent workflow modules that can be tested and used separately
1618
2. Composing these modules into a larger pipeline
1719
3. Using Nextflow's workflow composition features to manage data flow between modules
1820

1921
---
22+
2023
## 0. Warmup
2124

2225
### 0.1 Prerequisites
@@ -107,6 +110,7 @@ workflow {
107110
```
108111

109112
Run this and see the output:
113+
110114
```bash title="Run the workflow"
111115
nextflow run main.nf
112116
```
@@ -129,6 +133,7 @@ Timestamped: /workspaces/training/side_quests/workflows_of_workflows/work/ea/342
129133
### Takeaway
130134

131135
You should now have a working greeting workflow that:
136+
132137
- Takes a channel of names as input
133138
- Validates each name
134139
- Creates a greeting for each valid name
@@ -193,6 +198,7 @@ workflow TRANSFORM_WORKFLOW {
193198
```
194199

195200
Run the complete pipeline:
201+
196202
```bash title="Run the workflow"
197203
nextflow run main.nf
198204
```
@@ -217,16 +223,17 @@ Reversed: /workspaces/training/side_quests/workflows_of_workflows/work/f0/74ba4a
217223

218224
If you take a look at one of those reversed files, you'll see that it's the uppercase version of the greeting reversed:
219225

220-
```bash title="Check a final output file"
226+
````bash title="Check a final output file"
221227
cat /workspaces/training/side_quests/workflows_of_workflows/work/f0/74ba4a10d9ef5c82f829d1c154d0f6/REVERSED-UPPER-timestamped_Alice-output.txt```
222228
223229
```console title="Reversed file content"
224230
!ECILA ,OLLEH ]04:50:71 60-30-5202[
225-
```
231+
````
226232

227233
### Takeaway
228234

229235
You should now have a complete pipeline that:
236+
230237
- Processes names through the greeting workflow
231238
- Feeds the timestamped greetings into the transform workflow
232239
- Produces both uppercase and reversed versions of the greetings
@@ -236,6 +243,7 @@ You should now have a complete pipeline that:
236243
In this side quest, we've explored the powerful concept of workflow composition in Nextflow, which allows us to build complex pipelines from smaller, reusable components. Here's what we've accomplished:
237244
238245
1. **Created Modular Workflows**: We built two independent workflow modules:
246+
239247
- A `GREETING_WORKFLOW` that validates names, creates greetings, and adds timestamps
240248
- A `TRANSFORM_WORKFLOW` that converts text to uppercase and reverses it
241249
@@ -248,6 +256,7 @@ In this side quest, we've explored the powerful concept of workflow composition
248256
5. **Practiced Modular Design**: We experienced firsthand how breaking a pipeline into logical components makes the code more maintainable and easier to understand.
249257
250258
This modular approach offers several advantages over monolithic pipelines:
259+
251260
- Each workflow can be developed, tested, and debugged independently
252261
- Workflows can be reused across different pipelines
253262
- The overall pipeline structure becomes more readable and maintainable
@@ -260,6 +269,7 @@ By mastering workflow composition, you're now equipped to build more sophisticat
260269
### Key Concepts
261270

262271
1. **Workflow Inclusion**
272+
263273
```nextflow
264274
// Include a single workflow
265275
include { WORKFLOW_NAME } from './path/to/workflow'
@@ -272,6 +282,7 @@ By mastering workflow composition, you're now equipped to build more sophisticat
272282
```
273283
274284
2. **Workflow Inputs and Outputs**
285+
275286
```nextflow
276287
workflow EXAMPLE {
277288
take:

0 commit comments

Comments
 (0)