Skip to content
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
6 changes: 4 additions & 2 deletions docs/hello_nextflow/04_hello_genomics.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand All @@ -322,6 +322,8 @@ process GATK_HAPLOTYPECALLER {
}
```

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.

This command takes quite a few more inputs, because GATK needs more information to perform the analysis compared to a simple indexing job.
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?

Expand Down
18 changes: 9 additions & 9 deletions docs/hello_nextflow/05_hello_operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,16 @@ _Before:_

```groovy title="hello-operators.nf" linenums="52"
output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx
```

_After:_

```groovy title="hello-operators.nf" linenums="52"
output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx
```

### 1.3. Run the pipeline again
Expand Down Expand Up @@ -454,14 +454,14 @@ Good news: we can do that using the `collect()` channel operator. Let's add the

```groovy title="hello-operators.nf" linenums="118"
// Collect variant calling outputs across samples
all_gvcfs_ch = GATK_HAPLOTYPECALLER.out[0].collect()
all_idxs_ch = GATK_HAPLOTYPECALLER.out[1].collect()
all_gvcfs_ch = GATK_HAPLOTYPECALLER.out.vcf.collect()
all_idxs_ch = GATK_HAPLOTYPECALLER.out.idx.collect()
```

Does that seem a bit complicated? Let's break this down and translate it into plain language.

1. We're taking the output channel from the `GATK_HAPLOTYPECALLER` process, referred to using the `.out` property.
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.
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.
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`.

!!!tip
Expand Down Expand Up @@ -773,8 +773,8 @@ _After:_

```groovy title="hello-operators.nf" linenums="87"
output:
path "${cohort_name}.joint.vcf"
path "${cohort_name}.joint.vcf.idx"
path "${cohort_name}.joint.vcf" , emit: vcf
path "${cohort_name}.joint.vcf.idx" , emit: idx
```

We're almost done!
Expand Down
8 changes: 4 additions & 4 deletions docs/hello_nextflow/07_hello_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down Expand Up @@ -331,8 +331,8 @@ process GATK_JOINTGENOTYPING {
path ref_dict

output:
path "${cohort_name}.joint.vcf"
path "${cohort_name}.joint.vcf.idx"
path "${cohort_name}.joint.vcf" , emit: vcf
path "${cohort_name}.joint.vcf.idx" , emit: idx

script:
def gvcfs_line = all_gvcfs.collect { gvcf -> "-V ${gvcf}" }.join(' ')
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/hello-config/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/hello-modules/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_JOINTGENOTYPING {
path ref_dict

output:
path "${cohort_name}.joint.vcf"
path "${cohort_name}.joint.vcf.idx"
path "${cohort_name}.joint.vcf" , emit: vcf
path "${cohort_name}.joint.vcf.idx" , emit: idx

script:
def gvcfs_line = all_gvcfs.collect { gvcf -> "-V ${gvcf}" }.join(' ')
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/hello-operators.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-config/final-main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-genomics/hello-genomics-2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-genomics/hello-genomics-3.nf
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-genomics/hello-genomics-4.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.vcf"
path "${input_bam}.vcf.idx"
path "${input_bam}.vcf" , emit: vcf
path "${input_bam}.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_JOINTGENOTYPING {
path ref_dict

output:
path "${cohort_name}.joint.vcf"
path "${cohort_name}.joint.vcf.idx"
path "${cohort_name}.joint.vcf" , emit: vcf
path "${cohort_name}.joint.vcf.idx", emit: idx

script:
def gvcfs_line = all_gvcfs.collect { gvcf -> "-V ${gvcf}" }.join(' ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process GATK_JOINTGENOTYPING {
path ref_dict

output:
path "${cohort_name}.joint.vcf"
path "${cohort_name}.joint.vcf.idx"
path "${cohort_name}.joint.vcf" , emit: vcf
path "${cohort_name}.joint.vcf.idx", emit: idx

script:
def gvcfs_line = all_gvcfs.collect { gvcf -> "-V ${gvcf}" }.join(' ')
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-operators/hello-operators-1.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-operators/hello-operators-2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
4 changes: 2 additions & 2 deletions hello-nextflow/solutions/hello-operators/hello-operators-3.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ process GATK_HAPLOTYPECALLER {
path interval_list

output:
path "${input_bam}.g.vcf"
path "${input_bam}.g.vcf.idx"
path "${input_bam}.g.vcf" , emit: vcf
path "${input_bam}.g.vcf.idx" , emit: idx

"""
gatk HaplotypeCaller \
Expand Down
Loading