You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.**Expanding Metadata During Workflow** Adding new information to your metadata as your pipeline progresses by adding process outputs and deriving values through conditional logic
883
+
2.**Expanding Metadata During Workflow** Adding new information to your metadata as your pipeline progresses by adding process outputs and deriving values through conditional logic.
884
884
885
-
- Adding new keys based on process output
885
+
- Adding new keys based on process output
886
886
887
-
```groovy
888
-
.map { meta, file, lang ->
889
-
[ meta + [lang:lang], file ]
890
-
}
891
-
```
892
-
893
-
- Adding new keys using a conditional clause
894
-
895
-
```groovy
896
-
.map{ meta, file ->
897
-
if ( meta.lang.equals("de") || meta.lang.equals('en') ){
898
-
lang_group = "germanic"
899
-
} else if ( meta.lang in ["fr", "es", "it"] ) {
900
-
lang_group = "romance"
901
-
} else {
902
-
lang_group = "unknown"
903
-
}
904
-
}
905
-
```
887
+
```groovy
888
+
.map { meta, file, lang ->
889
+
[ meta + [lang:lang], file ]
890
+
}
891
+
```
892
+
893
+
- Adding new keys using a conditional clause
894
+
895
+
```groovy
896
+
.map{ meta, file ->
897
+
if ( meta.lang.equals("de") || meta.lang.equals('en') ){
898
+
lang_group = "germanic"
899
+
} else if ( meta.lang in ["fr", "es", "it"] ) {
900
+
lang_group = "romance"
901
+
} else {
902
+
lang_group = "unknown"
903
+
}
904
+
}
905
+
```
906
906
907
-
3.**Customizing Process Behavior:** Using metadata to adapt how processes handle different files
907
+
3.**Customizing Process Behavior:** Using metadata to adapt how processes handle different files.
Copy file name to clipboardExpand all lines: docs/side_quests/splitting_and_grouping.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1152,27 +1152,27 @@ Mastering these channel operations will enable you to build flexible, scalable p
1152
1152
)
1153
1153
```
1154
1154
1155
-
4.**Distributing across intervals:** We used `combine` to create Cartesian products of samples with genomic intervals for parallel processing
1155
+
4.**Distributing across intervals:** We used `combine` to create Cartesian products of samples with genomic intervals for parallel processing.
1156
1156
1157
1157
```groovy
1158
1158
samples_ch.combine(intervals_ch)
1159
1159
```
1160
1160
1161
-
5.**Aggregating by grouping keys:** We used `groupTuple` to group by the first element in each tuple, thereby collecting samples sharing `id` and `interval` fields and merging technical replicates
1161
+
5.**Aggregating by grouping keys:** We used `groupTuple` to group by the first element in each tuple, thereby collecting samples sharing `id` and `interval` fields and merging technical replicates.
1162
1162
1163
1163
```groovy
1164
1164
channel.groupTuple()
1165
1165
```
1166
1166
1167
-
6.**Optimizing the data structure:** We used `subMap` to extract specific fields and created a named closure for making transformations reusable
1167
+
6.**Optimizing the data structure:** We used `subMap` to extract specific fields and created a named closure for making transformations reusable.
0 commit comments