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
Copy file name to clipboardExpand all lines: docs/hello_nextflow/04_hello_genomics.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,8 +309,8 @@ process GATK_HAPLOTYPECALLER {
309
309
path interval_list
310
310
311
311
output:
312
-
path "${input_bam}.vcf"
313
-
path "${input_bam}.vcf.idx"
312
+
path "${input_bam}.vcf" , emit: vcf
313
+
path "${input_bam}.vcf.idx" , emit: idx
314
314
315
315
"""
316
316
gatk HaplotypeCaller \
@@ -322,6 +322,8 @@ process GATK_HAPLOTYPECALLER {
322
322
}
323
323
```
324
324
325
+
You'll notice that we've introduced some new syntax here (`emit:`) to uniquely name each of our output channels, and the reasons for this will become clear soon.
326
+
325
327
This command takes quite a few more inputs, because GATK needs more information to perform the analysis compared to a simple indexing job.
326
328
But you'll note that there are even more inputs defined in the inputs block than are listed in the GATK command. Why is that?
Does that seem a bit complicated? Let's break this down and translate it into plain language.
462
462
463
463
1. We're taking the output channel from the `GATK_HAPLOTYPECALLER` process, referred to using the `.out` property.
464
-
2. Each 'element' coming out of the channel is a pair of files: the GVCF and its index file, in that order because that's the order they're listed in the process output block. Conveniently, we can pick out the GVCFs on one hand by adding `[0]` and the index files on the other by adding `[1]` after the `.out` property.
464
+
2. Each 'element' coming out of the channel is a pair of files: the GVCF and its index file, in that order because that's the order they're listed in the process output block. Conveniently, because in the last session we named the outputs of this process (using `emit:`), we can pick out the GVCFs on one hand by adding `.vcf` and the index files on the other by adding `.idx` after the `.out` property. If we had not named those outputs, we would have had to refer to them by `.out[0]` and `.out[1]`, respectively.
465
465
3. We append the `collect()` channel operator to bundle all the GVCF files together into a single element in a new channel called `all_gvcfs_ch`, and do the same with the index files to form the new channel called `all_idxs_ch`.
0 commit comments