Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding input value-channel for controlling spring-decompress cmd and output #5850

Merged
merged 9 commits into from
Jun 23, 2024
3 changes: 2 additions & 1 deletion modules/nf-core/spring/decompress/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process SPRING_DECOMPRESS {

input:
tuple val(meta), path(spring)
val(write_one_fastq_gz)

output:
tuple val(meta), path("*.fastq.gz"), emit: fastq
Expand All @@ -21,7 +22,7 @@ process SPRING_DECOMPRESS {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def output = meta.single_end ? "-o ${prefix}.fastq.gz" : "-o ${prefix}_R1.fastq.gz ${prefix}_R2.fastq.gz"
def output = write_one_fastq_gz ? "-o ${prefix}.fastq.gz" : "-o ${prefix}_R1.fastq.gz ${prefix}_R2.fastq.gz"

"""
spring \\
Expand Down
4 changes: 4 additions & 0 deletions modules/nf-core/spring/decompress/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ input:
type: file
description: Spring file to decompress.
pattern: "*.{spring}"
- write_one_fastq_gz:
type: boolean
description: Controls whether spring should write one fastq.gz file with reads from both directionbs or two fastq.gz files with reads from distinct directions
asp8200 marked this conversation as resolved.
Show resolved Hide resolved
pattern: "true or false"
output:
- meta:
type: map
Expand Down
8 changes: 4 additions & 4 deletions tests/modules/nf-core/spring/decompress/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ include { SPRING_DECOMPRESS } from '../../../../../modules/nf-core/spring/decomp
workflow test_spring_decompress_single_end {

input = [
[ id:'test', single_end:true ], // meta map
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
[]
]

SPRING_COMPRESS ( input )
SPRING_DECOMPRESS ( SPRING_COMPRESS.out.spring )
SPRING_DECOMPRESS ( SPRING_COMPRESS.out.spring, true )
}

workflow test_spring_decompress_paired_end {

input = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ], // 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)
]

SPRING_COMPRESS ( input )
SPRING_DECOMPRESS ( SPRING_COMPRESS.out.spring )
SPRING_DECOMPRESS ( SPRING_COMPRESS.out.spring, false )
}
Loading