Skip to content

Commit

Permalink
3630 add unstitched reads as emitted output of ngmerge (nf-core#3632)
Browse files Browse the repository at this point in the history
* add -f option

* update tests
  • Loading branch information
CharlotteAnne authored Jul 12, 2023
1 parent 30d06da commit 61aa491
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
9 changes: 6 additions & 3 deletions modules/nf-core/ngmerge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ process NGMERGE {
'biocontainers/ngmerge:0.3--ha92aebf_1' }"

input:
tuple val(meta), path(reads1), path(reads2)
tuple val(meta), path(reads)

output:
tuple val(meta), path("*.merged.fq.gz"), emit: merged_reads
tuple val(meta), path("*_1.fastq.gz") , emit: unstitched_read1
tuple val(meta), path("*_2.fastq.gz") , emit: unstitched_read2
path "versions.yml" , emit: versions

when:
Expand All @@ -23,9 +25,10 @@ process NGMERGE {

"""
NGmerge \\
-1 $reads1 \\
-2 $reads2 \\
-1 ${reads[0]} \\
-2 ${reads[1]} \\
-o ${prefix}.merged.fq.gz \\
-f ${prefix}_unstitched \\
-z \\
-n $task.cpus \\
$args
Expand Down
22 changes: 14 additions & 8 deletions modules/nf-core/ngmerge/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ input:
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- reads1:
- reads:
type: file
description: fastq file paired end read 1
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

- reads2:
type: file
description: fastq file paired end read 2
description: |
List of input FastQ files of size 2; i.e., paired-end data.
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

output:
Expand All @@ -46,7 +42,17 @@ output:

- merged_reads:
type: file
description: fastq file paired end read 2
description: fastq file merged reads
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

- unstitched_read1:
type: file
description: fastq file unstitched read 1
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

- unstitched_read2:
type: file
description: fastq file unstitched read 2
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

authors:
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/nf-core/ngmerge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ include { NGMERGE } from '../../../../modules/nf-core/ngmerge/main.nf'
workflow test_ngmerge {
input = [
[ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)],
[ file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)]
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)]
]

NGMERGE ( input )
Expand Down
2 changes: 2 additions & 0 deletions tests/modules/nf-core/ngmerge/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
- ngmerge
files:
- path: output/ngmerge/test.merged.fq.gz
- path: output/ngmerge/test_unstitched_1.fastq.gz
- path: output/ngmerge/test_unstitched_2.fastq.gz
- path: output/ngmerge/versions.yml

0 comments on commit 61aa491

Please sign in to comment.