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
7 changes: 7 additions & 0 deletions modules/nf-core/savana/classify/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::savana=1.3.7"
51 changes: 51 additions & 0 deletions modules/nf-core/savana/classify/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
process SAVANA_CLASSIFY {
tag "$meta.id"
label 'process_medium'

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

input:
tuple val(meta), path(vcf)

output:
tuple val(meta), path("${prefix}.classified.vcf") , emit: classified_vcf
tuple val(meta), path("${prefix}.classified.somatic.vcf") , emit: somatic_vcf , optional: true
tuple val(meta), path("${prefix}.classified.germline.vcf") , emit: germline_vcf , optional: true
tuple val(meta), path("${prefix}.classified.somatic.bedpe") , emit: somatic_bedpe , optional: true
tuple val(meta), path("${prefix}.classified.{strict,lenient}.vcf"), emit: legacy_vcfs , optional: true
tuple val("${task.process}"), val('savana'), eval("python -c \"import importlib.metadata as m; print(m.version('savana'))\""), emit: versions_savana, topic: versions

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

script:
def args = (task.ext.args ?: '').trim()
prefix = task.ext.prefix ?: "${meta.id}"
"""
vcf_in="${vcf}"
if [[ "${vcf}" == *.gz ]]; then
gunzip -c ${vcf} > ${prefix}.input.vcf
vcf_in="${prefix}.input.vcf"
fi

savana classify \\
--vcf \${vcf_in} \\
--output ${prefix}.classified.vcf \\
--somatic_output ${prefix}.classified.somatic.vcf \\
--threads ${task.cpus ?: 1} \\
${args}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.classified.vcf
touch ${prefix}.classified.somatic.vcf
touch ${prefix}.classified.somatic.bedpe
touch ${prefix}.classified.strict.vcf
touch ${prefix}.classified.lenient.vcf
"""
}
107 changes: 107 additions & 0 deletions modules/nf-core/savana/classify/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: "savana_classify"
description: "Classify structural variants using SAVANA"
keywords:
- classify
- structural variants
- somatic
- germline
- genomics
tools:
- "savana":
description: "SAVANA: a somatic structural variant caller for long-read data."
homepage: "https://github.com/cortes-ciriano-lab/savana"
documentation: "https://github.com/cortes-ciriano-lab/savana"
tool_dev_url: "https://github.com/cortes-ciriano-lab/savana"
doi: "10.1038/s41592-025-02708-0"
licence:
- "Apache-2.0"
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- vcf:
type: file
description: Input VCF file
pattern: "*{.vcf,vcf.gz}"
ontologies:
- edam: "http://edamontology.org/format_3016"
- edam: "http://edamontology.org/format_3615"
output:
classified_vcf:
- - meta:
type: map
description: Sample information
- ${prefix}.classified.vcf:
type: file
description: VCF containing information about variant classification in the INFO field
pattern: "*.classified.vcf"
ontologies:
- edam: "http://edamontology.org/format_3016" # VCF
somatic_vcf:
- - meta:
type: map
description: Sample information
- ${prefix}.classified.somatic.vcf:
type: file
description: VCF containing variants classified as somatic
pattern: "*.classified.somatic.vcf"
ontologies:
- edam: "http://edamontology.org/format_3016" # VCF
germline_vcf:
- - meta:
type: map
description: Sample information
- ${prefix}.classified.germline.vcf:
type: file
description: VCF containing variants classified as germline
pattern: "*.classified.germline.vcf"
ontologies:
- edam: "http://edamontology.org/format_3016" # VCF
somatic_bedpe:
- - meta:
type: map
description: Sample information
- ${prefix}.classified.somatic.bedpe:
type: file
description: Variants classified as somatic in BEDPE format
pattern: "*.classified.somatic.bedpe"
ontologies:
- edam: "http://edamontology.org/format_3003" # BED
legacy_vcfs:
- - meta:
type: map
description: Sample information
- ${prefix}.classified.{strict,lenient}.vcf:
type: file
description: Legacy strict/lenient VCFs
pattern: "*.classified.{strict,lenient}.vcf"
ontologies:
- edam: "http://edamontology.org/format_3016" # VCF
versions_savana:
- - ${task.process}:
type: string
description: Process name
- savana:
type: string
description: Name of the tool
- python -c "import importlib.metadata as m; print(m.version('savana'))":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: Process name
- savana:
type: string
description: Name of the tool
- python -c "import importlib.metadata as m; print(m.version('savana'))":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@manascripts"
maintainers:
- "@manascripts"
63 changes: 63 additions & 0 deletions modules/nf-core/savana/classify/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "savana"
tag "savana/classify"

test("homo_sapiens - vcf") {

when {
process {
"""

input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/savana/sv_breakpoints.vcf', checkIfExists: true),
]
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
path(process.out.classified_vcf.get(0).get(1)).vcf.summary,
path(process.out.classified_vcf.get(0).get(1)).vcf.variantsMD5,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

test("homo_sapiens - vcf - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/savana/sv_breakpoints.vcf', checkIfExists: true),
]
"""
}
}

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

}

}
123 changes: 123 additions & 0 deletions modules/nf-core/savana/classify/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"homo_sapiens - vcf": {
"content": [
"VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=29, phased=false, phasedAutodetect=false]",
"a03eb2d0fa6a379a43f9ff578fd21607",
{
"versions_savana": [
[
"SAVANA_CLASSIFY",
"savana",
"1.3.7"
]
]
}
],
"timestamp": "2026-05-21T13:56:51.450917438",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"homo_sapiens - vcf - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.classified.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.classified.somatic.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [

],
"3": [
[
{
"id": "test"
},
"test.classified.somatic.bedpe:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
[
{
"id": "test"
},
[
"test.classified.lenient.vcf:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.classified.strict.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"5": [
[
"SAVANA_CLASSIFY",
"savana",
"1.3.7"
]
],
"classified_vcf": [
[
{
"id": "test"
},
"test.classified.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"germline_vcf": [

],
"legacy_vcfs": [
[
{
"id": "test"
},
[
"test.classified.lenient.vcf:md5,d41d8cd98f00b204e9800998ecf8427e",
"test.classified.strict.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"somatic_bedpe": [
[
{
"id": "test"
},
"test.classified.somatic.bedpe:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"somatic_vcf": [
[
{
"id": "test"
},
"test.classified.somatic.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_savana": [
[
"SAVANA_CLASSIFY",
"savana",
"1.3.7"
]
]
}
],
"timestamp": "2026-05-21T13:57:00.059950477",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
}
}
Loading