From 64f182a846106747b72ca79ef499b4336c40f9a1 Mon Sep 17 00:00:00 2001 From: manascripts Date: Wed, 6 May 2026 13:36:41 +0200 Subject: [PATCH 1/6] Add octopusv/merge module files --- .../nf-core/octopusv/correct/environment.yml | 7 ++ modules/nf-core/octopusv/correct/main.nf | 40 +++++++++++ modules/nf-core/octopusv/correct/meta.yml | 67 +++++++++++++++++++ .../octopusv/correct/tests/main.nf.test | 61 +++++++++++++++++ 4 files changed, 175 insertions(+) create mode 100644 modules/nf-core/octopusv/correct/environment.yml create mode 100644 modules/nf-core/octopusv/correct/main.nf create mode 100644 modules/nf-core/octopusv/correct/meta.yml create mode 100644 modules/nf-core/octopusv/correct/tests/main.nf.test diff --git a/modules/nf-core/octopusv/correct/environment.yml b/modules/nf-core/octopusv/correct/environment.yml new file mode 100644 index 00000000000..583655a9621 --- /dev/null +++ b/modules/nf-core/octopusv/correct/environment.yml @@ -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::octopusv=0.3.2" diff --git a/modules/nf-core/octopusv/correct/main.nf b/modules/nf-core/octopusv/correct/main.nf new file mode 100644 index 00000000000..164bb158b12 --- /dev/null +++ b/modules/nf-core/octopusv/correct/main.nf @@ -0,0 +1,40 @@ +process OCTOPUSV_CORRECT { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/octopusv:0.3.2--pyhdfd78af_0' : + 'quay.io/biocontainers/octopusv:0.3.2--pyhdfd78af_0' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.svcf"), emit: svcf + tuple val("${task.process}"), val('octopusv'), eval("octopusv --version"), emit: versions_octopusv, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + octopusv correct \\ + -i ${vcf} \\ + -o ${prefix}.svcf \\ + $args + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + echo $args + + touch ${prefix}.svcf + """ +} diff --git a/modules/nf-core/octopusv/correct/meta.yml b/modules/nf-core/octopusv/correct/meta.yml new file mode 100644 index 00000000000..b9c4fa043bb --- /dev/null +++ b/modules/nf-core/octopusv/correct/meta.yml @@ -0,0 +1,67 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "octopusv_correct" +description: "Standardize a caller VCF into OctopuSV SVCF format." +keywords: + - structural + - variant + - sv + - svcf + - normalize +tools: + - "octopusv": + description: "End-to-end structural variant post-processing: standardize, merge, compare, and export SVs." + homepage: "https://github.com/ylab-hi/OctopuSV" + documentation: "https://github.com/ylab-hi/OctopuSV" + tool_dev_url: "https://github.com/ylab-hi/OctopuSV" + doi: "10.1093/bioinformatics/btaf599" + licence: ["MIT"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - vcf: + type: file + description: Structural variant calls in VCF format + pattern: "*.{vcf,vcf.gz}" + ontologies: + - edam: "http://edamontology.org/format_3016" # VCF +output: + svcf: + - - meta: + type: map + description: | + Groovy Map containing sample information + - "*.svcf": + type: file + description: Standardized SVCF file + pattern: "*.svcf" + ontologies: + - edam: "https://github.com/ylab-hi/OctopuSV/blob/main/docs/SVCF_specifications.md" # SVCF + versions_octopusv: + - - ${task.process}: + type: string + description: The name of the process + - octopusv: + type: string + description: The name of the tool + - octopusv --version: + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - octopusv: + type: string + description: The name of the tool + - octopusv --version: + type: eval + description: The expression to obtain the version of the tool +authors: + - "@manascripts" +maintainers: + - "@manascripts" diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test b/modules/nf-core/octopusv/correct/tests/main.nf.test new file mode 100644 index 00000000000..9869ffa5c05 --- /dev/null +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test @@ -0,0 +1,61 @@ +nextflow_process { + + name "Test Process OCTOPUSV_CORRECT" + script "../main.nf" + process "OCTOPUSV_CORRECT" + + tag "modules" + tag "modules_nfcore" + tag "octopusv" + tag "octopusv/correct" + + test("homo_sapiens - vcf") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + '.../data/genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.svcf.get(0).get(1)).name, + 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 + '.../data/genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + +} From 9ffa9d2c056344aa4bffd03eca9b2cff9f3d90c2 Mon Sep 17 00:00:00 2001 From: manascripts Date: Wed, 6 May 2026 15:45:23 +0200 Subject: [PATCH 2/6] Add tests and snap --- modules/nf-core/octopusv/correct/main.nf | 4 ++- modules/nf-core/octopusv/correct/meta.yml | 2 +- .../octopusv/correct/tests/main.nf.test | 27 +----------------- .../octopusv/correct/tests/main.nf.test.snap | 28 +++++++++++++++++++ 4 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 modules/nf-core/octopusv/correct/tests/main.nf.test.snap diff --git a/modules/nf-core/octopusv/correct/main.nf b/modules/nf-core/octopusv/correct/main.nf index 164bb158b12..0b196d94fbe 100644 --- a/modules/nf-core/octopusv/correct/main.nf +++ b/modules/nf-core/octopusv/correct/main.nf @@ -12,7 +12,9 @@ process OCTOPUSV_CORRECT { output: tuple val(meta), path("*.svcf"), emit: svcf - tuple val("${task.process}"), val('octopusv'), eval("octopusv --version"), emit: versions_octopusv, topic: versions + tuple val("${task.process}"), val('octopusv'), + eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), + emit: versions_octopusv, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/octopusv/correct/meta.yml b/modules/nf-core/octopusv/correct/meta.yml index b9c4fa043bb..2d59e31ccb2 100644 --- a/modules/nf-core/octopusv/correct/meta.yml +++ b/modules/nf-core/octopusv/correct/meta.yml @@ -58,7 +58,7 @@ topics: - octopusv: type: string description: The name of the tool - - octopusv --version: + - python -c "import importlib.metadata as m; print(m.version('octopusv'))": type: eval description: The expression to obtain the version of the tool authors: diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test b/modules/nf-core/octopusv/correct/tests/main.nf.test index 9869ffa5c05..b8a25a73091 100644 --- a/modules/nf-core/octopusv/correct/tests/main.nf.test +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test @@ -9,31 +9,6 @@ nextflow_process { tag "octopusv" tag "octopusv/correct" - test("homo_sapiens - vcf") { - - when { - process { - """ - input[0] = [ - [ id:'test' ], - file(params.modules_testdata_base_path + '.../data/genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - file(process.out.svcf.get(0).get(1)).name, - process.out.findAll { key, val -> key.startsWith('versions') } - ).match() } - ) - } - - } - test("homo_sapiens - vcf - stub") { options "-stub" @@ -43,7 +18,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.modules_testdata_base_path + '.../data/genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) ] """ } diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap new file mode 100644 index 00000000000..87ac9fc9740 --- /dev/null +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "homo_sapiens - vcf - stub": { + "content": [ + { + "svcf": [ + [ + { + "id": "test" + }, + "test.svcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_octopusv": [ + [ + "OCTOPUSV_CORRECT", + "octopusv", + "0.3.2" + ] + ] + } + ], + "timestamp": "2026-05-06T15:10:03.730745241", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + } +} \ No newline at end of file From d616f2d324c76c12235c2fb05d9c0d3b9db439b6 Mon Sep 17 00:00:00 2001 From: manascripts Date: Fri, 8 May 2026 13:27:20 +0200 Subject: [PATCH 3/6] add tests and snaps --- modules/nf-core/octopusv/correct/main.nf | 8 ++++- .../octopusv/correct/tests/main.nf.test | 29 +++++++++++++++++-- .../octopusv/correct/tests/main.nf.test.snap | 23 +++++++++++++-- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/octopusv/correct/main.nf b/modules/nf-core/octopusv/correct/main.nf index 0b196d94fbe..c02fc0cf9ee 100644 --- a/modules/nf-core/octopusv/correct/main.nf +++ b/modules/nf-core/octopusv/correct/main.nf @@ -24,8 +24,14 @@ process OCTOPUSV_CORRECT { def 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 + octopusv correct \\ - -i ${vcf} \\ + -i \${vcf_in} \\ -o ${prefix}.svcf \\ $args """ diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test b/modules/nf-core/octopusv/correct/tests/main.nf.test index b8a25a73091..f64d6f9ef4c 100644 --- a/modules/nf-core/octopusv/correct/tests/main.nf.test +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test @@ -9,7 +9,32 @@ nextflow_process { tag "octopusv" tag "octopusv/correct" - test("homo_sapiens - vcf - stub") { + test("homo_sapiens - vcf.gz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.svcf.get(0).get(1)).vcf.summary, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + + } + + test("homo_sapiens - vcf.gz - stub") { options "-stub" @@ -18,7 +43,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/gridss.somatic.vcf', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true) ] """ } diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap index 87ac9fc9740..0512ae88125 100644 --- a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap @@ -1,5 +1,24 @@ { - "homo_sapiens - vcf - stub": { + "homo_sapiens - vcf.gz": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=136, phased=false, phasedAutodetect=false]", + { + "versions_octopusv": [ + [ + "OCTOPUSV_CORRECT", + "octopusv", + "0.3.2" + ] + ] + } + ], + "timestamp": "2026-05-08T13:25:13.672533417", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "homo_sapiens - vcf.gz - stub": { "content": [ { "svcf": [ @@ -19,7 +38,7 @@ ] } ], - "timestamp": "2026-05-06T15:10:03.730745241", + "timestamp": "2026-05-08T13:25:21.891795695", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.4" From 6d2edf62d4d2e7d008c498730a82363c9ffb8fed Mon Sep 17 00:00:00 2001 From: Manas Date: Fri, 8 May 2026 13:42:20 +0200 Subject: [PATCH 4/6] Update modules/nf-core/octopusv/correct/main.nf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit minor update to line 16 (main.nf) Co-authored-by: Matthias Hörtenhuber --- modules/nf-core/octopusv/correct/main.nf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/nf-core/octopusv/correct/main.nf b/modules/nf-core/octopusv/correct/main.nf index c02fc0cf9ee..9a4125bdf27 100644 --- a/modules/nf-core/octopusv/correct/main.nf +++ b/modules/nf-core/octopusv/correct/main.nf @@ -13,8 +13,7 @@ process OCTOPUSV_CORRECT { output: tuple val(meta), path("*.svcf"), emit: svcf tuple val("${task.process}"), val('octopusv'), - eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), - emit: versions_octopusv, topic: versions + eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), emit: versions_octopusv, topic: versions when: task.ext.when == null || task.ext.when From 9d1817a726ce61314c5c41ee83229d2b39e8ea34 Mon Sep 17 00:00:00 2001 From: manascripts Date: Fri, 8 May 2026 17:02:35 +0200 Subject: [PATCH 5/6] fix linting issue --- modules/nf-core/octopusv/correct/main.nf | 3 +- modules/nf-core/octopusv/correct/meta.yml | 13 ++--- .../octopusv/correct/tests/main.nf.test.snap | 47 ------------------- 3 files changed, 8 insertions(+), 55 deletions(-) delete mode 100644 modules/nf-core/octopusv/correct/tests/main.nf.test.snap diff --git a/modules/nf-core/octopusv/correct/main.nf b/modules/nf-core/octopusv/correct/main.nf index 9a4125bdf27..db05cf42832 100644 --- a/modules/nf-core/octopusv/correct/main.nf +++ b/modules/nf-core/octopusv/correct/main.nf @@ -12,8 +12,7 @@ process OCTOPUSV_CORRECT { output: tuple val(meta), path("*.svcf"), emit: svcf - tuple val("${task.process}"), val('octopusv'), - eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), emit: versions_octopusv, topic: versions + tuple val("${task.process}"), val('octopusv'), eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), emit: versions_octopusv, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/octopusv/correct/meta.yml b/modules/nf-core/octopusv/correct/meta.yml index 2d59e31ccb2..898cdef103d 100644 --- a/modules/nf-core/octopusv/correct/meta.yml +++ b/modules/nf-core/octopusv/correct/meta.yml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "octopusv_correct" description: "Standardize a caller VCF into OctopuSV SVCF format." keywords: @@ -9,12 +8,14 @@ keywords: - normalize tools: - "octopusv": - description: "End-to-end structural variant post-processing: standardize, merge, compare, and export SVs." + description: "End-to-end structural variant post-processing: standardize, merge, + compare, and export SVs." homepage: "https://github.com/ylab-hi/OctopuSV" documentation: "https://github.com/ylab-hi/OctopuSV" tool_dev_url: "https://github.com/ylab-hi/OctopuSV" doi: "10.1093/bioinformatics/btaf599" - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -27,7 +28,7 @@ input: description: Structural variant calls in VCF format pattern: "*.{vcf,vcf.gz}" ontologies: - - edam: "http://edamontology.org/format_3016" # VCF + - edam: "http://edamontology.org/format_3016" output: svcf: - - meta: @@ -39,7 +40,7 @@ output: description: Standardized SVCF file pattern: "*.svcf" ontologies: - - edam: "https://github.com/ylab-hi/OctopuSV/blob/main/docs/SVCF_specifications.md" # SVCF + - edam: "http://edamontology.org/format_3016" versions_octopusv: - - ${task.process}: type: string @@ -47,7 +48,7 @@ output: - octopusv: type: string description: The name of the tool - - octopusv --version: + - python -c "import importlib.metadata as m; print(m.version('octopusv'))": type: eval description: The expression to obtain the version of the tool topics: diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap deleted file mode 100644 index 0512ae88125..00000000000 --- a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap +++ /dev/null @@ -1,47 +0,0 @@ -{ - "homo_sapiens - vcf.gz": { - "content": [ - "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=136, phased=false, phasedAutodetect=false]", - { - "versions_octopusv": [ - [ - "OCTOPUSV_CORRECT", - "octopusv", - "0.3.2" - ] - ] - } - ], - "timestamp": "2026-05-08T13:25:13.672533417", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - }, - "homo_sapiens - vcf.gz - stub": { - "content": [ - { - "svcf": [ - [ - { - "id": "test" - }, - "test.svcf:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_octopusv": [ - [ - "OCTOPUSV_CORRECT", - "octopusv", - "0.3.2" - ] - ] - } - ], - "timestamp": "2026-05-08T13:25:21.891795695", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - } -} \ No newline at end of file From 45629e9be5e2e4b0c829b30f18066bbdb594e54c Mon Sep 17 00:00:00 2001 From: manascripts Date: Fri, 8 May 2026 17:10:43 +0200 Subject: [PATCH 6/6] minor fix --- modules/nf-core/octopusv/correct/meta.yml | 4 +- .../octopusv/correct/tests/main.nf.test.snap | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 modules/nf-core/octopusv/correct/tests/main.nf.test.snap diff --git a/modules/nf-core/octopusv/correct/meta.yml b/modules/nf-core/octopusv/correct/meta.yml index 898cdef103d..ec980e5b437 100644 --- a/modules/nf-core/octopusv/correct/meta.yml +++ b/modules/nf-core/octopusv/correct/meta.yml @@ -28,7 +28,7 @@ input: description: Structural variant calls in VCF format pattern: "*.{vcf,vcf.gz}" ontologies: - - edam: "http://edamontology.org/format_3016" + - edam: "http://edamontology.org/format_3016" # VCF output: svcf: - - meta: @@ -40,7 +40,7 @@ output: description: Standardized SVCF file pattern: "*.svcf" ontologies: - - edam: "http://edamontology.org/format_3016" + - edam: "https://github.com/ylab-hi/OctopuSV/blob/main/docs/SVCF_specifications.md" # SVCF versions_octopusv: - - ${task.process}: type: string diff --git a/modules/nf-core/octopusv/correct/tests/main.nf.test.snap b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap new file mode 100644 index 00000000000..9440fe86de1 --- /dev/null +++ b/modules/nf-core/octopusv/correct/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "homo_sapiens - vcf.gz": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=136, phased=false, phasedAutodetect=false]", + { + "versions_octopusv": [ + [ + "OCTOPUSV_CORRECT", + "octopusv", + "0.3.2" + ] + ] + } + ], + "timestamp": "2026-05-08T17:09:49.514026439", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "homo_sapiens - vcf.gz - stub": { + "content": [ + { + "svcf": [ + [ + { + "id": "test" + }, + "test.svcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_octopusv": [ + [ + "OCTOPUSV_CORRECT", + "octopusv", + "0.3.2" + ] + ] + } + ], + "timestamp": "2026-05-08T17:09:57.951939979", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + } +} \ No newline at end of file