Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stubs and test for rnaseq modules - part V #6009

Merged
merged 30 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
92b3af8
proper stub tests
maxulysse Jul 22, 2024
47df0a4
proper stub tests for qualimap/*
maxulysse Jul 22, 2024
2c045d9
Merge branch 'master' into stubs_rnaseq_ix
maxulysse Jul 22, 2024
45afdf8
proper stub tests for picard/markduplicates
maxulysse Jul 22, 2024
bfd9dcf
proper stub tests for ucsc/bedgraphtobigwig
maxulysse Jul 22, 2024
2594b05
stub test should use options -stub
maxulysse Jul 22, 2024
3a15de8
better snapshot
maxulysse Jul 22, 2024
cd158c8
no need for config
maxulysse Jul 22, 2024
d55bea1
better snapshot + stub tests
maxulysse Jul 22, 2024
b07ed16
better snapshot for star/align star/genomegenerate
maxulysse Jul 22, 2024
dea235f
actually do stub
maxulysse Jul 22, 2024
848f3b3
update from comments
maxulysse Jul 22, 2024
9aa1354
proper stub + update snap
maxulysse Jul 22, 2024
2369a4c
stub test for samtools/flagstat
maxulysse Jul 22, 2024
2a79e86
stub test for samtools/stats
maxulysse Jul 22, 2024
210bc9b
proper stub and tests for samtools/sort
maxulysse Jul 22, 2024
a7cfdf8
better stub
maxulysse Jul 22, 2024
8b8d0bc
proper stub and tests for samtools/index
maxulysse Jul 22, 2024
4770d2a
Merge branch 'master' into stubs_rnaseq_ix
maxulysse Jul 22, 2024
86649ff
works better with the config file
maxulysse Jul 22, 2024
9c2c690
no snap for csi
maxulysse Jul 22, 2024
db7bb80
fix snap
maxulysse Jul 22, 2024
a42550d
update tests and snap
maxulysse Jul 22, 2024
0b8f549
update snap
maxulysse Jul 22, 2024
338b876
update snpashots
maxulysse Jul 22, 2024
65a475e
update tests and snap
maxulysse Jul 22, 2024
c43fce5
Merge branch 'master' into stubs_rnaseq_ix
maxulysse Jul 22, 2024
fcc1004
update snap
maxulysse Jul 22, 2024
640b851
update tests and snap
maxulysse Jul 22, 2024
af03505
Update main.nf.test.snap
maxulysse Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 161 additions & 64 deletions modules/nf-core/fastqc/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

// NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it.
// looks like this: <div id="header_filename">Mon 2 Oct 2023<br/>test.gz</div>
// https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039

{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_single") }
{ assert process.success },
// NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it.
// looks like this: <div id="header_filename">Mon 2 Oct 2023<br/>test.gz</div>
// https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039
{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}
Expand All @@ -54,16 +51,14 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

{ assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" },
{ assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" },
{ assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" },
{ assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" },
{ assert path(process.out.html[0][1][0]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_paired") }
{ assert process.success },
{ assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" },
{ assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" },
{ assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" },
{ assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" },
{ assert path(process.out.html[0][1][0]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}
Expand All @@ -83,13 +78,11 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_interleaved") }
{ assert process.success },
{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}
Expand All @@ -109,13 +102,11 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_bam") }
{ assert process.success },
{ assert process.out.html[0][1] ==~ ".*/test_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}
Expand All @@ -138,22 +129,20 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

{ assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" },
{ assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" },
{ assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" },
{ assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" },
{ assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" },
{ assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" },
{ assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" },
{ assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" },
{ assert path(process.out.html[0][1][0]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][2]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][3]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_multiple") }
{ assert process.success },
{ assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" },
{ assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" },
{ assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" },
{ assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" },
{ assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" },
{ assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" },
{ assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" },
{ assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" },
{ assert path(process.out.html[0][1][0]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][2]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert path(process.out.html[0][1][3]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}
Expand All @@ -173,21 +162,18 @@ nextflow_process {

then {
assertAll (
{ assert process.success },

{ assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },

{ assert snapshot(process.out.versions).match("fastqc_versions_custom_prefix") }
{ assert process.success },
{ assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" },
{ assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" },
{ assert path(process.out.html[0][1]).text.contains("<tr><td>File type</td><td>Conventional base calls</td></tr>") },
{ assert snapshot(process.out.versions).match() }
)
}
}

test("sarscov2 single-end [fastq] - stub") {

options "-stub"

options "-stub"
when {
process {
"""
Expand All @@ -201,12 +187,123 @@ nextflow_process {

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out.html.collect { file(it[1]).getName() } +
process.out.zip.collect { file(it[1]).getName() } +
process.out.versions ).match("fastqc_stub") }
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2 paired-end [fastq] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
[ 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) ]
])
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2 interleaved [fastq] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true)
])
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2 paired-end [bam] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
])
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2 multiple [fastq] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
[ 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),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true) ]
])
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2 custom_prefix - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[ id:'mysample', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
])
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
Loading
Loading