Skip to content

Commit

Permalink
Update stubs for samtools flagstat (nf-core#3657)
Browse files Browse the repository at this point in the history
Update stubs

Co-authored-by: Ram Nanduri <ram@MTLUCMDS1.lund.skane.se>
  • Loading branch information
2 people authored and limrp committed Jul 28, 2023
1 parent 2347ffa commit 5281289
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/nf-core/samtools/flagstat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,15 @@ process SAMTOOLS_FLAGSTAT {
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.flagstat
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}
11 changes: 11 additions & 0 deletions tests/modules/nf-core/samtools/flagstat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ workflow test_samtools_flagstat {

SAMTOOLS_FLAGSTAT ( input )
}


workflow test_samtools_flagstat_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_FLAGSTAT ( input )
}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/samtools/flagstat/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
- path: output/samtools/test.flagstat
md5sum: 4f7ffd1e6a5e85524d443209ac97d783
- path: output/samtools/versions.yml

- name: samtools faidx test_samtools_flagstat_stub
command: nextflow run ./tests/modules/nf-core/samtools/flagstat -entry test_samtools_flagstat_stub -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/samtools/flagstat/nextflow.config -stub
tags:
- samtools/flagstat
- samtools
files:
- path: output/samtools/test.flagstat
- path: output/samtools/versions.yml

0 comments on commit 5281289

Please sign in to comment.