forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nf-test for FASTQ_ALIGN_HISAT2 (nf-core#4887)
* nf-test for FASTQ_ALIGN_HISAT2 * nf-test for FASTQ_ALIGN_HISAT2 single-end * Apply suggestions from code review * update snapshots * update snapshot * do not snapshot bam * do not snapshot bam --------- Co-authored-by: Maxime U Garcia <[email protected]> Co-authored-by: Maxime U Garcia <[email protected]>
- Loading branch information
Showing
8 changed files
with
426 additions
and
118 deletions.
There are no files selected for viewing
128 changes: 128 additions & 0 deletions
128
subworkflows/nf-core/fastq_align_hisat2/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Subworkflow FASTQ_ALIGN_HISAT2" | ||
script "../main.nf" | ||
workflow "FASTQ_ALIGN_HISAT2" | ||
config "./nextflow.config" | ||
|
||
tag "subworkflows" | ||
tag "subworkflows_nfcore" | ||
tag "subworkflows/fastq_align_hisat2" | ||
|
||
tag "hisat2/align" | ||
tag "hisat2/build" | ||
tag "hisat2/extractsplicesites" | ||
|
||
tag "samtools/flagstat" | ||
tag "samtools/idxstats" | ||
tag "samtools/index" | ||
tag "samtools/sort" | ||
tag "samtools/stats" | ||
tag "subworkflows/bam_sort_stats_samtools" | ||
|
||
setup { | ||
run("HISAT2_EXTRACTSPLICESITES") { | ||
script "../../../../modules/nf-core/hisat2/extractsplicesites/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([ | ||
[id: 'test'], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) | ||
]) | ||
""" | ||
} | ||
} | ||
run("HISAT2_BUILD") { | ||
script "../../../../modules/nf-core/hisat2/build/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([ | ||
[id: 'test'], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) | ||
]) | ||
input[1] = Channel.of([ | ||
[id: 'test'], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) | ||
]) | ||
input[2] = HISAT2_EXTRACTSPLICESITES.out.txt | ||
""" | ||
} | ||
} | ||
} | ||
|
||
test("sarscov2 - bam - single_end") { | ||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = Channel.of([ | ||
[ id:'test', single_end:true ], | ||
[ | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) | ||
] | ||
]) | ||
input[1] = HISAT2_BUILD.out.index | ||
input[2] = HISAT2_EXTRACTSPLICESITES.out.txt | ||
input[3] = Channel.of([ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot(file(workflow.out.bai[0][1]).name).match("se - bai")}, | ||
{ assert snapshot(file(workflow.out.bam[0][1]).name).match("se - bam")}, | ||
{ assert snapshot(file(workflow.out.orig_bam[0][1]).name).match("se - orig_bam")}, | ||
{ assert snapshot(workflow.out.csi).match("se - csi")}, | ||
{ assert snapshot(workflow.out.fastq).match("se - fastq")}, | ||
{ assert snapshot(workflow.out.flagstat).match("se - flagstat")}, | ||
{ assert snapshot(workflow.out.idxstats).match("se - idxstats")}, | ||
{ assert snapshot(workflow.out.stats).match("se - stats")}, | ||
{ assert snapshot(workflow.out.summary).match("se - summary")}, | ||
{ assert snapshot(workflow.out.versions).match("se - versions")} | ||
) | ||
} | ||
} | ||
test("sarscov2 - bam - paired_end") { | ||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = Channel.of([ | ||
[ id:'test', single_end:false ], | ||
[ | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true) | ||
] | ||
]) | ||
input[1] = HISAT2_BUILD.out.index | ||
input[2] = HISAT2_EXTRACTSPLICESITES.out.txt | ||
input[3] = Channel.of([ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true) | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot(file(workflow.out.bai[0][1]).name).match("pe - bai")}, | ||
{ assert snapshot(file(workflow.out.bam[0][1]).name).match("pe - bam")}, | ||
{ assert snapshot(file(workflow.out.orig_bam[0][1]).name).match("pe - orig_bam")}, | ||
{ assert snapshot(workflow.out.csi).match("pe - csi")}, | ||
{ assert snapshot(workflow.out.fastq).match("pe - fastq")}, | ||
{ assert snapshot(workflow.out.flagstat).match("pe - flagstat")}, | ||
{ assert snapshot(workflow.out.idxstats).match("pe - idxstats")}, | ||
{ assert snapshot(workflow.out.stats).match("pe - stats")}, | ||
{ assert snapshot(workflow.out.summary).match("pe - summary")}, | ||
{ assert snapshot(workflow.out.versions).match("pe - versions")} | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.