diff --git a/modules/cat/fastq/main.nf b/modules/cat/fastq/main.nf index 55ccca90..712364e1 100644 --- a/modules/cat/fastq/main.nf +++ b/modules/cat/fastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,6 +23,7 @@ process CAT_FASTQ { output: tuple val(meta), path("*.merged.fastq.gz"), emit: reads + path "versions.yml" , emit: version script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" @@ -31,6 +32,11 @@ process CAT_FASTQ { if (readList.size > 1) { """ cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } else { @@ -41,6 +47,11 @@ process CAT_FASTQ { """ cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } diff --git a/modules/flash/main.nf b/modules/flash/main.nf index 8b8d99e4..f9a381e9 100644 --- a/modules/flash/main.nf +++ b/modules/flash/main.nf @@ -21,23 +21,23 @@ process FLASH { tuple val(meta), path(reads) output: - tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads - path "versions.yml" , emit: version + tuple val(meta), path("*.fastq.gz"), emit: reads + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def merged = "-o ${prefix}.merged" - def input_reads = "${reads[0]} ${reads[1]}" """ flash \\ $options.args \\ - $merged \\ + -o ${prefix} \\ -z \\ - $input_reads + ${reads[0]} \\ + ${reads[1]} + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(flash --version) + ${getSoftwareName(task.process)}: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//') END_VERSIONS """ } diff --git a/tests/modules/cat/fastq/main.nf b/tests/modules/cat/fastq/main.nf index de11bcf2..027bd108 100644 --- a/tests/modules/cat/fastq/main.nf +++ b/tests/modules/cat/fastq/main.nf @@ -2,24 +2,26 @@ nextflow.enable.dsl = 2 -include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [:] ) +include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [publish_dir:'cat'] ) workflow test_cat_fastq_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] + ] CAT_FASTQ ( input ) } workflow test_cat_fastq_paired_end { - 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']['test2_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] - ] + 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']['test2_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] + ] CAT_FASTQ ( input ) } diff --git a/tests/modules/cat/fastq/test.yml b/tests/modules/cat/fastq/test.yml index 3a23d309..9a5af25c 100644 --- a/tests/modules/cat/fastq/test.yml +++ b/tests/modules/cat/fastq/test.yml @@ -4,7 +4,7 @@ - cat - cat/fastq files: - - path: ./output/merged_fastq/test.merged.fastq.gz + - path: ./output/cat/test.merged.fastq.gz md5sum: 59f6dbe193741bb40f498f254aeb2e99 - name: cat fastq fastqc_paired_end @@ -13,7 +13,7 @@ - cat - cat/fastq files: - - path: ./output/merged_fastq/test_2.merged.fastq.gz + - path: ./output/cat/test_2.merged.fastq.gz md5sum: d2b1a836eef1058738ecab36c907c5ba - - path: ./output/merged_fastq/test_1.merged.fastq.gz + - path: ./output/cat/test_1.merged.fastq.gz md5sum: 59f6dbe193741bb40f498f254aeb2e99 diff --git a/tests/modules/flash/main.nf b/tests/modules/flash/main.nf index e0f5e623..2128650d 100644 --- a/tests/modules/flash/main.nf +++ b/tests/modules/flash/main.nf @@ -5,10 +5,11 @@ nextflow.enable.dsl = 2 include { FLASH } from '../../../modules/flash/main.nf' addParams( options: [args:'-m 20 -M 100'] ) workflow test_flash { - 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) ] - ] + 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) ] + ] FLASH ( input ) } diff --git a/tests/modules/flash/test.yml b/tests/modules/flash/test.yml index 61ea9eab..31cdaeff 100644 --- a/tests/modules/flash/test.yml +++ b/tests/modules/flash/test.yml @@ -3,9 +3,6 @@ tags: - flash files: - - path: output/flash/test.merged.notCombined_2.fastq.gz - md5sum: 96ec044281fe60e0061976d928810314 - - path: output/flash/test.merged.extendedFrags.fastq.gz - md5sum: da20afa705e8ea881e66960bb75607c9 - - path: output/flash/test.merged.notCombined_1.fastq.gz - md5sum: 32451c87f89172c764bec19136592d29 + - path: output/flash/test.notCombined_2.fastq.gz + - path: output/flash/test.extendedFrags.fastq.gz + - path: output/flash/test.notCombined_1.fastq.gz