Skip to content

Commit

Permalink
add more stubs gatk4 (#6673)
Browse files Browse the repository at this point in the history
* add stubs

* run lint --fix

* fix formatting
  • Loading branch information
famosab authored Sep 25, 2024
1 parent 6b3bf38 commit 679f45c
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 1 deletion.
12 changes: 12 additions & 0 deletions modules/nf-core/gatk4/condensedepthevidence/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ process GATK4_CONDENSEDEPTHEVIDENCE {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "" | gzip > ${prefix}.rd.txt.gz
touch ${prefix}.rd.txt.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}
29 changes: 29 additions & 0 deletions modules/nf-core/gatk4/condensedepthevidence/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,33 @@ nextflow_process {
}
}

test("test-gatk4-condensdepthevidence - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/condensedepthevidence/testN.rd.txt.gz", checkIfExists: true),
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/condensedepthevidence/testN.rd.txt.gz.tbi", checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
"""
}
}

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

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
{
"test-gatk4-condensdepthevidence - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.rd.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.rd.txt.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,d1d29007b92a10b3e50bdd25335013a8"
],
"condensed_evidence": [
[
{
"id": "test",
"single_end": false
},
"test.rd.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"condensed_evidence_index": [
[
{
"id": "test",
"single_end": false
},
"test.rd.txt.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,d1d29007b92a10b3e50bdd25335013a8"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-20T10:42:07.848497"
},
"test-gatk4-condensdepthevidence": {
"content": [
[
Expand Down
11 changes: 11 additions & 0 deletions modules/nf-core/gatk4/fastqtosam/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ process GATK4_FASTQTOSAM {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}
23 changes: 22 additions & 1 deletion modules/nf-core/gatk4/fastqtosam/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ nextflow_process {
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)
]
"""
}
}
Expand All @@ -61,4 +60,26 @@ nextflow_process {
}
}

test("test-gatk4-fastqtosam-single-end - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [ id:'test', 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() }
)
}
}

}
35 changes: 35 additions & 0 deletions modules/nf-core/gatk4/fastqtosam/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
{
"test-gatk4-fastqtosam-single-end - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,ac3f2cf1b686e56d72f1dd4a5977f7ab"
],
"bam": [
[
{
"id": "test",
"single_end": true
},
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,ac3f2cf1b686e56d72f1dd4a5977f7ab"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-20T10:43:37.316141"
},
"test-gatk4-fastqtosam-single-end": {
"content": [
"e6a4aa204d980e177a0458596f0a70ac",
Expand Down
11 changes: 11 additions & 0 deletions modules/nf-core/gatk4/gatherpileupsummaries/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,15 @@ process GATK4_GATHERPILEUPSUMMARIES {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.pileups.table
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}
25 changes: 25 additions & 0 deletions modules/nf-core/gatk4/gatherpileupsummaries/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,29 @@ nextflow_process {
}
}

test("test-gatk4-gatherpileupsummaries - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.pileups.table', checkIfExists: true) ]
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true)
"""
}
}

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

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
{
"test-gatk4-gatherpileupsummaries - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.out.pileups.table:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,d3772ab0d5963a88a2748fd83af76c02"
],
"table": [
[
{
"id": "test",
"single_end": false
},
"test.out.pileups.table:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,d3772ab0d5963a88a2748fd83af76c02"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-20T10:44:42.759098"
},
"test-gatk4-gatherpileupsummaries": {
"content": [
{
Expand Down

0 comments on commit 679f45c

Please sign in to comment.