From 5033ada17bc4f10fffbfefe980a3ebf9002ebcff Mon Sep 17 00:00:00 2001 From: Ram Sai Nanduri Date: Tue, 25 Jul 2023 12:04:11 +0200 Subject: [PATCH] Update stubs for samtools idxstats (#3665) * Update stubs * Update stubs for samtools idxstats --------- Co-authored-by: Ram Nanduri --- modules/nf-core/samtools/idxstats/main.nf | 12 ++++++++++++ tests/modules/nf-core/samtools/idxstats/main.nf | 15 ++++++++++++--- tests/modules/nf-core/samtools/idxstats/test.yml | 9 +++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/samtools/idxstats/main.nf b/modules/nf-core/samtools/idxstats/main.nf index a257d7002e4..83c7c34b9d9 100644 --- a/modules/nf-core/samtools/idxstats/main.nf +++ b/modules/nf-core/samtools/idxstats/main.nf @@ -33,4 +33,16 @@ process SAMTOOLS_IDXSTATS { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.idxstats + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/tests/modules/nf-core/samtools/idxstats/main.nf b/tests/modules/nf-core/samtools/idxstats/main.nf index 4a29252eb3b..9a0f5aec23c 100644 --- a/tests/modules/nf-core/samtools/idxstats/main.nf +++ b/tests/modules/nf-core/samtools/idxstats/main.nf @@ -6,9 +6,18 @@ include { SAMTOOLS_IDXSTATS } from '../../../../../modules/nf-core/samtools/idxs workflow test_samtools_idxstats { input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) - ] + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + + SAMTOOLS_IDXSTATS ( input ) +} + +workflow test_samtools_idxstats_stub { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] SAMTOOLS_IDXSTATS ( input ) } diff --git a/tests/modules/nf-core/samtools/idxstats/test.yml b/tests/modules/nf-core/samtools/idxstats/test.yml index d2c6f94d2ab..f2be79899fc 100644 --- a/tests/modules/nf-core/samtools/idxstats/test.yml +++ b/tests/modules/nf-core/samtools/idxstats/test.yml @@ -7,3 +7,12 @@ - path: output/samtools/test.idxstats md5sum: df60a8c8d6621100d05178c93fb053a2 - path: output/samtools/versions.yml + +- name: samtools idxstats test_samtools_idxstats_stub + command: nextflow run ./tests/modules/nf-core/samtools/idxstats -entry test_samtools_idxstats_stub -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/samtools/idxstats/nextflow.config -stub + tags: + - samtools/idxstats + - samtools + files: + - path: output/samtools/test.idxstats + - path: output/samtools/versions.yml