Skip to content
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
10 changes: 10 additions & 0 deletions modules/nf-core/gatk4/analyzecovariates/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
# renovate: datasource=conda depName=bioconda/gatk4
- bioconda::gatk4=4.6.2.0
# renovate: datasource=conda depName=bioconda/gcnvkernel
- bioconda::gcnvkernel=0.9
44 changes: 44 additions & 0 deletions modules/nf-core/gatk4/analyzecovariates/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
process GATK4_ANALYZECOVARIATES {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/ce/ced519873646379e287bc28738bdf88e975edd39a92e7bc6a34bccd37153d9d0/data'
: 'community.wave.seqera.io/library/gatk4_gcnvkernel:edb12e4f0bf02cd3'}"

input:
tuple val(meta), path(before_table), path(after_table), path(additional_table)

output:
tuple val(meta), path("*.pdf"), emit: plots
tuple val(meta), path("*.csv"), emit: data
tuple val("${task.process}"), val('gatk4'), eval("gatk --version | sed -n '/GATK.*v/s/.*v//p'"), topic: versions, emit: versions_gatk4

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def third_table = additional_table ? "-bqsr ${additional_table}" : ""

"""
gatk AnalyzeCovariates \\
-before ${before_table} \\
-after ${after_table} \\
${third_table} \\
-csv ${meta.id}.csv \\
-plots ${meta.id}.pdf \\
${args}
"""

stub:
def args = task.ext.args ?: ''

"""
echo $args
touch ${meta.id}.csv
touch ${meta.id}.pdf
"""
}
92 changes: 92 additions & 0 deletions modules/nf-core/gatk4/analyzecovariates/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "gatk4_analyzecovariates"
description: Evaluate and compare base quality score recalibration (BQSR) tables
keywords:
- bqsr
- gatk4
- genomics
tools:
- gatk4:
description: |
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
doi: 10.1158/1538-7445.AM2017-3590
licence: ["Apache-2.0"]
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test' ]`
- before_table:
type: file
description: Base quality score recalibration (BQSR) table before
recalibration
pattern: "*.table"
ontologies: []
- after_table:
type: file
description: Base quality score recalibration (BQSR) table after
recalibration
pattern: "*.table"
ontologies: []
- additional_table:
type: file
description: An additional base quality score recalibration (BQSR) table
to be included in the comparison (optional)
pattern: "*.table"
ontologies: []
output:
plots:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test' ]`
- "*.pdf":
type: file
description: PDF file containing the plots generated by AnalyzeCovariates
pattern: "*.pdf"
ontologies:
- edam: "http://edamontology.org/format_3508" # PDF
data:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test' ]`
- "*.csv":
type: file
description: CSV file containing the data generated by AnalyzeCovariates
pattern: "*.csv"
ontologies:
- edam: "http://edamontology.org/format_3752" # CSV
versions_gatk4:
- - ${task.process}:
type: string
description: The name of the process
- gatk4:
type: string
description: The name of the tool
- gatk --version | sed -n '/GATK.*v/s/.*v//p':
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- gatk4:
type: string
description: The name of the tool
- gatk --version | sed -n '/GATK.*v/s/.*v//p':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@thomasisensee"
maintainers:
- "@thomasisensee"
101 changes: 101 additions & 0 deletions modules/nf-core/gatk4/analyzecovariates/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
nextflow_process {

name "Test Process GATK4_ANALYZECOVARIATES"
script "../main.nf"
process "GATK4_ANALYZECOVARIATES"

tag "modules"
tag "modules_nfcore"
tag "gatk4"
tag "gatk4/analyzecovariates"

test("homo_sapiens-dual-input - table") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.baserecalibrator.table', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table', checkIfExists: true),
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.data,
file(process.out.plots.get(0).get(1)).name,
process.out.versions_gatk4
).match()
}
)
}
}

test("homo_sapiens-triple-input - table") {

when {
process {
"""
def base = params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/'
def t1 = file(base + 'test.baserecalibrator.table', checkIfExists: true)
def t2 = file(base + 'test2.baserecalibrator.table', checkIfExists: true)

// Create a renamed copy for the duplicate input to avoid naming conflict
def t3 = file(base + 'test2.baserecalibrator.table').copyTo('test3.baserecalibrator.table')
input[0] = [
[ id:'test' ],
t1,
t2,
t3,
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.data,
file(process.out.plots.get(0).get(1)).name,
process.out.versions_gatk4
).match()
}
)
}
}

test("homo_sapiens - table - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.baserecalibrator.table', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table', checkIfExists: true),
[]
]
"""
}
}

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

}

}
109 changes: 109 additions & 0 deletions modules/nf-core/gatk4/analyzecovariates/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"homo_sapiens-triple-input - table": {
"content": [
[
[
{
"id": "test"
},
"test.csv:md5,41456202535403bf2616522b989a72e1"
]
],
"test.pdf",
[
[
"GATK4_ANALYZECOVARIATES",
"gatk4",
"4.6.2.0"
]
]
],
"timestamp": "2026-02-16T15:48:13.927449675",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"homo_sapiens-dual-input - table": {
"content": [
[
[
{
"id": "test"
},
"test.csv:md5,d0d1c72dbaf4fc5fed04a470a7b9a5c2"
]
],
"test.pdf",
[
[
"GATK4_ANALYZECOVARIATES",
"gatk4",
"4.6.2.0"
]
]
],
"timestamp": "2026-02-16T15:48:07.165637883",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"homo_sapiens - table - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.pdf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
"GATK4_ANALYZECOVARIATES",
"gatk4",
"4.6.2.0"
]
],
"data": [
[
{
"id": "test"
},
"test.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"plots": [
[
{
"id": "test"
},
"test.pdf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_gatk4": [
[
"GATK4_ANALYZECOVARIATES",
"gatk4",
"4.6.2.0"
]
]
}
],
"timestamp": "2026-02-16T15:48:18.617258625",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
}
}