From 03634e416087a394046a7fcfd5c5f76bbf9f10ee Mon Sep 17 00:00:00 2001 From: Kiran Date: Fri, 29 May 2026 15:52:31 +0800 Subject: [PATCH 01/12] feat: add varnet module --- modules/nf-core/varnet/main.nf | 68 ++++++++ modules/nf-core/varnet/meta.yml | 158 ++++++++++++++++++ modules/nf-core/varnet/tests/main.nf.test | 97 +++++++++++ .../nf-core/varnet/tests/main.nf.test.snap | 46 +++++ modules/nf-core/varnet/tests/nextflow.config | 8 + 5 files changed, 377 insertions(+) create mode 100644 modules/nf-core/varnet/main.nf create mode 100644 modules/nf-core/varnet/meta.yml create mode 100644 modules/nf-core/varnet/tests/main.nf.test create mode 100644 modules/nf-core/varnet/tests/main.nf.test.snap create mode 100644 modules/nf-core/varnet/tests/nextflow.config diff --git a/modules/nf-core/varnet/main.nf b/modules/nf-core/varnet/main.nf new file mode 100644 index 000000000000..dc3678510f81 --- /dev/null +++ b/modules/nf-core/varnet/main.nf @@ -0,0 +1,68 @@ +process VARNET { + tag "$meta.id" + label 'process_high_memory' + + // Using the official VarNet Docker image + container "docker.io/kiranchari/varnet:latest" + + input: + tuple val(meta), path(input_normal), path(index_normal), path(input_tumor), path(index_tumor) + tuple val(meta2), path(intervals) + tuple val(meta3), path(fasta) + tuple val(meta4), path(fai) + + output: + tuple val(meta), path("${prefix}/${prefix}.vcf.gz") , emit: vcf + tuple val("${task.process}"), val("varnet"), val("1.0.0"), emit: versions, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def regions = intervals ? "--region_bed \$WORKDIR/${intervals}" : "" + def normal = input_normal ? "--normal_bam \$WORKDIR/${input_normal}" : "" + """ + + WORKDIR=\$(pwd) + + cd /VarNet + TF_CPP_MIN_LOG_LEVEL=3 python /VarNet/filter.py \\ + --sample_name ${prefix} \\ + ${normal} \\ + --tumor_bam \$WORKDIR/${input_tumor} \\ + --reference \$WORKDIR/${fasta} \\ + --output_dir \$WORKDIR \\ + --processes ${task.cpus} \\ + ${regions} \\ + ${args} + + TF_CPP_MIN_LOG_LEVEL=3 python /VarNet/predict.py \\ + --sample_name ${prefix} \\ + ${normal} \\ + --tumor_bam \$WORKDIR/${input_tumor} \\ + --reference \$WORKDIR/${fasta} \\ + --output_dir \$WORKDIR \\ + --processes ${task.cpus} \\ + ${args} + + cat <<-END_VERSIONS > \$WORKDIR/versions.yml + "${task.process}": + varnet: 1.5.0 + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir -p ${prefix} + echo "" | gzip > ${prefix}/${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + varnet: 1.0.0 + END_VERSIONS + """ +} + diff --git a/modules/nf-core/varnet/meta.yml b/modules/nf-core/varnet/meta.yml new file mode 100644 index 000000000000..0c9dab3ace7f --- /dev/null +++ b/modules/nf-core/varnet/meta.yml @@ -0,0 +1,158 @@ +name: "varnet" +description: DeepSomatic is an extension of deep learning-based variant caller + DeepVariant that takes aligned reads (in BAM or CRAM format) from tumor and + normal data, produces pileup image tensors from them, classifies each tensor + using a convolutional neural network, and finally reports somatic variants in + a standard VCF or gVCF file. +keywords: + - variant calling + - machine learning + - neural network +tools: + - "varnet": + description: "A deep learning based somatic variant caller" + homepage: "https://github.com/skandlab/varnet" + documentation: "https://github.com/skandlab/varnet" + tool_dev_url: "https://github.com/skandlab/varnet" + doi: "10.1038/s41467-022-30584-2" + licence: + - "Polyform Non-Commercial" + identifier: "biotools:deepsomatic" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_normal: + type: file + description: BAM/CRAM file + pattern: "*.bam/cram" + ontologies: [] + - index_normal: + type: file + description: Index of BAM/CRAM file + pattern: "*.bai/crai" + ontologies: [] + - input_tumor: + type: file + description: BAM/CRAM file + pattern: "*.bam/cram" + ontologies: [] + - index_tumor: + type: file + description: Index of BAM/CRAM file + pattern: "*.bai/crai" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - intervals: + type: file + description: file containing intervals + ontologies: [] + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + ontologies: [] + - - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fai" + ontologies: [] + - - meta5: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gzi: + type: file + description: GZI index of reference fasta file + pattern: "*.gzi" + ontologies: [] +output: + vcf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - ${prefix}.vcf.gz: + type: file + description: Compressed VCF file + pattern: "*.vcf.gz" + ontologies: + - edam: http://edamontology.org/format_3989 # GZIP format + vcf_tbi: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - ${prefix}.vcf.gz.tbi: + type: file + description: Index of compressed VCF file + pattern: "*.vcf.gz.tbi" + ontologies: [] + gvcf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - ${prefix}.g.vcf.gz: + type: file + description: Compressed GVCF file + pattern: "*.g.vcf.gz" + ontologies: + - edam: http://edamontology.org/format_3989 + gvcf_tbi: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - ${prefix}.g.vcf.gz.tbi: + type: file + description: Index of compressed Genotyped VCF file + pattern: "*.g.vcf.gz.tbi" + ontologies: [] + versions_deepsomatic: + - - ${task.process}: + type: string + description: The name of the process + - deepsomatic: + type: string + description: The name of the tool + - 1.7.0: + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - deepsomatic: + type: string + description: The name of the tool + - 1.7.0: + type: eval + description: The expression to obtain the version of the tool +authors: + - "@vaxyzek" +maintainers: + - "@vaxyzek" + diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test new file mode 100644 index 000000000000..619b023c7bac --- /dev/null +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -0,0 +1,97 @@ +nextflow_process { + + name "Test Process VARNET" + script "../main.nf" + process "VARNET" + + tag "modules" + tag "modules_nfcore" + tag "varnet" + + test("tumor_normal_pair") { + config './nextflow.config' + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'test_region' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.vcf_tbi.collect { file(it[1]).getName() }, + process.out.versions + ).match() + } + ) + } + + } + +test("tumor_only") { + config './nextflow.config' + + when { + process { + """ + input[0] = [ + [ id:'test_tumor_only' ], + [], // input_normal is empty + [], // index_normal is empty + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'intervals' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.vcf_tbi.collect { file(it[1]).getName() }, + process.out.versions + ).match() + } + ) + } + } +} diff --git a/modules/nf-core/varnet/tests/main.nf.test.snap b/modules/nf-core/varnet/tests/main.nf.test.snap new file mode 100644 index 000000000000..81427b3cfaf2 --- /dev/null +++ b/modules/nf-core/varnet/tests/main.nf.test.snap @@ -0,0 +1,46 @@ +{ + "tumor_only": { + "content": [ + [ + "test_tumor_only_out.vcf.gz" + ], + [ + + ], + [ + [ + "VARNET", + "varnet", + "1.0.0" + ] + ] + ], + "timestamp": "2026-05-28T17:01:27.251285842", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "tumor_normal_pair": { + "content": [ + [ + "test_out.vcf.gz" + ], + [ + + ], + [ + [ + "VARNET", + "varnet", + "1.0.0" + ] + ] + ], + "timestamp": "2026-05-28T16:46:04.690450597", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/varnet/tests/nextflow.config b/modules/nf-core/varnet/tests/nextflow.config new file mode 100644 index 000000000000..632cba772ce6 --- /dev/null +++ b/modules/nf-core/varnet/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: VARNET { + ext.prefix = { "${meta.id}_out" } + memory = '16GB' + cpus = 1 + // ext.args is no longer needed for the region since it's handled via the input channel + } +} From 49a8dc3293e72511c449cdb3eddf611503ca2d82 Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 29 May 2026 16:25:56 +0800 Subject: [PATCH 02/12] feat: add varnet module --- modules/nf-core/varnet/meta.yml | 121 +++++++++----------------------- 1 file changed, 34 insertions(+), 87 deletions(-) diff --git a/modules/nf-core/varnet/meta.yml b/modules/nf-core/varnet/meta.yml index 0c9dab3ace7f..b164cfae6ea9 100644 --- a/modules/nf-core/varnet/meta.yml +++ b/modules/nf-core/varnet/meta.yml @@ -1,23 +1,23 @@ name: "varnet" -description: DeepSomatic is an extension of deep learning-based variant caller - DeepVariant that takes aligned reads (in BAM or CRAM format) from tumor and - normal data, produces pileup image tensors from them, classifies each tensor - using a convolutional neural network, and finally reports somatic variants in - a standard VCF or gVCF file. +description: VarNet is a deep learning-based somatic variant caller that utilizes + a two-stage filtering and prediction architecture. It processes aligned reads from + tumor and normal data to identify somatic mutations using a deep neural network + approach. keywords: - variant calling - machine learning - neural network + - somatic tools: - "varnet": - description: "A deep learning based somatic variant caller" - homepage: "https://github.com/skandlab/varnet" - documentation: "https://github.com/skandlab/varnet" - tool_dev_url: "https://github.com/skandlab/varnet" + description: "A deep learning-based somatic variant caller" + homepage: "https://github.com/skandlab/VarNet" + documentation: "https://github.com/skandlab/VarNet" + tool_dev_url: "https://github.com/skandlab/VarNet" doi: "10.1038/s41467-022-30584-2" licence: - - "Polyform Non-Commercial" - identifier: "biotools:deepsomatic" + - "MIT" + identifier: "" input: - - meta: type: map @@ -26,63 +26,51 @@ input: e.g. [ id:'test', single_end:false ] - input_normal: type: file - description: BAM/CRAM file - pattern: "*.bam/cram" + description: BAM/CRAM file from normal sample + pattern: "*.{bam,cram}" ontologies: [] - index_normal: type: file - description: Index of BAM/CRAM file - pattern: "*.bai/crai" + description: Index of normal BAM/CRAM file + pattern: "*.{bai,crai}" ontologies: [] - input_tumor: type: file - description: BAM/CRAM file - pattern: "*.bam/cram" + description: BAM/CRAM file from tumor sample + pattern: "*.{bam,cram}" ontologies: [] - index_tumor: type: file - description: Index of BAM/CRAM file - pattern: "*.bai/crai" + description: Index of tumor BAM/CRAM file + pattern: "*.{bai,crai}" ontologies: [] - - meta2: type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + Groovy Map containing reference information - intervals: type: file - description: file containing intervals + description: BED file containing target intervals + pattern: "*.bed" ontologies: [] - - meta3: type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + Groovy Map containing reference information - fasta: type: file description: The reference fasta file - pattern: "*.fasta" + pattern: "*.{fasta,fa}" ontologies: [] - - meta4: type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + Groovy Map containing reference information - fai: type: file description: Index of reference fasta file pattern: "*.fai" ontologies: [] - - - meta5: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - gzi: - type: file - description: GZI index of reference fasta file - pattern: "*.gzi" - ontologies: [] output: vcf: - - meta: @@ -90,69 +78,28 @@ output: description: | Groovy Map containing sample information e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.vcf.gz: - type: file - description: Compressed VCF file - pattern: "*.vcf.gz" - ontologies: - - edam: http://edamontology.org/format_3989 # GZIP format + - ${prefix}/${prefix}.vcf.gz: {} vcf_tbi: - - meta: type: map description: | Groovy Map containing sample information e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.vcf.gz.tbi: - type: file - description: Index of compressed VCF file - pattern: "*.vcf.gz.tbi" - ontologies: [] - gvcf: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.g.vcf.gz: - type: file - description: Compressed GVCF file - pattern: "*.g.vcf.gz" - ontologies: - - edam: http://edamontology.org/format_3989 - gvcf_tbi: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.g.vcf.gz.tbi: - type: file - description: Index of compressed Genotyped VCF file - pattern: "*.g.vcf.gz.tbi" - ontologies: [] - versions_deepsomatic: - - - ${task.process}: - type: string - description: The name of the process - - deepsomatic: - type: string - description: The name of the tool - - 1.7.0: - type: eval - description: The expression to obtain the version of the tool + - ${prefix}/${prefix}.vcf.gz.tbi: {} + versions: + - versions.yml: {} topics: versions: - - ${task.process}: type: string description: The name of the process - - deepsomatic: + - varnet: type: string description: The name of the tool - - 1.7.0: - type: eval + - 1.0.0: + type: string description: The expression to obtain the version of the tool authors: - - "@vaxyzek" + - "@kiranchari" maintainers: - - "@vaxyzek" - + - "@kiranchari" From 90a50bc8863123df0dd174fe5b109747446f1cf8 Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 29 May 2026 16:31:34 +0800 Subject: [PATCH 03/12] feat: add varnet module --- modules/nf-core/varnet/meta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/varnet/meta.yml b/modules/nf-core/varnet/meta.yml index b164cfae6ea9..5a26005d6869 100644 --- a/modules/nf-core/varnet/meta.yml +++ b/modules/nf-core/varnet/meta.yml @@ -14,9 +14,9 @@ tools: homepage: "https://github.com/skandlab/VarNet" documentation: "https://github.com/skandlab/VarNet" tool_dev_url: "https://github.com/skandlab/VarNet" - doi: "10.1038/s41467-022-30584-2" + doi: "10.1038/s41467-022-31765-8" licence: - - "MIT" + - "PolyForm Noncommercial License 1.0.0" identifier: "" input: - - meta: From 2b21805f43ea20e50d5f996f65c3774c66dc00ac Mon Sep 17 00:00:00 2001 From: Kiran Date: Wed, 3 Jun 2026 10:39:24 +0800 Subject: [PATCH 04/12] feat: add varnet module --- modules/nf-core/varnet/main.nf | 15 +---- modules/nf-core/varnet/meta.yml | 67 +++---------------- modules/nf-core/varnet/tests/main.nf.test | 2 - .../nf-core/varnet/tests/main.nf.test.snap | 44 ------------ 4 files changed, 13 insertions(+), 115 deletions(-) diff --git a/modules/nf-core/varnet/main.nf b/modules/nf-core/varnet/main.nf index dc3678510f81..737b9e487406 100644 --- a/modules/nf-core/varnet/main.nf +++ b/modules/nf-core/varnet/main.nf @@ -2,7 +2,6 @@ process VARNET { tag "$meta.id" label 'process_high_memory' - // Using the official VarNet Docker image container "docker.io/kiranchari/varnet:latest" input: @@ -12,8 +11,8 @@ process VARNET { tuple val(meta4), path(fai) output: - tuple val(meta), path("${prefix}/${prefix}.vcf.gz") , emit: vcf - tuple val("${task.process}"), val("varnet"), val("1.0.0"), emit: versions, topic: versions + tuple val(meta), path("${prefix}/${prefix}.vcf.gz"), emit: vcf + tuple val("${task.process}"), val("varnet"), val("1.5.0"), emit: versions_varnet, topic: versions when: task.ext.when == null || task.ext.when @@ -46,11 +45,6 @@ process VARNET { --output_dir \$WORKDIR \\ --processes ${task.cpus} \\ ${args} - - cat <<-END_VERSIONS > \$WORKDIR/versions.yml - "${task.process}": - varnet: 1.5.0 - END_VERSIONS """ stub: @@ -58,11 +52,6 @@ process VARNET { """ mkdir -p ${prefix} echo "" | gzip > ${prefix}/${prefix}.vcf.gz - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - varnet: 1.0.0 - END_VERSIONS """ } diff --git a/modules/nf-core/varnet/meta.yml b/modules/nf-core/varnet/meta.yml index 0c9dab3ace7f..83f4ac9a9563 100644 --- a/modules/nf-core/varnet/meta.yml +++ b/modules/nf-core/varnet/meta.yml @@ -1,9 +1,8 @@ name: "varnet" -description: DeepSomatic is an extension of deep learning-based variant caller - DeepVariant that takes aligned reads (in BAM or CRAM format) from tumor and - normal data, produces pileup image tensors from them, classifies each tensor - using a convolutional neural network, and finally reports somatic variants in - a standard VCF or gVCF file. +description: VarNet is a deep learning based somatic variant caller that takes aligned + reads (in BAM format) from tumor and optionally normal data, produces pileup image + tensors from them, classifies each tensor using a convolutional neural network, and + finally reports somatic variants in a VCF file. keywords: - variant calling - machine learning @@ -17,7 +16,7 @@ tools: doi: "10.1038/s41467-022-30584-2" licence: - "Polyform Non-Commercial" - identifier: "biotools:deepsomatic" + identifier: "" input: - - meta: type: map @@ -73,16 +72,6 @@ input: description: Index of reference fasta file pattern: "*.fai" ontologies: [] - - - meta5: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - gzi: - type: file - description: GZI index of reference fasta file - pattern: "*.gzi" - ontologies: [] output: vcf: - - meta: @@ -96,48 +85,15 @@ output: pattern: "*.vcf.gz" ontologies: - edam: http://edamontology.org/format_3989 # GZIP format - vcf_tbi: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.vcf.gz.tbi: - type: file - description: Index of compressed VCF file - pattern: "*.vcf.gz.tbi" - ontologies: [] - gvcf: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.g.vcf.gz: - type: file - description: Compressed GVCF file - pattern: "*.g.vcf.gz" - ontologies: - - edam: http://edamontology.org/format_3989 - gvcf_tbi: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - ${prefix}.g.vcf.gz.tbi: - type: file - description: Index of compressed Genotyped VCF file - pattern: "*.g.vcf.gz.tbi" - ontologies: [] - versions_deepsomatic: + + versions_varnet: - - ${task.process}: type: string description: The name of the process - - deepsomatic: + - varnet: type: string description: The name of the tool - - 1.7.0: + - "1.5.0": type: eval description: The expression to obtain the version of the tool topics: @@ -145,14 +101,13 @@ topics: - - ${task.process}: type: string description: The name of the process - - deepsomatic: + - varnet: type: string description: The name of the tool - - 1.7.0: + - "1.5.0": type: eval description: The expression to obtain the version of the tool authors: - "@vaxyzek" maintainers: - "@vaxyzek" - diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test index 619b023c7bac..5d5a8e3bcaf5 100644 --- a/modules/nf-core/varnet/tests/main.nf.test +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -43,7 +43,6 @@ nextflow_process { { assert snapshot( process.out.vcf.collect { file(it[1]).getName() }, - process.out.vcf_tbi.collect { file(it[1]).getName() }, process.out.versions ).match() } @@ -87,7 +86,6 @@ test("tumor_only") { { assert snapshot( process.out.vcf.collect { file(it[1]).getName() }, - process.out.vcf_tbi.collect { file(it[1]).getName() }, process.out.versions ).match() } diff --git a/modules/nf-core/varnet/tests/main.nf.test.snap b/modules/nf-core/varnet/tests/main.nf.test.snap index 81427b3cfaf2..7a73a41bfdf7 100644 --- a/modules/nf-core/varnet/tests/main.nf.test.snap +++ b/modules/nf-core/varnet/tests/main.nf.test.snap @@ -1,46 +1,2 @@ { - "tumor_only": { - "content": [ - [ - "test_tumor_only_out.vcf.gz" - ], - [ - - ], - [ - [ - "VARNET", - "varnet", - "1.0.0" - ] - ] - ], - "timestamp": "2026-05-28T17:01:27.251285842", - "meta": { - "nf-test": "0.9.5", - "nextflow": "26.04.0" - } - }, - "tumor_normal_pair": { - "content": [ - [ - "test_out.vcf.gz" - ], - [ - - ], - [ - [ - "VARNET", - "varnet", - "1.0.0" - ] - ] - ], - "timestamp": "2026-05-28T16:46:04.690450597", - "meta": { - "nf-test": "0.9.5", - "nextflow": "26.04.0" - } - } } \ No newline at end of file From 13ff223bc1d7b0dbefdf4b5364d3d4cebd516155 Mon Sep 17 00:00:00 2001 From: kiran Date: Wed, 3 Jun 2026 16:47:56 +0800 Subject: [PATCH 05/12] feat: add varnet module --- .../nf-core/varnet/tests/main.nf.test.snap | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/nf-core/varnet/tests/main.nf.test.snap b/modules/nf-core/varnet/tests/main.nf.test.snap index 7a73a41bfdf7..21b5d279bc19 100644 --- a/modules/nf-core/varnet/tests/main.nf.test.snap +++ b/modules/nf-core/varnet/tests/main.nf.test.snap @@ -1,2 +1,28 @@ { + "tumor_only": { + "content": [ + [ + "test_tumor_only_out.vcf.gz" + ], + null + ], + "timestamp": "2026-06-03T16:15:06.084936823", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } + }, + "tumor_normal_pair": { + "content": [ + [ + "test_out.vcf.gz" + ], + null + ], + "timestamp": "2026-06-03T16:06:07.792304371", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } + } } \ No newline at end of file From c254f8ee0c7045e70d15f1854b276ae6adfd17fd Mon Sep 17 00:00:00 2001 From: Kiran Krishnamachari Date: Wed, 3 Jun 2026 20:11:14 +0800 Subject: [PATCH 06/12] Update modules/nf-core/varnet/tests/main.nf.test Co-authored-by: Maxime U Garcia --- modules/nf-core/varnet/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test index 5d5a8e3bcaf5..f9a55b16b44c 100644 --- a/modules/nf-core/varnet/tests/main.nf.test +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -43,7 +43,7 @@ nextflow_process { { assert snapshot( process.out.vcf.collect { file(it[1]).getName() }, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) From 25f5d0f0bb8ab2654f12f66acbefc1acdde75228 Mon Sep 17 00:00:00 2001 From: Kiran Krishnamachari Date: Wed, 3 Jun 2026 20:11:31 +0800 Subject: [PATCH 07/12] Update modules/nf-core/varnet/tests/main.nf.test Co-authored-by: Maxime U Garcia --- modules/nf-core/varnet/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test index f9a55b16b44c..ee9cca973cb6 100644 --- a/modules/nf-core/varnet/tests/main.nf.test +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -86,7 +86,7 @@ test("tumor_only") { { assert snapshot( process.out.vcf.collect { file(it[1]).getName() }, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) From 148ee0510b3f056cd2802d0c45ad7e17e7188f71 Mon Sep 17 00:00:00 2001 From: Kiran Krishnamachari Date: Wed, 3 Jun 2026 20:11:54 +0800 Subject: [PATCH 08/12] Update modules/nf-core/varnet/tests/nextflow.config Co-authored-by: Maxime U Garcia --- modules/nf-core/varnet/tests/nextflow.config | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/nf-core/varnet/tests/nextflow.config b/modules/nf-core/varnet/tests/nextflow.config index 632cba772ce6..47ac6e1f77fb 100644 --- a/modules/nf-core/varnet/tests/nextflow.config +++ b/modules/nf-core/varnet/tests/nextflow.config @@ -1,8 +1,5 @@ process { withName: VARNET { ext.prefix = { "${meta.id}_out" } - memory = '16GB' - cpus = 1 - // ext.args is no longer needed for the region since it's handled via the input channel } } From 17c3b97b4b08b46f10be1f42262c31aa18ee53a1 Mon Sep 17 00:00:00 2001 From: Kiran Krishnamachari Date: Wed, 3 Jun 2026 20:12:06 +0800 Subject: [PATCH 09/12] Update modules/nf-core/varnet/main.nf Co-authored-by: Maxime U Garcia --- modules/nf-core/varnet/main.nf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/varnet/main.nf b/modules/nf-core/varnet/main.nf index 737b9e487406..ed988f5f0128 100644 --- a/modules/nf-core/varnet/main.nf +++ b/modules/nf-core/varnet/main.nf @@ -5,10 +5,8 @@ process VARNET { container "docker.io/kiranchari/varnet:latest" input: - tuple val(meta), path(input_normal), path(index_normal), path(input_tumor), path(index_tumor) - tuple val(meta2), path(intervals) - tuple val(meta3), path(fasta) - tuple val(meta4), path(fai) + tuple val(meta), path(input_normal), path(index_normal), path(input_tumor), path(index_tumor), path(intervals) + tuple val(meta2), path(fasta), path(fai) output: tuple val(meta), path("${prefix}/${prefix}.vcf.gz"), emit: vcf From 778e19862fb92ed8d30647d9aaf374371d872222 Mon Sep 17 00:00:00 2001 From: Kiran Date: Thu, 4 Jun 2026 11:54:38 +0800 Subject: [PATCH 10/12] feat: add varnet module --- modules/nf-core/varnet/main.nf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/varnet/main.nf b/modules/nf-core/varnet/main.nf index 737b9e487406..b6c6f3621ff6 100644 --- a/modules/nf-core/varnet/main.nf +++ b/modules/nf-core/varnet/main.nf @@ -5,14 +5,14 @@ process VARNET { container "docker.io/kiranchari/varnet:latest" input: - tuple val(meta), path(input_normal), path(index_normal), path(input_tumor), path(index_tumor) + tuple val(meta), path(input_tumor), path(index_tumor), path(input_normal), path(index_normal) tuple val(meta2), path(intervals) tuple val(meta3), path(fasta) tuple val(meta4), path(fai) output: tuple val(meta), path("${prefix}/${prefix}.vcf.gz"), emit: vcf - tuple val("${task.process}"), val("varnet"), val("1.5.0"), emit: versions_varnet, topic: versions + tuple val("${task.process}"), val("varnet"), env(VARNET_VERSION), emit: versions_varnet, topic: versions when: task.ext.when == null || task.ext.when @@ -27,6 +27,7 @@ process VARNET { WORKDIR=\$(pwd) cd /VarNet + export VARNET_VERSION=\$(python -c "from snvs.constants import __VERSION__; print(__VERSION__)") TF_CPP_MIN_LOG_LEVEL=3 python /VarNet/filter.py \\ --sample_name ${prefix} \\ ${normal} \\ @@ -50,6 +51,7 @@ process VARNET { stub: prefix = task.ext.prefix ?: "${meta.id}" """ + export VARNET_VERSION=\$(python -c "from snvs.constants import __VERSION__; print(__VERSION__)") mkdir -p ${prefix} echo "" | gzip > ${prefix}/${prefix}.vcf.gz """ From 540c5bb5d9b60214885faa31071180571ac50ab2 Mon Sep 17 00:00:00 2001 From: kiran Date: Thu, 4 Jun 2026 14:14:11 +0800 Subject: [PATCH 11/12] feat: add varnet module --- modules/nf-core/varnet/main.nf | 2 +- modules/nf-core/varnet/tests/main.nf.test | 13 +++++----- .../nf-core/varnet/tests/main.nf.test.snap | 24 +++++++++++++++---- modules/nf-core/varnet/tests/nextflow.config | 4 ++++ 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/modules/nf-core/varnet/main.nf b/modules/nf-core/varnet/main.nf index b6c6f3621ff6..f89d8810dd30 100644 --- a/modules/nf-core/varnet/main.nf +++ b/modules/nf-core/varnet/main.nf @@ -12,7 +12,7 @@ process VARNET { output: tuple val(meta), path("${prefix}/${prefix}.vcf.gz"), emit: vcf - tuple val("${task.process}"), val("varnet"), env(VARNET_VERSION), emit: versions_varnet, topic: versions + tuple val("${task.process}"), val("varnet"), env("VARNET_VERSION"), emit: versions_varnet, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test index ee9cca973cb6..dca55be44b11 100644 --- a/modules/nf-core/varnet/tests/main.nf.test +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -16,10 +16,10 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) ] input[1] = [ [ id:'test_region' ], @@ -59,10 +59,10 @@ test("tumor_only") { """ input[0] = [ [ id:'test_tumor_only' ], - [], // input_normal is empty - [], // index_normal is empty file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + [], // input_normal is empty + [] // index_normal is empty ] input[1] = [ [ id:'intervals' ], @@ -93,3 +93,4 @@ test("tumor_only") { } } } + diff --git a/modules/nf-core/varnet/tests/main.nf.test.snap b/modules/nf-core/varnet/tests/main.nf.test.snap index 21b5d279bc19..4cce20042478 100644 --- a/modules/nf-core/varnet/tests/main.nf.test.snap +++ b/modules/nf-core/varnet/tests/main.nf.test.snap @@ -4,9 +4,17 @@ [ "test_tumor_only_out.vcf.gz" ], - null + { + "versions_varnet": [ + [ + "VARNET", + "varnet", + "1.5.2" + ] + ] + } ], - "timestamp": "2026-06-03T16:15:06.084936823", + "timestamp": "2026-06-04T14:01:04.66446019", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.3" @@ -17,9 +25,17 @@ [ "test_out.vcf.gz" ], - null + { + "versions_varnet": [ + [ + "VARNET", + "varnet", + "1.5.2" + ] + ] + } ], - "timestamp": "2026-06-03T16:06:07.792304371", + "timestamp": "2026-06-04T13:53:19.433330376", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.3" diff --git a/modules/nf-core/varnet/tests/nextflow.config b/modules/nf-core/varnet/tests/nextflow.config index 47ac6e1f77fb..249b54ffa6a8 100644 --- a/modules/nf-core/varnet/tests/nextflow.config +++ b/modules/nf-core/varnet/tests/nextflow.config @@ -1,5 +1,9 @@ process { withName: VARNET { ext.prefix = { "${meta.id}_out" } + memory = '16GB' + cpus = 1 + // ext.args is no longer needed for the region since it's handled via the input channel + } } From 019557ccc7d35cde00b5b63403f4a2a93feeb399 Mon Sep 17 00:00:00 2001 From: kiran Date: Wed, 10 Jun 2026 14:11:06 +0800 Subject: [PATCH 12/12] feat: add varnet module --- modules/nf-core/varnet/tests/main.nf.test | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/nf-core/varnet/tests/main.nf.test b/modules/nf-core/varnet/tests/main.nf.test index dca55be44b11..5d0589cb2588 100644 --- a/modules/nf-core/varnet/tests/main.nf.test +++ b/modules/nf-core/varnet/tests/main.nf.test @@ -7,9 +7,9 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "varnet" + config './nextflow.config' test("tumor_normal_pair") { - config './nextflow.config' when { process { @@ -52,7 +52,6 @@ nextflow_process { } test("tumor_only") { - config './nextflow.config' when { process {