From a24445c1872dea2718d32c105a0dd3b897bb5b99 Mon Sep 17 00:00:00 2001 From: SkyLexS Date: Tue, 12 May 2026 20:16:07 +0300 Subject: [PATCH 1/4] new module DeepMAsED --- .../deepmased/features/environment.yml | 8 ++ modules/nf-core/deepmased/features/main.nf | 54 +++++++++++++ modules/nf-core/deepmased/features/meta.yml | 73 +++++++++++++++++ .../deepmased/features/tests/main.nf.test | 68 ++++++++++++++++ .../nf-core/deepmased/predict/environment.yml | 8 ++ modules/nf-core/deepmased/predict/main.nf | 49 ++++++++++++ modules/nf-core/deepmased/predict/meta.yml | 63 +++++++++++++++ .../deepmased/predict/tests/main.nf.test | 79 +++++++++++++++++++ 8 files changed, 402 insertions(+) create mode 100644 modules/nf-core/deepmased/features/environment.yml create mode 100644 modules/nf-core/deepmased/features/main.nf create mode 100644 modules/nf-core/deepmased/features/meta.yml create mode 100644 modules/nf-core/deepmased/features/tests/main.nf.test create mode 100644 modules/nf-core/deepmased/predict/environment.yml create mode 100644 modules/nf-core/deepmased/predict/main.nf create mode 100644 modules/nf-core/deepmased/predict/meta.yml create mode 100644 modules/nf-core/deepmased/predict/tests/main.nf.test diff --git a/modules/nf-core/deepmased/features/environment.yml b/modules/nf-core/deepmased/features/environment.yml new file mode 100644 index 00000000000..32d715d78e6 --- /dev/null +++ b/modules/nf-core/deepmased/features/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/deepmased + - bioconda::deepmased=0.3.1 diff --git a/modules/nf-core/deepmased/features/main.nf b/modules/nf-core/deepmased/features/main.nf new file mode 100644 index 00000000000..a62ed9da249 --- /dev/null +++ b/modules/nf-core/deepmased/features/main.nf @@ -0,0 +1,54 @@ +process DEEPMASED_FEATURES { + tag "$meta.id" + label 'process_high' + + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deepmased:0.3.1--pyh5ca1d4c_0': + 'biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" + + input: + tuple val(meta), path(bam), path(bai), path(fasta) + + output: + tuple val(meta), path("${prefix}_feature_file_paths.tsv"), path("*_feats.tsv"), emit: features + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.3.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + echo -e "bam\\tfasta" > ${prefix}_file_paths.tsv + echo -e "${bam}\\t${fasta}" >> ${prefix}_file_paths.tsv + + DeepMAsED features \\ + ${prefix}_file_paths.tsv \\ + -p ${task.cpus} \\ + -o . \\ + -n ${prefix}_feature_file_paths.tsv \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepmased: $VERSION + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.3.1' + """ + touch ${prefix}_feature_file_paths.tsv + touch ${prefix}_feats.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepmased: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/deepmased/features/meta.yml b/modules/nf-core/deepmased/features/meta.yml new file mode 100644 index 00000000000..0e26e356745 --- /dev/null +++ b/modules/nf-core/deepmased/features/meta.yml @@ -0,0 +1,73 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "deepmased_features" +description: "DeepMAsED features subcommand: extracts alignment-based features from BAM and assembly FASTA for each contig, producing feature tables used as input for DeepMAsED predict." +keywords: + - metagenomics + - assembly + - quality control + - error detection + - deep learning + - features +tools: + - "deepmased": + description: "Deep learning for Metagenome Assembly Error Detection" + homepage: "https://github.com/leylabmpi/DeepMAsED" + documentation: "https://github.com/leylabmpi/DeepMAsED" + tool_dev_url: "https://github.com/leylabmpi/DeepMAsED" + doi: "10.1093/bioinformatics/btaa386" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - bam: + type: file + description: Sorted BAM file of reads mapped to the assembly + pattern: "*.{bam}" + ontologies: + - edam: "http://edamontology.org/format_2572" # BAM + - bai: + type: file + description: BAM index file + pattern: "*.{bai}" + - fasta: + type: file + description: Assembly in FASTA format + pattern: "*.{fasta,fa,fna}" + ontologies: + - edam: "http://edamontology.org/format_1929" # FASTA + +output: + features: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*_feature_file_paths.tsv": + type: file + description: Index file listing all generated feature table files + pattern: "*_feature_file_paths.tsv" + ontologies: + - edam: "http://edamontology.org/format_3475" # TSV + - "*_feats.tsv": + type: file + description: Per-contig feature tables (one per parallel bin) + pattern: "*_feats.tsv" + ontologies: + - edam: "http://edamontology.org/format_3475" # TSV + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" # YAML +authors: + - "@SkyLexS" +maintainers: + - "@SkyLexS" diff --git a/modules/nf-core/deepmased/features/tests/main.nf.test b/modules/nf-core/deepmased/features/tests/main.nf.test new file mode 100644 index 00000000000..facdf1dcc8b --- /dev/null +++ b/modules/nf-core/deepmased/features/tests/main.nf.test @@ -0,0 +1,68 @@ +// nf-core modules test deepmased/features +nextflow_process { + + name "Test Process DEEPMASED_FEATURES" + script "../main.nf" + process "DEEPMASED_FEATURES" + + tag "modules" + tag "modules_nfcore" + tag "deepmased" + tag "deepmased_features" + + test("sarscov2 [fasta] - paired-end sorted bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert path(process.out.features[0][1]).exists() }, + { assert path(process.out.features[0][1]).readLines().size() > 1 } + ) + } + + } + + test("sarscov2 [fasta] - paired-end sorted bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/deepmased/predict/environment.yml b/modules/nf-core/deepmased/predict/environment.yml new file mode 100644 index 00000000000..32d715d78e6 --- /dev/null +++ b/modules/nf-core/deepmased/predict/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/deepmased + - bioconda::deepmased=0.3.1 diff --git a/modules/nf-core/deepmased/predict/main.nf b/modules/nf-core/deepmased/predict/main.nf new file mode 100644 index 00000000000..772884d0645 --- /dev/null +++ b/modules/nf-core/deepmased/predict/main.nf @@ -0,0 +1,49 @@ +process DEEPMASED_PREDICT { + tag "$meta.id" + label 'process_medium' + + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deepmased:0.3.1--pyh5ca1d4c_0': + 'biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" + + input: + tuple val(meta), path(feature_file_table), path(feature_files) + + output: + tuple val(meta), path("*_deepmased_predictions.tsv"), emit: predictions + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '--cpu-only' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.3.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + DeepMAsED predict \\ + ${feature_file_table} \\ + --n-procs ${task.cpus} \\ + --save-name ${prefix}_deepmased \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepmased: $VERSION + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.3.1' + """ + touch ${prefix}_deepmased_predictions.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepmased: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/deepmased/predict/meta.yml b/modules/nf-core/deepmased/predict/meta.yml new file mode 100644 index 00000000000..06be3afe4b0 --- /dev/null +++ b/modules/nf-core/deepmased/predict/meta.yml @@ -0,0 +1,63 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "deepmased_predict" +description: "DeepMAsED predict subcommand: runs the pre-trained deep learning model on feature tables produced by DeepMAsED features to predict per-contig assembly error scores." +keywords: + - metagenomics + - assembly + - quality control + - error detection + - deep learning + - prediction +tools: + - "deepmased": + description: "Deep learning for Metagenome Assembly Error Detection" + homepage: "https://github.com/leylabmpi/DeepMAsED" + documentation: "https://github.com/leylabmpi/DeepMAsED" + tool_dev_url: "https://github.com/leylabmpi/DeepMAsED" + doi: "10.1093/bioinformatics/btaa386" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - feature_file_table: + type: file + description: Index TSV file listing all feature table files (output of deepmased/features) + pattern: "*_feature_file_paths.tsv" + ontologies: + - edam: "http://edamontology.org/format_3475" # TSV + - feature_files: + type: file + description: Per-contig feature table files (output of deepmased/features) + pattern: "*_feats.tsv" + ontologies: + - edam: "http://edamontology.org/format_3475" # TSV + +output: + predictions: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*_deepmased_predictions.tsv": + type: file + description: TSV file containing per-contig assembly error predictions (score 0=correct, 1=misassembly) + pattern: "*_deepmased_predictions.tsv" + ontologies: + - edam: "http://edamontology.org/format_3475" # TSV + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" # YAML +authors: + - "@SkyLexS" +maintainers: + - "@SkyLexS" diff --git a/modules/nf-core/deepmased/predict/tests/main.nf.test b/modules/nf-core/deepmased/predict/tests/main.nf.test new file mode 100644 index 00000000000..0d829848b12 --- /dev/null +++ b/modules/nf-core/deepmased/predict/tests/main.nf.test @@ -0,0 +1,79 @@ +// nf-core modules test deepmased/predict +nextflow_process { + + name "Test Process DEEPMASED_PREDICT" + script "../main.nf" + process "DEEPMASED_PREDICT" + + tag "modules" + tag "modules_nfcore" + tag "deepmased" + tag "deepmased_predict" + + // DEEPMASED_PREDICT requires feature tables produced by DEEPMASED_FEATURES. + // The setup block runs DEEPMASED_FEATURES first to generate the required input. + setup { + run("DEEPMASED_FEATURES") { + script "../../features/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + ] + """ + } + } + } + + test("sarscov2 [fasta] - paired-end sorted bam") { + + when { + process { + """ + input[0] = DEEPMASED_FEATURES.out.features + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert path(process.out.predictions[0][1]).exists() } + ) + } + + } + + test("sarscov2 [fasta] - paired-end sorted bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), // reused as dummy feature_file_table + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), // reused as dummy feature_files + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } + ) + } + + } + +} From ba92c8169d0df2eea64130148af34a8547890304 Mon Sep 17 00:00:00 2001 From: SkyLexS Date: Wed, 13 May 2026 10:12:02 +0300 Subject: [PATCH 2/4] fixing tests and adding snapshots --- modules/nf-core/deepmased/features/main.nf | 17 +--- modules/nf-core/deepmased/features/meta.yml | 47 ++++++---- .../deepmased/features/tests/main.nf.test | 6 +- .../features/tests/main.nf.test.snap | 92 +++++++++++++++++++ modules/nf-core/deepmased/predict/main.nf | 17 +--- modules/nf-core/deepmased/predict/meta.yml | 48 ++++++---- .../deepmased/predict/tests/main.nf.test | 53 ++--------- .../deepmased/predict/tests/main.nf.test.snap | 45 +++++++++ 8 files changed, 218 insertions(+), 107 deletions(-) create mode 100644 modules/nf-core/deepmased/features/tests/main.nf.test.snap create mode 100644 modules/nf-core/deepmased/predict/tests/main.nf.test.snap diff --git a/modules/nf-core/deepmased/features/main.nf b/modules/nf-core/deepmased/features/main.nf index a62ed9da249..d46ef618150 100644 --- a/modules/nf-core/deepmased/features/main.nf +++ b/modules/nf-core/deepmased/features/main.nf @@ -6,14 +6,15 @@ process DEEPMASED_FEATURES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deepmased:0.3.1--pyh5ca1d4c_0': - 'biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" + 'quay.io/biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" input: tuple val(meta), path(bam), path(bai), path(fasta) output: tuple val(meta), path("${prefix}_feature_file_paths.tsv"), path("*_feats.tsv"), emit: features - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('deepmased'), val('0.3.1'), topic: versions, emit: versions_deepmased_features + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. when: task.ext.when == null || task.ext.when @@ -21,7 +22,6 @@ process DEEPMASED_FEATURES { script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.3.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ echo -e "bam\\tfasta" > ${prefix}_file_paths.tsv echo -e "${bam}\\t${fasta}" >> ${prefix}_file_paths.tsv @@ -32,23 +32,12 @@ process DEEPMASED_FEATURES { -o . \\ -n ${prefix}_feature_file_paths.tsv \\ ${args} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - deepmased: $VERSION - END_VERSIONS """ stub: prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.3.1' """ touch ${prefix}_feature_file_paths.tsv touch ${prefix}_feats.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - deepmased: $VERSION - END_VERSIONS """ } diff --git a/modules/nf-core/deepmased/features/meta.yml b/modules/nf-core/deepmased/features/meta.yml index 0e26e356745..0e2a95cc5fe 100644 --- a/modules/nf-core/deepmased/features/meta.yml +++ b/modules/nf-core/deepmased/features/meta.yml @@ -1,6 +1,7 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "deepmased_features" -description: "DeepMAsED features subcommand: extracts alignment-based features from BAM and assembly FASTA for each contig, producing feature tables used as input for DeepMAsED predict." +description: "DeepMAsED features subcommand: extracts alignment-based features from + BAM and assembly FASTA for each contig, producing feature tables used as input for + DeepMAsED predict." keywords: - metagenomics - assembly @@ -15,9 +16,9 @@ tools: documentation: "https://github.com/leylabmpi/DeepMAsED" tool_dev_url: "https://github.com/leylabmpi/DeepMAsED" doi: "10.1093/bioinformatics/btaa386" - licence: ["MIT"] + licence: + - "MIT" identifier: "" - input: - - meta: type: map @@ -29,18 +30,18 @@ input: description: Sorted BAM file of reads mapped to the assembly pattern: "*.{bam}" ontologies: - - edam: "http://edamontology.org/format_2572" # BAM + - edam: "http://edamontology.org/format_2572" - bai: type: file description: BAM index file pattern: "*.{bai}" + ontologies: [] - fasta: type: file description: Assembly in FASTA format pattern: "*.{fasta,fa,fna}" ontologies: - - edam: "http://edamontology.org/format_1929" # FASTA - + - edam: "http://edamontology.org/format_1929" output: features: - - meta: @@ -48,25 +49,39 @@ output: description: | Groovy Map containing sample information e.g. `[ id:'sample1' ]` - - "*_feature_file_paths.tsv": + - ${prefix}_feature_file_paths.tsv: type: file description: Index file listing all generated feature table files pattern: "*_feature_file_paths.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" # TSV + - edam: "http://edamontology.org/format_3475" - "*_feats.tsv": type: file description: Per-contig feature tables (one per parallel bin) pattern: "*_feats.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" # TSV + - edam: "http://edamontology.org/format_3475" + versions_deepmased_features: + - - ${task.process}: + type: string + description: The name of the process + - deepmased: + type: string + description: The name of the tool + - 0.3.1: + type: string + description: The expression to obtain the version of the tool +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: "http://edamontology.org/format_3750" # YAML + - - ${task.process}: + type: string + description: The name of the process + - deepmased: + type: string + description: The name of the tool + - 0.3.1: + type: string + description: The expression to obtain the version of the tool authors: - "@SkyLexS" maintainers: diff --git a/modules/nf-core/deepmased/features/tests/main.nf.test b/modules/nf-core/deepmased/features/tests/main.nf.test index facdf1dcc8b..624b31d2f14 100644 --- a/modules/nf-core/deepmased/features/tests/main.nf.test +++ b/modules/nf-core/deepmased/features/tests/main.nf.test @@ -8,6 +8,7 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "deepmased" + tag "deepmased/features" tag "deepmased_features" test("sarscov2 [fasta] - paired-end sorted bam") { @@ -56,10 +57,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out, - path(process.out.versions[0]).yaml - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/deepmased/features/tests/main.nf.test.snap b/modules/nf-core/deepmased/features/tests/main.nf.test.snap new file mode 100644 index 00000000000..1bb10f9913e --- /dev/null +++ b/modules/nf-core/deepmased/features/tests/main.nf.test.snap @@ -0,0 +1,92 @@ +{ + "sarscov2 [fasta] - paired-end sorted bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_feature_file_paths.tsv:md5,4eceace937a13c4318294cee72cb4320", + "test.paired_end.sorted_feats.tsv:md5,81bc5e8ac16d47ea7fde1c07a92fbba3" + ] + ], + "1": [ + [ + "DEEPMASED_FEATURES", + "deepmased", + "0.3.1" + ] + ], + "features": [ + [ + { + "id": "test", + "single_end": false + }, + "test_feature_file_paths.tsv:md5,4eceace937a13c4318294cee72cb4320", + "test.paired_end.sorted_feats.tsv:md5,81bc5e8ac16d47ea7fde1c07a92fbba3" + ] + ], + "versions_deepmased_features": [ + [ + "DEEPMASED_FEATURES", + "deepmased", + "0.3.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-05-13T09:59:49.966230332" + }, + "sarscov2 [fasta] - paired-end sorted bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_feature_file_paths.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_feats.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "DEEPMASED_FEATURES", + "deepmased", + "0.3.1" + ] + ], + "features": [ + [ + { + "id": "test", + "single_end": false + }, + "test_feature_file_paths.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_feats.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_deepmased_features": [ + [ + "DEEPMASED_FEATURES", + "deepmased", + "0.3.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-05-13T10:04:26.105533827" + } +} \ No newline at end of file diff --git a/modules/nf-core/deepmased/predict/main.nf b/modules/nf-core/deepmased/predict/main.nf index 772884d0645..a676cc317a3 100644 --- a/modules/nf-core/deepmased/predict/main.nf +++ b/modules/nf-core/deepmased/predict/main.nf @@ -6,14 +6,15 @@ process DEEPMASED_PREDICT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/deepmased:0.3.1--pyh5ca1d4c_0': - 'biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" + 'quay.io/biocontainers/deepmased:0.3.1--pyh5ca1d4c_0' }" input: tuple val(meta), path(feature_file_table), path(feature_files) output: tuple val(meta), path("*_deepmased_predictions.tsv"), emit: predictions - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('deepmased'), val('0.3.1'), topic: versions, emit: versions_deepmased_predict + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. when: task.ext.when == null || task.ext.when @@ -21,29 +22,17 @@ process DEEPMASED_PREDICT { script: def args = task.ext.args ?: '--cpu-only' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.3.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ DeepMAsED predict \\ ${feature_file_table} \\ --n-procs ${task.cpus} \\ --save-name ${prefix}_deepmased \\ ${args} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - deepmased: $VERSION - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.3.1' """ touch ${prefix}_deepmased_predictions.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - deepmased: $VERSION - END_VERSIONS """ } diff --git a/modules/nf-core/deepmased/predict/meta.yml b/modules/nf-core/deepmased/predict/meta.yml index 06be3afe4b0..d7026027129 100644 --- a/modules/nf-core/deepmased/predict/meta.yml +++ b/modules/nf-core/deepmased/predict/meta.yml @@ -1,6 +1,7 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "deepmased_predict" -description: "DeepMAsED predict subcommand: runs the pre-trained deep learning model on feature tables produced by DeepMAsED features to predict per-contig assembly error scores." +description: "DeepMAsED predict subcommand: runs the pre-trained deep learning model + on feature tables produced by DeepMAsED features to predict per-contig assembly + error scores." keywords: - metagenomics - assembly @@ -15,9 +16,9 @@ tools: documentation: "https://github.com/leylabmpi/DeepMAsED" tool_dev_url: "https://github.com/leylabmpi/DeepMAsED" doi: "10.1093/bioinformatics/btaa386" - licence: ["MIT"] + licence: + - "MIT" identifier: "" - input: - - meta: type: map @@ -26,17 +27,17 @@ input: e.g. `[ id:'sample1' ]` - feature_file_table: type: file - description: Index TSV file listing all feature table files (output of deepmased/features) + description: Index TSV file listing all feature table files (output of + deepmased/features) pattern: "*_feature_file_paths.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" # TSV + - edam: "http://edamontology.org/format_3475" - feature_files: type: file description: Per-contig feature table files (output of deepmased/features) pattern: "*_feats.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" # TSV - + - edam: "http://edamontology.org/format_3475" output: predictions: - - meta: @@ -46,17 +47,32 @@ output: e.g. `[ id:'sample1' ]` - "*_deepmased_predictions.tsv": type: file - description: TSV file containing per-contig assembly error predictions (score 0=correct, 1=misassembly) + description: TSV file containing per-contig assembly error predictions + (score 0=correct, 1=misassembly) pattern: "*_deepmased_predictions.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" # TSV + - edam: "http://edamontology.org/format_3475" + versions_deepmased_predict: + - - ${task.process}: + type: string + description: The name of the process + - deepmased: + type: string + description: The name of the tool + - 0.3.1: + type: string + description: The expression to obtain the version of the tool +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: "http://edamontology.org/format_3750" # YAML + - - ${task.process}: + type: string + description: The name of the process + - deepmased: + type: string + description: The name of the tool + - 0.3.1: + type: string + description: The expression to obtain the version of the tool authors: - "@SkyLexS" maintainers: diff --git a/modules/nf-core/deepmased/predict/tests/main.nf.test b/modules/nf-core/deepmased/predict/tests/main.nf.test index 0d829848b12..88585e9e756 100644 --- a/modules/nf-core/deepmased/predict/tests/main.nf.test +++ b/modules/nf-core/deepmased/predict/tests/main.nf.test @@ -8,45 +8,15 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "deepmased" + tag "deepmased/features" + tag "deepmased/predict" tag "deepmased_predict" - // DEEPMASED_PREDICT requires feature tables produced by DEEPMASED_FEATURES. - // The setup block runs DEEPMASED_FEATURES first to generate the required input. - setup { - run("DEEPMASED_FEATURES") { - script "../../features/main.nf" - process { - """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), - ] - """ - } - } - } - - test("sarscov2 [fasta] - paired-end sorted bam") { - - when { - process { - """ - input[0] = DEEPMASED_FEATURES.out.features - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert path(process.out.predictions[0][1]).exists() } - ) - } - - } + // NOTE: DeepMAsED is designed for metagenome assemblies with sufficient read + // coverage per contig. The standard sarscov2 test data results in 0 contigs + // after coverage filtering, causing predict to crash (IndexError). + // A full integration test requires metagenome BAM + assembly data. + // The stub test below verifies module structure and output file naming. test("sarscov2 [fasta] - paired-end sorted bam - stub") { @@ -57,8 +27,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), // reused as dummy feature_file_table - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), // reused as dummy feature_files + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), // dummy feature_file_table + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), // dummy feature_files ] """ } @@ -67,10 +37,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out, - path(process.out.versions[0]).yaml - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/deepmased/predict/tests/main.nf.test.snap b/modules/nf-core/deepmased/predict/tests/main.nf.test.snap new file mode 100644 index 00000000000..986fd80711d --- /dev/null +++ b/modules/nf-core/deepmased/predict/tests/main.nf.test.snap @@ -0,0 +1,45 @@ +{ + "sarscov2 [fasta] - paired-end sorted bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_deepmased_predictions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + "DEEPMASED_PREDICT", + "deepmased", + "0.3.1" + ] + ], + "predictions": [ + [ + { + "id": "test", + "single_end": false + }, + "test_deepmased_predictions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_deepmased_predict": [ + [ + "DEEPMASED_PREDICT", + "deepmased", + "0.3.1" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-05-13T10:04:37.332248142" + } +} \ No newline at end of file From ca1eac31c46f1df183f1f72c0fd5cd69c05702f9 Mon Sep 17 00:00:00 2001 From: SkyLexS Date: Wed, 13 May 2026 12:48:02 +0300 Subject: [PATCH 3/4] added setuptools to env file --- modules/nf-core/deepmased/features/environment.yml | 1 + modules/nf-core/deepmased/predict/environment.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/nf-core/deepmased/features/environment.yml b/modules/nf-core/deepmased/features/environment.yml index 32d715d78e6..f9d10dc8036 100644 --- a/modules/nf-core/deepmased/features/environment.yml +++ b/modules/nf-core/deepmased/features/environment.yml @@ -6,3 +6,4 @@ channels: dependencies: # renovate: datasource=conda depName=bioconda/deepmased - bioconda::deepmased=0.3.1 + - conda-forge::setuptools diff --git a/modules/nf-core/deepmased/predict/environment.yml b/modules/nf-core/deepmased/predict/environment.yml index 32d715d78e6..f9d10dc8036 100644 --- a/modules/nf-core/deepmased/predict/environment.yml +++ b/modules/nf-core/deepmased/predict/environment.yml @@ -6,3 +6,4 @@ channels: dependencies: # renovate: datasource=conda depName=bioconda/deepmased - bioconda::deepmased=0.3.1 + - conda-forge::setuptools From 7f6909ee11dc03981ac2a6a8d5cfec926397b3c1 Mon Sep 17 00:00:00 2001 From: SkyLexS Date: Wed, 13 May 2026 13:08:44 +0300 Subject: [PATCH 4/4] linting error fix --- modules/nf-core/deepmased/features/environment.yml | 2 +- modules/nf-core/deepmased/predict/environment.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/deepmased/features/environment.yml b/modules/nf-core/deepmased/features/environment.yml index f9d10dc8036..b39e8d5e911 100644 --- a/modules/nf-core/deepmased/features/environment.yml +++ b/modules/nf-core/deepmased/features/environment.yml @@ -6,4 +6,4 @@ channels: dependencies: # renovate: datasource=conda depName=bioconda/deepmased - bioconda::deepmased=0.3.1 - - conda-forge::setuptools + - conda-forge::setuptools=78.1 diff --git a/modules/nf-core/deepmased/predict/environment.yml b/modules/nf-core/deepmased/predict/environment.yml index f9d10dc8036..b39e8d5e911 100644 --- a/modules/nf-core/deepmased/predict/environment.yml +++ b/modules/nf-core/deepmased/predict/environment.yml @@ -6,4 +6,4 @@ channels: dependencies: # renovate: datasource=conda depName=bioconda/deepmased - bioconda::deepmased=0.3.1 - - conda-forge::setuptools + - conda-forge::setuptools=78.1