Skip to content
Open
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
20 changes: 15 additions & 5 deletions modules/nf-core/caddsv/get/main.nf
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
process CADDSV_GET {
tag 'CADDSV annotations'
tag "CADDSV ${flag}"
label 'process_single'
label 'process_long'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/caddsv:2.0--pyh84cbfca_0':
'quay.io/biocontainers/caddsv:2.0--pyh84cbfca_0' }"

input:
val flag

output:
path "caddsv_annotations", emit: annotations
tuple val("${task.process}"), val('caddsv'), eval("python -c \"import importlib.metadata as m; print(m.version('caddsv'))\""), emit: versions_caddsv, topic: versions
Expand All @@ -16,17 +20,23 @@ process CADDSV_GET {

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

if (!['annotations', 'segmentnt'].contains(flag)) {
error "Invalid caddsv get flag: '${flag}'. Expected 'annotations' or 'segmentnt'."
}

"""
caddsv get \\
set -euo pipefail

caddsv get ${flag} \\
--annotations-dir "caddsv_annotations" \\
${args}

test -d caddsv_annotations
"""

stub:
def args = task.ext.args ?: ''
"""
echo $args

mkdir -p caddsv_annotations
touch caddsv_annotations/stub.txt
"""
Expand Down
23 changes: 18 additions & 5 deletions modules/nf-core/caddsv/get/meta.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "caddsv_get"
description: Download CADD-SV annotation resources and, optionally, SegmentNT model files.
description: Download CADD-SV annotation resources or SegmentNT model files.
keywords:
- caddsv
- structural variants
- annotations
- segmentnt
- resource download

tools:
- "caddsv":
description: "CADD-SV is a command-line tool for scoring structural variants (SVs)"
Expand All @@ -17,16 +19,26 @@ tools:
- "MIT"
identifier: "biotools:cadd-sv"

input: []
input:
- flag:
type: string
description: >
CADD-SV resource flag to download. Use `annotations` to download the
CADD-SV annotation bundle, or `segmentnt` to download only the SegmentNT
model files into `<annotations-dir>/segment_nt`.
pattern: "annotations|segmentnt"
ontologies: []

output:
annotations:
- caddsv_annotations:
type: directory
description: >
Directory containing downloaded CADD-SV annotations. If `--with-segmentnt`
is supplied via `task.ext.args`, this directory will also contain the SegmentNT model
files under `segment_nt/`.
Directory containing downloaded CADD-SV resources. If `flag` is
`annotations`, this contains the CADD-SV annotation bundle. If
`flag` is `segmentnt`, this contains SegmentNT files under
`segment_nt/`. If `flag` is `annotations` and `--with-segmentnt`
is supplied via `task.ext.args`, this contains both resources.
pattern: "caddsv_annotations"
ontologies: []

Expand Down Expand Up @@ -55,5 +67,6 @@ topics:

authors:
- "@manascripts"

maintainers:
- "@manascripts"
30 changes: 28 additions & 2 deletions modules/nf-core/caddsv/get/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,43 @@ nextflow_process {
tag "caddsv"
tag "caddsv/get"

test("caddsv-get - stub") {
test("caddsv-get annotations - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.value('annotations')
"""
}
}

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

}

test("caddsv-get segmentnt - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.value('segmentnt')
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
}
27 changes: 25 additions & 2 deletions modules/nf-core/caddsv/get/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"caddsv-get - stub": {
"caddsv-get annotations - stub": {
"content": [
{
"annotations": [
Expand All @@ -16,7 +16,30 @@
]
}
],
"timestamp": "2026-06-10T13:47:54.858373568",
"timestamp": "2026-06-23T16:33:17.869563355",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"caddsv-get segmentnt - stub": {
"content": [
{
"annotations": [
[
"stub.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_caddsv": [
[
"CADDSV_GET",
"caddsv",
"2.0"
]
]
}
],
"timestamp": "2026-06-23T16:33:23.758487333",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
Expand Down