From bdcf21a1f4ed3b0db4d5f11ad5125fd0302186ff Mon Sep 17 00:00:00 2001 From: imsarath Date: Mon, 13 Jul 2026 11:57:45 +0200 Subject: [PATCH 01/11] added gridss assemble module --- .../nf-core/gridss/assemble/environment.yml | 5 + modules/nf-core/gridss/assemble/main.nf | 50 ++++++++ modules/nf-core/gridss/assemble/meta.yml | 117 +++++++++++++++++ .../gridss/assemble/tests/main.nf.test | 120 ++++++++++++++++++ 4 files changed, 292 insertions(+) create mode 100644 modules/nf-core/gridss/assemble/environment.yml create mode 100644 modules/nf-core/gridss/assemble/main.nf create mode 100644 modules/nf-core/gridss/assemble/meta.yml create mode 100644 modules/nf-core/gridss/assemble/tests/main.nf.test diff --git a/modules/nf-core/gridss/assemble/environment.yml b/modules/nf-core/gridss/assemble/environment.yml new file mode 100644 index 000000000000..db37d675e605 --- /dev/null +++ b/modules/nf-core/gridss/assemble/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::gridss=2.13.2 diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf new file mode 100644 index 000000000000..c68e680d4cde --- /dev/null +++ b/modules/nf-core/gridss/assemble/main.nf @@ -0,0 +1,50 @@ +process GRIDSS_ASSEMBLE { + 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/gridss:2.13.2--h50ea8bc_3': + 'quay.io/biocontainers/gridss:2.13.2--h50ea8bc_3' }" + + input: + tuple val(meta), path(bams), path(bais), path(preprocess_dirs) + tuple val(meta2), path(fasta), path(fasta_fai), path(fasta_dict), path(bwa_index) + tuple val(meta3), path(gridss_config) + + output: + tuple val(meta), path("*.gridss.working"), path("*.sv.assembly.bam"), emit: assemble_dir + tuple val("${task.process}"), val('gridss'), eval("CallVariants --version 2>&1 | sed 's/-gridss//'") , topic: versions, emit: versions_gridss + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def arg_config = gridss_config ? "-c ${gridss_config}" : "" + + def bams_list = bams instanceof List ? bams : [bams] + + """ + ln -s \$(find -L ${bwa_index} -regex '.*\\.\\(amb\\|ann\\|pac\\|gridsscache\\|sa\\|bwt\\|img\\|alt\\)') ./ + + gridss ${args} \\ + --jvmheap ${Math.round(task.memory.bytes * 0.95)} \\ + --steps assemble \\ + --reference ${fasta} \\ + --workingdir "." \\ + --assembly ${prefix}.sv.assembly.bam \\ + --threads ${task.cpus} ${arg_config} ${bams_list.join(' ')} + + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix}.sv.assembly.bam.gridss.working + touch ${prefix}.sv.assembly.bam + + """ +} diff --git a/modules/nf-core/gridss/assemble/meta.yml b/modules/nf-core/gridss/assemble/meta.yml new file mode 100644 index 000000000000..3c14c5d4be56 --- /dev/null +++ b/modules/nf-core/gridss/assemble/meta.yml @@ -0,0 +1,117 @@ +name: "gridss_assemble" +description: Assemble breakend contigs for GRIDSS structural variant calling +keywords: + - bam + - assembly + - structural variants + - gridss + - breakend + - variant calling +tools: + - gridss: + description: "GRIDSS: the Genomic Rearrangement IDentification Software Suite" + homepage: "https://github.com/PapenfussLab/gridss" + documentation: "https://github.com/PapenfussLab/gridss/wiki/GRIDSS-Documentation" + tool_dev_url: "https://github.com/PapenfussLab/gridss" + doi: "10.1186/s13059-021-02423-x" + licence: + - "GPL v3" + identifier: biotools:gridss +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - bams: + type: file + description: Input BAM file(s) + pattern: "*.bam" + ontologies: + - edam: http://edamontology.org/format_2572 + - bais: + type: file + description: BAM index file(s) + pattern: "*.bam.bai" + ontologies: [] + - preprocess_dirs: + type: directory + description: GRIDSS preprocessing working directories from the GRIDSS_PREPROCESS step + pattern: "*.gridss.working/" + - - meta2: + type: map + description: | + Groovy Map containing reference genome information + e.g. `[ id:'genome' ]` + - fasta: + type: file + description: Reference genome FASTA file + pattern: "*.{fasta,fa,fna}" + ontologies: + - edam: http://edamontology.org/format_1929 + - fasta_fai: + type: file + description: Reference genome FASTA index file + pattern: "*.fai" + ontologies: [] + - fasta_dict: + type: file + description: Reference genome sequence dictionary + pattern: "*.dict" + ontologies: [] + - bwa_index: + type: directory + description: Directory containing the GRIDSS/BWA index files for the reference genome + pattern: "*" + - - meta3: + type: map + description: | + Groovy Map containing GRIDSS configuration information + e.g. `[ id:'gridss_config' ]` + - gridss_config: + type: file + description: Optional GRIDSS configuration file + pattern: "*.{properties,config}" + ontologies: [] +output: + assemble_dir: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.gridss.working": + type: directory + description: GRIDSS assembly working directory containing assembled breakend contigs + pattern: "*.gridss.working" + - "*.sv.assembly.bam": + type: file + description: BAM file containing the assembled breakend contigs + pattern: "*.sv.assembly.bam" + ontologies: + - edam: http://edamontology.org/format_2572 + versions_gridss: + - - ${task.process}: + type: string + description: The process + - gridss: + type: string + description: The tool name + - CallVariants --version 2>&1 | sed 's/-gridss//': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The process + - gridss: + type: string + description: The tool name + - CallVariants --version 2>&1 | sed 's/-gridss//': + type: eval + description: The expression to obtain the version of the tool +authors: + - "@imsarath" +maintainers: + - "@imsarath" diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test new file mode 100644 index 000000000000..19ea9cd3eedb --- /dev/null +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -0,0 +1,120 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test gridss/assemble +nextflow_process { + + name "Test Process GRIDSS_ASSEMBLE" + script "../main.nf" + config "./nextflow.config" + process "GRIDSS_ASSEMBLE" + + tag "modules" + tag "modules_local" + tag "gridss" + tag "gridss/assemble" + + setup { + run("UNTAR") { + script "../../untar/main.nf" + process { + """ + input[0] = channel.of([ + [ id: 'gridss_preprocess_dir' ], + file(params.modules_testdata_base_path + 'testdata/gridss/gridss_preprocess_dir.tar.gz', checkIfExists: true) + ]) + """ + } + } + + run("BWA_INDEX") { + script "../../bwa/index/main.nf" + process { + """ + input[0] = [ + [ id: 'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + test("gridss_assemble - human - bam") { + + when { + process { + """ + input[0] = channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]).join(UNTAR.out.untar) + input[1] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + ]).join(BWA_INDEX.out.index) + input[2] = channel.of([ + [ id: 'gridss_config' ], + file(params.modules_testdata_base_path + 'reference/GRCh37/gridss/gridss.properties', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.assemble_dir.collect { meta, working, assembly -> + [meta, file(working).list().sort(), file(assembly).name] + }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match() } + ) + } + } + + test("gridss_assemble - human - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = channel.of([ + [ id: 'test_sample', sample_type: 'tumor' ], + file(params.modules_testdata_base_path + 'testdata/bam/test.paired_end.markduplicates.gridss.targeted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'testdata/bam/test.paired_end.markduplicates.gridss.targeted.bam.bai', checkIfExists: true) + ]) + .join(UNTAR.out.untar) + input[1] = channel.of([ + [ id: 'genome' ], + file(params.modules_testdata_base_path + 'testdata/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = BWA_INDEX.out.index + input[3] = channel.of([ + [ id: 'genome_fai' ], + file(params.modules_testdata_base_path + 'testdata/genome/genome.fasta.fai', checkIfExists: true) + ]) + input[4] = channel.of([ + [ id: 'genome_dict' ], + file(params.modules_testdata_base_path + 'testdata/genome/genome.dict', checkIfExists: true) + ]) + input[5] = channel.of([ + [ id: 'gridss_config' ], + file(params.modules_testdata_base_path + 'reference/GRCh37/gridss/gridss.properties', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + } + +} From 0fd8576201bd92b3634ad2f549eb897b2af5845b Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 17 Jul 2026 14:00:49 +0200 Subject: [PATCH 02/11] fix: input channels in nf-test and stub --- modules/nf-core/gridss/assemble/main.nf | 23 +++++++- .../gridss/assemble/tests/main.nf.test | 52 ++++++++----------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index c68e680d4cde..d4c39a778c83 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -9,7 +9,7 @@ process GRIDSS_ASSEMBLE { input: tuple val(meta), path(bams), path(bais), path(preprocess_dirs) - tuple val(meta2), path(fasta), path(fasta_fai), path(fasta_dict), path(bwa_index) + tuple val(meta2), path(fasta), path(fasta_fai), path(bwa_index) tuple val(meta3), path(gridss_config) output: @@ -27,7 +27,14 @@ process GRIDSS_ASSEMBLE { def bams_list = bams instanceof List ? bams : [bams] """ - ln -s \$(find -L ${bwa_index} -regex '.*\\.\\(amb\\|ann\\|pac\\|gridsscache\\|sa\\|bwt\\|img\\|alt\\)') ./ + # GRIDSS requires all BWA index files to have the exact + # same basename as the reference fasta. This is a hard + # requirement of the tool - it will fail to find indices otherwise. + index_files=(\$(find -L "${bwa_index}" -regex '.*\\.\\(amb\\|ann\\|pac\\|gridsscache\\|sa\\|bwt\\|img\\|alt\\)\$')) + + for index_file in "\${index_files[@]}"; do + ln -sf "\$index_file" "./${fasta}.\${index_file##*.}" + done gridss ${args} \\ --jvmheap ${Math.round(task.memory.bytes * 0.95)} \\ @@ -44,7 +51,19 @@ process GRIDSS_ASSEMBLE { """ mkdir -p ${prefix}.sv.assembly.bam.gridss.working + touch ${prefix}.sv.assembly.bam + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.cigar_metrics", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.coverage.blacklist.bed", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.downsampled_0.bed", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.excluded_0.bed", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.idsv_metrics", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.mapq_metrics", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.quality_distribution_metrics", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.subsetCalled_0.bed", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam.bai", + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.tag_metrics" """ } diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test index 19ea9cd3eedb..3746942d0eb3 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -4,7 +4,7 @@ nextflow_process { name "Test Process GRIDSS_ASSEMBLE" script "../main.nf" - config "./nextflow.config" + // config "./nextflow.config" process "GRIDSS_ASSEMBLE" tag "modules" @@ -14,19 +14,19 @@ nextflow_process { setup { run("UNTAR") { - script "../../untar/main.nf" + script "../../../untar/main.nf" process { """ input[0] = channel.of([ - [ id: 'gridss_preprocess_dir' ], - file(params.modules_testdata_base_path + 'testdata/gridss/gridss_preprocess_dir.tar.gz', checkIfExists: true) + [ id: 'test.paired_end.sorted.bam.gridss.working' ], + file(params.modules_testdata_base_path + 'test.paired_end.sorted.bam.gridss.preprocess.tar.gz', checkIfExists: true) ]) """ } } run("BWA_INDEX") { - script "../../bwa/index/main.nf" + script "../../../bwa/index/main.nf" process { """ input[0] = [ @@ -38,7 +38,7 @@ nextflow_process { } } - test("gridss_assemble - human - bam") { + test("human - bam") { when { process { @@ -47,16 +47,15 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ]).join(UNTAR.out.untar) + ]).combine(UNTAR.out.untar).map { meta, bam, bai, meta_untar, preprocess_dir -> [meta, bam, bai, preprocess_dir] } input[1] = channel.of([ [id:'fasta'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) - ]).join(BWA_INDEX.out.index) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).combine(BWA_INDEX.out.index).map { meta, fasta, fai, meta_index, bwa_index -> [meta, fasta, fai, bwa_index] } input[2] = channel.of([ [ id: 'gridss_config' ], - file(params.modules_testdata_base_path + 'reference/GRCh37/gridss/gridss.properties', checkIfExists: true) + file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) ]) """ } @@ -75,7 +74,7 @@ nextflow_process { } } - test("gridss_assemble - human - bam - stub") { + test("human - bam - stub") { options "-stub" @@ -83,27 +82,18 @@ nextflow_process { process { """ input[0] = channel.of([ - [ id: 'test_sample', sample_type: 'tumor' ], - file(params.modules_testdata_base_path + 'testdata/bam/test.paired_end.markduplicates.gridss.targeted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'testdata/bam/test.paired_end.markduplicates.gridss.targeted.bam.bai', checkIfExists: true) - ]) - .join(UNTAR.out.untar) + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]).combine(UNTAR.out.untar).map { meta, bam, bai, meta_untar, preprocess_dir -> [meta, bam, bai, preprocess_dir] } input[1] = channel.of([ - [ id: 'genome' ], - file(params.modules_testdata_base_path + 'testdata/genome/genome.fasta', checkIfExists: true) - ]) - input[2] = BWA_INDEX.out.index - input[3] = channel.of([ - [ id: 'genome_fai' ], - file(params.modules_testdata_base_path + 'testdata/genome/genome.fasta.fai', checkIfExists: true) - ]) - input[4] = channel.of([ - [ id: 'genome_dict' ], - file(params.modules_testdata_base_path + 'testdata/genome/genome.dict', checkIfExists: true) - ]) - input[5] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).combine(BWA_INDEX.out.index).map { meta, fasta, fai, meta_index, bwa_index -> [meta, fasta, fai, bwa_index] } + input[2] = channel.of([ [ id: 'gridss_config' ], - file(params.modules_testdata_base_path + 'reference/GRCh37/gridss/gridss.properties', checkIfExists: true) + file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) ]) """ } From 54469aadff4cb144836a070f58baaa10a506bb47 Mon Sep 17 00:00:00 2001 From: imsarath Date: Wed, 22 Jul 2026 10:27:26 +0200 Subject: [PATCH 03/11] fix: nf-test gridss assemble --- .../gridss/assemble/tests/main.nf.test | 37 +++++++++-------- .../gridss/assemble/tests/main.nf.test.snap | 41 +++++++++++++++++++ 2 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 modules/nf-core/gridss/assemble/tests/main.nf.test.snap diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test index 3746942d0eb3..8707fbb7cf1b 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -1,10 +1,7 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test gridss/assemble nextflow_process { name "Test Process GRIDSS_ASSEMBLE" script "../main.nf" - // config "./nextflow.config" process "GRIDSS_ASSEMBLE" tag "modules" @@ -13,26 +10,32 @@ nextflow_process { tag "gridss/assemble" setup { - run("UNTAR") { - script "../../../untar/main.nf" + run("BWA_INDEX") { + script "../../../bwa/index/main.nf" process { """ - input[0] = channel.of([ - [ id: 'test.paired_end.sorted.bam.gridss.working' ], - file(params.modules_testdata_base_path + 'test.paired_end.sorted.bam.gridss.preprocess.tar.gz', checkIfExists: true) - ]) + input[0] = [ + [ id: 'fasta' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] """ } } - run("BWA_INDEX") { - script "../../../bwa/index/main.nf" + run("GRIDSS_PREPROCESS") { + script "../../preprocess/main.nf" process { """ input[0] = [ - [ id: 'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) ] + input[1] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).join(BWA_INDEX.out.index) """ } } @@ -47,12 +50,12 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ]).combine(UNTAR.out.untar).map { meta, bam, bai, meta_untar, preprocess_dir -> [meta, bam, bai, preprocess_dir] } + ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) input[1] = channel.of([ [id:'fasta'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) - ]).combine(BWA_INDEX.out.index).map { meta, fasta, fai, meta_index, bwa_index -> [meta, fasta, fai, bwa_index] } + ]).join(BWA_INDEX.out.index) input[2] = channel.of([ [ id: 'gridss_config' ], file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) @@ -85,12 +88,12 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ]).combine(UNTAR.out.untar).map { meta, bam, bai, meta_untar, preprocess_dir -> [meta, bam, bai, preprocess_dir] } + ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) input[1] = channel.of([ [id:'fasta'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) - ]).combine(BWA_INDEX.out.index).map { meta, fasta, fai, meta_index, bwa_index -> [meta, fasta, fai, bwa_index] } + ]).join(BWA_INDEX.out.index) input[2] = channel.of([ [ id: 'gridss_config' ], file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test.snap b/modules/nf-core/gridss/assemble/tests/main.nf.test.snap new file mode 100644 index 000000000000..43b5fc2ed922 --- /dev/null +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "human - bam": { + "content": [ + [ + [ + { + "id": "test" + }, + [ + "test.sv.assembly.bam.cigar_metrics", + "test.sv.assembly.bam.coverage.blacklist.bed", + "test.sv.assembly.bam.downsampled_0.bed", + "test.sv.assembly.bam.excluded_0.bed", + "test.sv.assembly.bam.idsv_metrics", + "test.sv.assembly.bam.mapq_metrics", + "test.sv.assembly.bam.quality_distribution_metrics", + "test.sv.assembly.bam.subsetCalled_0.bed", + "test.sv.assembly.bam.sv.bam", + "test.sv.assembly.bam.sv.bam.bai", + "test.sv.assembly.bam.tag_metrics" + ], + "test.sv.assembly.bam" + ] + ], + { + "versions_gridss": [ + [ + "GRIDSS_ASSEMBLE", + "gridss", + "2.13.2" + ] + ] + } + ], + "timestamp": "2026-07-22T10:14:13.072385086", + "meta": { + "nf-test": "0.9.4", + "nextflow": "26.04.3" + } + } +} \ No newline at end of file From 136e4942571b3ddc91b3a3d103d9c12c334a9420 Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 10:41:11 +0200 Subject: [PATCH 04/11] update the nf-test snapshot --- modules/nf-core/gridss/assemble/main.nf | 22 ++-- .../gridss/assemble/tests/main.nf.test | 113 ------------------ .../gridss/assemble/tests/main.nf.test.snap | 41 ++++++- 3 files changed, 51 insertions(+), 125 deletions(-) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index d4c39a778c83..e1d32157d825 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -53,17 +53,17 @@ process GRIDSS_ASSEMBLE { mkdir -p ${prefix}.sv.assembly.bam.gridss.working touch ${prefix}.sv.assembly.bam - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.cigar_metrics", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.coverage.blacklist.bed", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.downsampled_0.bed", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.excluded_0.bed", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.idsv_metrics", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.mapq_metrics", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.quality_distribution_metrics", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.subsetCalled_0.bed", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam.bai", - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.tag_metrics" + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.cigar_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.coverage.blacklist.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.downsampled_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.excluded_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.idsv_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.mapq_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.quality_distribution_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.subsetCalled_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam.bai + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.tag_metrics """ } diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test index 8707fbb7cf1b..e69de29bb2d1 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -1,113 +0,0 @@ -nextflow_process { - - name "Test Process GRIDSS_ASSEMBLE" - script "../main.nf" - process "GRIDSS_ASSEMBLE" - - tag "modules" - tag "modules_local" - tag "gridss" - tag "gridss/assemble" - - setup { - run("BWA_INDEX") { - script "../../../bwa/index/main.nf" - process { - """ - input[0] = [ - [ id: 'fasta' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - - run("GRIDSS_PREPROCESS") { - script "../../preprocess/main.nf" - process { - """ - input[0] = [ - [ id:'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ] - input[1] = channel.of([ - [id:'fasta'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) - ]).join(BWA_INDEX.out.index) - """ - } - } - } - - test("human - bam") { - - when { - process { - """ - input[0] = channel.of([ - [ id:'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) - input[1] = channel.of([ - [id:'fasta'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) - ]).join(BWA_INDEX.out.index) - input[2] = channel.of([ - [ id: 'gridss_config' ], - file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - process.out.assemble_dir.collect { meta, working, assembly -> - [meta, file(working).list().sort(), file(assembly).name] - }, - process.out.findAll { key, val -> key.startsWith("versions") } - ).match() } - ) - } - } - - test("human - bam - stub") { - - options "-stub" - - when { - process { - """ - input[0] = channel.of([ - [ id:'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) - ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) - input[1] = channel.of([ - [id:'fasta'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) - ]).join(BWA_INDEX.out.index) - input[2] = channel.of([ - [ id: 'gridss_config' ], - file(params.modules_testdata_base_path + 'test-data/reference/GRCh37/gridss/gridss.properties', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(sanitizeOutput(process.out)).match() } - ) - } - } - -} diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test.snap b/modules/nf-core/gridss/assemble/tests/main.nf.test.snap index 43b5fc2ed922..07ca355bb3e9 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test.snap +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test.snap @@ -1,4 +1,43 @@ { + "human - bam - stub": { + "content": [ + { + "assemble_dir": [ + [ + { + "id": "test" + }, + [ + "test.sv.assembly.bam.cigar_metrics:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.coverage.blacklist.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.downsampled_0.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.excluded_0.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.idsv_metrics:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.mapq_metrics:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.quality_distribution_metrics:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.subsetCalled_0.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.sv.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.sv.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e", + "test.sv.assembly.bam.tag_metrics:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "test.sv.assembly.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_gridss": [ + [ + "GRIDSS_ASSEMBLE", + "gridss", + "2.13.2" + ] + ] + } + ], + "timestamp": "2026-07-24T10:34:32.103764795", + "meta": { + "nf-test": "0.9.4", + "nextflow": "26.04.3" + } + }, "human - bam": { "content": [ [ @@ -32,7 +71,7 @@ ] } ], - "timestamp": "2026-07-22T10:14:13.072385086", + "timestamp": "2026-07-24T10:34:17.884396972", "meta": { "nf-test": "0.9.4", "nextflow": "26.04.3" From fe77aad165a9c807a452cba4b29039b83be36bfd Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 10:49:50 +0200 Subject: [PATCH 05/11] fix: assemble main.nf-test --- modules/nf-core/gridss/assemble/meta.yml | 14 +-- .../gridss/assemble/tests/main.nf.test | 113 ++++++++++++++++++ 2 files changed, 119 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/gridss/assemble/meta.yml b/modules/nf-core/gridss/assemble/meta.yml index 3c14c5d4be56..3e66908644e4 100644 --- a/modules/nf-core/gridss/assemble/meta.yml +++ b/modules/nf-core/gridss/assemble/meta.yml @@ -36,7 +36,8 @@ input: ontologies: [] - preprocess_dirs: type: directory - description: GRIDSS preprocessing working directories from the GRIDSS_PREPROCESS step + description: GRIDSS preprocessing working directories from the + GRIDSS_PREPROCESS step pattern: "*.gridss.working/" - - meta2: type: map @@ -54,14 +55,10 @@ input: description: Reference genome FASTA index file pattern: "*.fai" ontologies: [] - - fasta_dict: - type: file - description: Reference genome sequence dictionary - pattern: "*.dict" - ontologies: [] - bwa_index: type: directory - description: Directory containing the GRIDSS/BWA index files for the reference genome + description: Directory containing the GRIDSS/BWA index files for the + reference genome pattern: "*" - - meta3: type: map @@ -82,7 +79,8 @@ output: e.g. `[ id:'sample1' ]` - "*.gridss.working": type: directory - description: GRIDSS assembly working directory containing assembled breakend contigs + description: GRIDSS assembly working directory containing assembled + breakend contigs pattern: "*.gridss.working" - "*.sv.assembly.bam": type: file diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test index e69de29bb2d1..1d9f1b91ff25 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -0,0 +1,113 @@ +nextflow_process { + + name "Test Process GRIDSS_ASSEMBLE" + script "../main.nf" + process "GRIDSS_ASSEMBLE" + + tag "modules" + tag "modules_nfcore" + tag "gridss" + tag "gridss/assemble" + + setup { + run("BWA_INDEX") { + script "../../../bwa/index/main.nf" + process { + """ + input[0] = [ + [ id: 'fasta' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + run("GRIDSS_PREPROCESS") { + script "../../preprocess/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + input[1] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).join(BWA_INDEX.out.index) + """ + } + } + } + + test("human - bam") { + + when { + process { + """ + input[0] = channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) + input[1] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).join(BWA_INDEX.out.index) + input[2] = channel.of([ + [id:'gridss_config'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gridss/gridss.properties', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.assemble_dir.collect { meta, working, assembly -> + [meta, file(working).list().sort(), file(assembly).name] + }, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match() } + ) + } + } + + test("human - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]).join(GRIDSS_PREPROCESS.out.preprocess_dir) + input[1] = channel.of([ + [id:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]).join(BWA_INDEX.out.index) + input[2] = channel.of([ + [id:'gridss_config'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gridss/gridss.properties', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + } + +} From 1057c424033ca439e2c22f2d41bbc90d449066b8 Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 10:56:19 +0200 Subject: [PATCH 06/11] fix: nf-core modules lint issue --- modules/nf-core/gridss/assemble/tests/main.nf.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nf-core/gridss/assemble/tests/main.nf.test b/modules/nf-core/gridss/assemble/tests/main.nf.test index 1d9f1b91ff25..c11aa76b978f 100644 --- a/modules/nf-core/gridss/assemble/tests/main.nf.test +++ b/modules/nf-core/gridss/assemble/tests/main.nf.test @@ -6,7 +6,9 @@ nextflow_process { tag "modules" tag "modules_nfcore" + tag "bwa/index" tag "gridss" + tag "gridss/preprocess" tag "gridss/assemble" setup { From 76a44e6a9dd569c7073bf8a789d06d66dfc36e3c Mon Sep 17 00:00:00 2001 From: Sarath Kumar Murugan Date: Fri, 24 Jul 2026 11:26:17 +0200 Subject: [PATCH 07/11] Update modules/nf-core/gridss/assemble/main.nf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matthias Hörtenhuber --- modules/nf-core/gridss/assemble/main.nf | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index e1d32157d825..c444f35ce7da 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -25,16 +25,11 @@ process GRIDSS_ASSEMBLE { def arg_config = gridss_config ? "-c ${gridss_config}" : "" def bams_list = bams instanceof List ? bams : [bams] - - """ - # GRIDSS requires all BWA index files to have the exact - # same basename as the reference fasta. This is a hard - # requirement of the tool - it will fail to find indices otherwise. - index_files=(\$(find -L "${bwa_index}" -regex '.*\\.\\(amb\\|ann\\|pac\\|gridsscache\\|sa\\|bwt\\|img\\|alt\\)\$')) - - for index_file in "\${index_files[@]}"; do - ln -sf "\$index_file" "./${fasta}.\${index_file##*.}" - done + def index_files = bwa_index instanceof List ? bwa_index : [bwa_index] + // GRIDSS requires all BWA index files to have the exact same basename as the reference fasta + def link_cmds = index_files.collect { idx -> "ln -sf ${idx} ./${fasta}.${idx.extension}" }.join('\n') + """ + ${link_cmds} gridss ${args} \\ --jvmheap ${Math.round(task.memory.bytes * 0.95)} \\ From f3fcfa3e2f83c5eec1577625193dd209f4fba2ed Mon Sep 17 00:00:00 2001 From: Sarath Kumar Murugan Date: Fri, 24 Jul 2026 11:26:31 +0200 Subject: [PATCH 08/11] Update modules/nf-core/gridss/assemble/main.nf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matthias Hörtenhuber --- modules/nf-core/gridss/assemble/main.nf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index c444f35ce7da..d44004c7ea0f 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -37,7 +37,9 @@ process GRIDSS_ASSEMBLE { --reference ${fasta} \\ --workingdir "." \\ --assembly ${prefix}.sv.assembly.bam \\ - --threads ${task.cpus} ${arg_config} ${bams_list.join(' ')} + --threads ${task.cpus} \\ + ${arg_config} \\ + ${bams_list.join(' ')} """ From 4324d8be4db71846d7ba553205096999a32163a7 Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 11:32:34 +0200 Subject: [PATCH 09/11] applied suggestions --- modules/nf-core/gridss/assemble/main.nf | 66 ------------------------- 1 file changed, 66 deletions(-) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index d44004c7ea0f..e69de29bb2d1 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -1,66 +0,0 @@ -process GRIDSS_ASSEMBLE { - 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/gridss:2.13.2--h50ea8bc_3': - 'quay.io/biocontainers/gridss:2.13.2--h50ea8bc_3' }" - - input: - tuple val(meta), path(bams), path(bais), path(preprocess_dirs) - tuple val(meta2), path(fasta), path(fasta_fai), path(bwa_index) - tuple val(meta3), path(gridss_config) - - output: - tuple val(meta), path("*.gridss.working"), path("*.sv.assembly.bam"), emit: assemble_dir - tuple val("${task.process}"), val('gridss'), eval("CallVariants --version 2>&1 | sed 's/-gridss//'") , topic: versions, emit: versions_gridss - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def arg_config = gridss_config ? "-c ${gridss_config}" : "" - - def bams_list = bams instanceof List ? bams : [bams] - def index_files = bwa_index instanceof List ? bwa_index : [bwa_index] - // GRIDSS requires all BWA index files to have the exact same basename as the reference fasta - def link_cmds = index_files.collect { idx -> "ln -sf ${idx} ./${fasta}.${idx.extension}" }.join('\n') - """ - ${link_cmds} - - gridss ${args} \\ - --jvmheap ${Math.round(task.memory.bytes * 0.95)} \\ - --steps assemble \\ - --reference ${fasta} \\ - --workingdir "." \\ - --assembly ${prefix}.sv.assembly.bam \\ - --threads ${task.cpus} \\ - ${arg_config} \\ - ${bams_list.join(' ')} - - """ - - stub: - def prefix = task.ext.prefix ?: "${meta.id}" - - """ - mkdir -p ${prefix}.sv.assembly.bam.gridss.working - - touch ${prefix}.sv.assembly.bam - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.cigar_metrics - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.coverage.blacklist.bed - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.downsampled_0.bed - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.excluded_0.bed - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.idsv_metrics - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.mapq_metrics - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.quality_distribution_metrics - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.subsetCalled_0.bed - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam.bai - touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.tag_metrics - - """ -} From ea5681a2a966a95fd1b86147dc90bd1a86da8c89 Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 11:39:01 +0200 Subject: [PATCH 10/11] fix: updated main.nf --- modules/nf-core/gridss/assemble/main.nf | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/modules/nf-core/gridss/assemble/main.nf b/modules/nf-core/gridss/assemble/main.nf index e69de29bb2d1..88e8602781ca 100644 --- a/modules/nf-core/gridss/assemble/main.nf +++ b/modules/nf-core/gridss/assemble/main.nf @@ -0,0 +1,66 @@ +process GRIDSS_ASSEMBLE { + 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/gridss:2.13.2--h50ea8bc_3': + 'quay.io/biocontainers/gridss:2.13.2--h50ea8bc_3' }" + + input: + tuple val(meta), path(bam), path(bai), path(preprocess_dir) + tuple val(meta2), path(fasta), path(fasta_fai), path(bwa_index) + tuple val(meta3), path(gridss_config) + + output: + tuple val(meta), path("*.gridss.working"), path("*.sv.assembly.bam"), emit: assemble_dir + tuple val("${task.process}"), val('gridss'), eval("CallVariants --version 2>&1 | sed 's/-gridss//'") , topic: versions, emit: versions_gridss + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def arg_config = gridss_config ? "-c ${gridss_config}" : "" + + def bam_list = bam instanceof List ? bam : [bam] + def index_files = bwa_index instanceof List ? bwa_index : [bwa_index] + // GRIDSS requires all BWA index files to have the exact same basename as the reference fasta + def link_cmds = index_files.collect { idx -> "ln -sf ${idx} ./${fasta}.${idx.extension}" }.join('\n') + """ + ${link_cmds} + + gridss ${args} \\ + --jvmheap ${Math.round(task.memory.bytes * 0.95)} \\ + --steps assemble \\ + --reference ${fasta} \\ + --workingdir "." \\ + --assembly ${prefix}.sv.assembly.bam \\ + --threads ${task.cpus} \\ + ${arg_config} \\ + ${bam_list.join(' ')} + + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix}.sv.assembly.bam.gridss.working + + touch ${prefix}.sv.assembly.bam + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.cigar_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.coverage.blacklist.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.downsampled_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.excluded_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.idsv_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.mapq_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.quality_distribution_metrics + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.subsetCalled_0.bed + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.sv.bam.bai + touch ${prefix}.sv.assembly.bam.gridss.working/${prefix}.sv.assembly.bam.tag_metrics + + """ +} From 702cfb48cff295ad4b6f73e5595e250f1b82d0de Mon Sep 17 00:00:00 2001 From: imsarath Date: Fri, 24 Jul 2026 11:44:28 +0200 Subject: [PATCH 11/11] fix: nf-core modules linting --- modules/nf-core/gridss/assemble/meta.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/gridss/assemble/meta.yml b/modules/nf-core/gridss/assemble/meta.yml index 3e66908644e4..923ca80f52f5 100644 --- a/modules/nf-core/gridss/assemble/meta.yml +++ b/modules/nf-core/gridss/assemble/meta.yml @@ -23,18 +23,18 @@ input: description: | Groovy Map containing sample information e.g. `[ id:'sample1' ]` - - bams: + - bam: type: file description: Input BAM file(s) pattern: "*.bam" ontologies: - edam: http://edamontology.org/format_2572 - - bais: + - bai: type: file description: BAM index file(s) pattern: "*.bam.bai" ontologies: [] - - preprocess_dirs: + - preprocess_dir: type: directory description: GRIDSS preprocessing working directories from the GRIDSS_PREPROCESS step