diff --git a/modules/nf-core/svdss/index/environment.yml b/modules/nf-core/svdss/index/environment.yml new file mode 100644 index 00000000000..ffc2399773d --- /dev/null +++ b/modules/nf-core/svdss/index/environment.yml @@ -0,0 +1,8 @@ +--- +# 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/svdss + - bioconda::svdss=2.1.1 diff --git a/modules/nf-core/svdss/index/main.nf b/modules/nf-core/svdss/index/main.nf new file mode 100644 index 00000000000..5a756077906 --- /dev/null +++ b/modules/nf-core/svdss/index/main.nf @@ -0,0 +1,43 @@ +process SVDSS_INDEX { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/svdss:2.1.1--he17396a_0' : + 'quay.io/biocontainers/svdss:2.1.1--he17396a_0' }" + + input: + tuple val(meta), path(fasta), path(existing_index) + val output_format + + output: + tuple val(meta), path("${prefix}.${output_format}"), emit: index + tuple val("${task.process}"), val('svdss'), eval("SVDSS --version 2>&1 | sed 's/SVDSS, v//'"), emit: versions_svdss, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def format_flag = output_format == 'fmd' ? '-d' : '-b' + def existing_index_arg = existing_index ? "-i ${existing_index}" : '' + """ + SVDSS index \\ + -t ${task.cpus} \\ + ${existing_index_arg} \\ + ${format_flag} ${fasta} \\ + ${args} \\ + > ${prefix}.${output_format} + """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + echo ${args} + + touch ${prefix}.${output_format} + """ +} diff --git a/modules/nf-core/svdss/index/meta.yml b/modules/nf-core/svdss/index/meta.yml new file mode 100644 index 00000000000..e2d7be13a0a --- /dev/null +++ b/modules/nf-core/svdss/index/meta.yml @@ -0,0 +1,82 @@ +name: svdss_index +description: Index a reference genome FASTA file using SVDSS (via ropebwt3), producing either an FMD or FMR index for use with SVDSS smooth and search subcommands +keywords: + - structural variants + - sv calling + - indexing + - reference genome + - fm-index +tools: + - svdss: + description: | + SVDSS is a tool for structural variant discovery from short-read sequencing data. + It implements an FM-index-based approach to efficiently detect SVs against a reference genome. + homepage: https://github.com/Parsoa/SVDSS + documentation: https://github.com/Parsoa/SVDSS + tool_dev_url: https://github.com/Parsoa/SVDSS + doi: "10.1038/s41592-022-01674-1" + licence: + - "MIT" + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Reference genome in FASTA format + pattern: "*.{fasta,fa,fna}" + ontologies: + - edam: http://edamontology.org/format_1929 # FASTA + - existing_index: + type: file + description: | + Optional path to an existing index file to read and extend (passed via -i). + Set to [] when not used. + pattern: "*.{fmd,fmr}" + ontologies: [] + - output_format: + type: string + description: | + Output index format. Use 'fmd' for the fermi-delta format (adds -d flag) + or 'fmr' for the ropebwt format (adds -b flag). + pattern: "fmd|fmr" +output: + index: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - ${prefix}.${output_format}: + type: file + description: FM-index file produced by SVDSS index, used as input for SVDSS smooth and search + pattern: "*.{fmd,fmr}" + ontologies: [] + versions_svdss: + - - ${task.process}: + type: string + description: The name of the process + - svdss: + type: string + description: The name of the tool + - SVDSS --version 2>&1 | sed 's/SVDSS, v//': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - svdss: + type: string + description: The name of the tool + - SVDSS --version 2>&1 | sed 's/SVDSS, v//': + type: eval + description: The expression to obtain the version of the tool +authors: + - "@vagkaratzas" +maintainers: + - "@vagkaratzas" diff --git a/modules/nf-core/svdss/index/tests/main.nf.test b/modules/nf-core/svdss/index/tests/main.nf.test new file mode 100644 index 00000000000..d53df76bf78 --- /dev/null +++ b/modules/nf-core/svdss/index/tests/main.nf.test @@ -0,0 +1,86 @@ +nextflow_process { + + name "Test Process SVDSS_INDEX" + script "../main.nf" + process "SVDSS_INDEX" + + tag "modules" + tag "modules_nfcore" + tag "svdss" + tag "svdss/index" + + test("sarscov2 - genome fasta - fmd") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = 'fmd' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + + test("sarscov2 - genome fasta - fmr") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = 'fmr' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + + test("sarscov2 - genome fasta - fmd - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = 'fmd' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + +} diff --git a/modules/nf-core/svdss/index/tests/main.nf.test.snap b/modules/nf-core/svdss/index/tests/main.nf.test.snap new file mode 100644 index 00000000000..b4e50647113 --- /dev/null +++ b/modules/nf-core/svdss/index/tests/main.nf.test.snap @@ -0,0 +1,80 @@ +{ + "sarscov2 - genome fasta - fmd - stub": { + "content": [ + { + "index": [ + [ + { + "id": "test" + }, + "test.fmd:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_svdss": [ + [ + "SVDSS_INDEX", + "svdss", + "2.1.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.4" + }, + "timestamp": "2026-04-23T19:29:18.443950745" + }, + "sarscov2 - genome fasta - fmd": { + "content": [ + { + "index": [ + [ + { + "id": "test" + }, + "test.fmd:md5,e07e753be2f2b6e6354963a1b44a0256" + ] + ], + "versions_svdss": [ + [ + "SVDSS_INDEX", + "svdss", + "2.1.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.4" + }, + "timestamp": "2026-04-23T19:29:07.682526462" + }, + "sarscov2 - genome fasta - fmr": { + "content": [ + { + "index": [ + [ + { + "id": "test" + }, + "test.fmr:md5,45ecc6cf667105098c01cc32ec255561" + ] + ], + "versions_svdss": [ + [ + "SVDSS_INDEX", + "svdss", + "2.1.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.4" + }, + "timestamp": "2026-04-23T19:29:12.935284928" + } +} \ No newline at end of file