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 3 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
"""
}
91 changes: 51 additions & 40 deletions modules/nf-core/gatk4/condensedepthevidence/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,61 @@ tools:
tool_dev_url: "https://github.com/broadinstitute/gatk"
doi: "10.1158/1538-7445.AM2017-3590"
licence: ["BSD-3-clause"]
identifier: ""
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- depth_evidence:
type: file
description: The depth evidence file
pattern: "*.rd.txt.gz"
- depth_evidence_index:
type: file
description: The index of the depth evidence file
pattern: "*.rd.txt.gz.tbi"
- fasta:
type: file
description: Reference FASTA file needed when the input is a CRAM file
pattern: "*.{fasta,fa}"
- fasta_fai:
type: file
description: Index of the reference FASTA file needed when the input is a CRAM file
pattern: "*.fai"
- dict:
type: file
description: Sequence dictionary of the reference FASTA file needed when the input is a CRAM file
pattern: "*.dict"
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- depth_evidence:
type: file
description: The depth evidence file
pattern: "*.rd.txt.gz"
- depth_evidence_index:
type: file
description: The index of the depth evidence file
pattern: "*.rd.txt.gz.tbi"
- - fasta:
type: file
description: Reference FASTA file needed when the input is a CRAM file
pattern: "*.{fasta,fa}"
- - fasta_fai:
type: file
description: Index of the reference FASTA file needed when the input is a CRAM
file
pattern: "*.fai"
- - dict:
type: file
description: Sequence dictionary of the reference FASTA file needed when the
input is a CRAM file
pattern: "*.dict"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- condensed_evidence:
type: file
description: The condensed depth evidence
pattern: "*.rd.txt.gz"
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.rd.txt.gz":
type: file
description: The condensed depth evidence
pattern: "*.rd.txt.gz"
- condensed_evidence_index:
type: file
description: The condensed depth evidence
pattern: "*.rd.txt.gz.tbi"
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.rd.txt.gz.tbi":
type: file
description: The condensed depth evidence
pattern: "*.rd.txt.gz.tbi"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@nvnieuwk"
maintainers:
Expand Down
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
"""
}
50 changes: 29 additions & 21 deletions modules/nf-core/gatk4/fastqtosam/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,44 @@ keywords:
- gatk4
tools:
- gatk4:
description: Genome Analysis Toolkit (GATK4) Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping. Its powerful processing engine and high-performance computing features make it capable of taking on projects of any size.
description: Genome Analysis Toolkit (GATK4) Developed in the Data Sciences Platform
at the Broad Institute, the toolkit offers a wide variety of tools with a primary
focus on variant discovery and genotyping. Its powerful processing engine and
high-performance computing features make it capable of taking on projects of
any size.
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
tool_dev_url: https://github.com/broadinstitute/gatk
doi: "10.1158/1538-7445.AM2017-3590"
licence: ["MIT"]
identifier: ""
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively.
pattern: "*.fastq.gz"
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: List of input FastQ files of size 1 and 2 for single-end and paired-end
data, respectively.
pattern: "*.fastq.gz"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: Converted BAM file
pattern: "*.bam"
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.bam":
type: file
description: Converted BAM file
pattern: "*.bam"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@ntoda03"
maintainers:
Expand Down
24 changes: 23 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,27 @@ 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()
}
famosab marked this conversation as resolved.
Show resolved Hide resolved
)
}
}

}
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
"""
}
Loading
Loading