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

add more stubs gatk4 #6673

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading