From 91f5612ebd2073e584f2e7c0d7b332575c39a06a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:00:17 +0000 Subject: [PATCH 1/2] Initial plan From cfd203145fe04610409c57578ead5d765ab0eb87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:08:36 +0000 Subject: [PATCH 2/2] feat(modules): add new refinegems module scaffold with stub test --- modules/nf-core/refinegems/environment.yml | 10 ++++ modules/nf-core/refinegems/main.nf | 45 +++++++++++++++++ modules/nf-core/refinegems/meta.yml | 48 +++++++++++++++++++ modules/nf-core/refinegems/tests/main.nf.test | 30 ++++++++++++ .../refinegems/tests/main.nf.test.snap | 37 ++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 modules/nf-core/refinegems/environment.yml create mode 100644 modules/nf-core/refinegems/main.nf create mode 100644 modules/nf-core/refinegems/meta.yml create mode 100644 modules/nf-core/refinegems/tests/main.nf.test create mode 100644 modules/nf-core/refinegems/tests/main.nf.test.snap diff --git a/modules/nf-core/refinegems/environment.yml b/modules/nf-core/refinegems/environment.yml new file mode 100644 index 000000000000..41b89f777539 --- /dev/null +++ b/modules/nf-core/refinegems/environment.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - conda-forge::python=3.10.19 + - conda-forge::pip=25.2 + - pip: + - refineGEMs==0.1.23 diff --git a/modules/nf-core/refinegems/main.nf b/modules/nf-core/refinegems/main.nf new file mode 100644 index 000000000000..21ca114f7537 --- /dev/null +++ b/modules/nf-core/refinegems/main.nf @@ -0,0 +1,45 @@ +process REFINEGEMS { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/python:3.10.16' : + 'docker.io/library/python:3.10-slim' }" + + input: + tuple val(meta), val(config_type) + + output: + tuple val(meta), path("*.yaml"), emit: yaml + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + refinegems setup config \\ + --type ${config_type} \\ + --filename ${prefix}.yaml \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + refinegems: \$(refinegems --version | sed -E 's/.*([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.yaml + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + refinegems: 0.1.23 + END_VERSIONS + """ +} diff --git a/modules/nf-core/refinegems/meta.yml b/modules/nf-core/refinegems/meta.yml new file mode 100644 index 000000000000..429864ed1b3f --- /dev/null +++ b/modules/nf-core/refinegems/meta.yml @@ -0,0 +1,48 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "refinegems" +description: Download a default refineGEMs configuration YAML file. +keywords: + - config + - yaml + - metabolic model + - genome-scale metabolic model +tools: + - refinegems: + description: A toolbox for fast curation and analysis of genome-scale metabolic models. + homepage: https://github.com/draeger-lab/refinegems + documentation: https://refinegems.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/draeger-lab/refinegems + licence: ["MIT"] +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - config_type: + type: string + description: Type of config file to download. One of `media` or `refinegems`. +output: + yaml: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.yaml": + type: file + description: A refineGEMs configuration YAML file. + pattern: "*.yaml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML +authors: + - "@brovolia" +maintainers: + - "@brovolia" diff --git a/modules/nf-core/refinegems/tests/main.nf.test b/modules/nf-core/refinegems/tests/main.nf.test new file mode 100644 index 000000000000..c3ed8f7fb694 --- /dev/null +++ b/modules/nf-core/refinegems/tests/main.nf.test @@ -0,0 +1,30 @@ +nextflow_process { + + name "Test Process REFINEGEMS" + script "../main.nf" + process "REFINEGEMS" + + tag "modules" + tag "modules_nfcore" + tag "refinegems" + + test("test-refinegems-stub") { + options '-stub' + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], 'refinegems' ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/refinegems/tests/main.nf.test.snap b/modules/nf-core/refinegems/tests/main.nf.test.snap new file mode 100644 index 000000000000..baf1d7b0a419 --- /dev/null +++ b/modules/nf-core/refinegems/tests/main.nf.test.snap @@ -0,0 +1,37 @@ +{ + "test-refinegems-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.yaml:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,998d15a0141fca0a296d2b5e50e95a40" + ], + "yaml": [ + [ + { + "id": "test", + "single_end": false + }, + "test.yaml:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,998d15a0141fca0a296d2b5e50e95a40" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2026-06-09T10:30:00.000000" + } +}