added tests

This commit is contained in:
jvhagey 2022-05-02 11:30:19 -04:00
parent 218769d7df
commit 24dc2d2113
4 changed files with 54 additions and 8 deletions

View file

@ -11,8 +11,9 @@ process SRST2_SRST2 {
tuple val(meta), path(fastq_s), path(db)
output:
tuple val(meta), path("*_genes_*_results.txt") , emit: gene_results
tuple val(meta), path("*_genes_*_results.txt") , optional:true, emit: gene_results
tuple val(meta), path("*_fullgenes_*_results.txt") , optional:true, emit: fullgene_results
tuple val(meta), path("*_mlst_*_results.txt") , optional:true, emit: mlst_results
tuple val(meta), path("*.pileup") , emit: pileup
tuple val(meta), path("*.sorted.bam") , emit: sorted_bam
path "versions.yml" , emit: versions
@ -38,7 +39,6 @@ process SRST2_SRST2 {
--output ${prefix} \\
${database} \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
srst2: \$(echo \$(srst2 --version 2>&1) | sed 's/srst2 //' ))

View file

@ -49,12 +49,16 @@ output:
pattern: "versions.yml"
- txt:
type: file
description: A detailed report, with one row per gene per sample described here: https://github.com/katholt/srst2#gene-typing
description: A detailed report, with one row per gene per sample described here github.com/katholt/srst2#gene-typing
pattern: "*_fullgenes_*_results.txt"
- txt:
type: file
description: A tabulated summary report of samples x genes.
pattern: "*_genes_*_results.txt"
- txt:
type: file
description: A tabulated summary report of mlst subtyping.
pattern: "*_mlst_*_results.txt"
- bam:
type: file
description: Sorted BAM file

View file

@ -4,9 +4,34 @@ nextflow.enable.dsl = 2
include { SRST2_SRST2 } from '../../../../modules/srst2/srst2/main.nf'
workflow test_srst2_srst2_exit {
input = [
[ id:'test', single_end:false, db:"test"], // meta map
[ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true),
file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ],
// [("")]
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta')
]
SRST2_SRST2(input)
}
workflow test_srst2_srst2_mlst {
input = [
[ id:'test', single_end:false, db:"mlst"], // meta map
[ file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/SRR9067271_1.fastq.gz", checkIfExists: true),
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/SRR9067271_2.fastq.gz", checkIfExists: true) ],
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/MLST_DB.fas')
]
SRST2_SRST2(input)
}
workflow test_srst2_srst2_paired_end {
input = [
input = [
[ id:'test', single_end:false, db:"gene"], // meta map
[ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true),
file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ],
@ -18,11 +43,11 @@ workflow test_srst2_srst2_paired_end {
workflow test_srst2_srst2_single_end {
input = [
input = [
[ id:'test', single_end:true, db:"gene" ], // meta map
file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true),
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') // Change to params.test_data syntax after the data is included in tests/config/test_data.config
]
SRST2_SRST2(input)
}
}

View file

@ -1,8 +1,22 @@
- name: srst2 srst2 test_srst2_srst2_mlst
command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_mlst -c tests/config/nextflow.config
tags:
- srst2/srst2
- srst2
files:
- path: output/srst2/test__SRR9067271.MLST_DB.pileup
md5sum: f59217dd9340264b9913c20b545b2ce7
- path: output/srst2/test__SRR9067271.MLST_DB.sorted.bam
- path: output/srst2/test__mlst__MLST_DB__results.txt
md5sum: ec1b1f69933401d67c57f64cad11a098
- path: output/srst2/versions.yml
md5sum: a0c256a2fd3636069710b8ef22ee5ea7
- name: srst2 srst2 test_srst2_srst2_paired_end
command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_paired_end -c tests/config/nextflow.config
tags:
- srst2
- srst2/srst2
- srst2
files:
- path: output/srst2/test__genes__resFinder_20180221_srst2__results.txt
md5sum: 099aa6cacec5524b311f606debdfb3a9
@ -15,8 +29,8 @@
- name: srst2 srst2 test_srst2_srst2_single_end
command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_single_end -c tests/config/nextflow.config
tags:
- srst2
- srst2/srst2
- srst2
files:
- path: output/srst2/test__fullgenes__resFinder_20180221_srst2__results.txt
md5sum: d0762ef8c38afd0e0a34cce52ed1a3db
@ -27,3 +41,6 @@
- path: output/srst2/test__test1_1.resFinder_20180221_srst2.sorted.bam
- path: output/srst2/versions.yml
md5sum: 790fe00493c6634d17801a930073218b
- name: srst2 srst2 test_srst2_srst2_exit #Testing pipeline exit when not meta.db
exit_code: 1