diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef51b9962..e9a7c97a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ ### Subworkflows +- Fix bug: missing subworkflow name when using `nf-core subworkflows create` ([#2435](https://github.com/nf-core/tools/pull/2435)) + ### General - Initialise `docker_image_name` to fix `UnboundLocalError` error ([#2374](https://github.com/nf-core/tools/pull/2374)) diff --git a/nf_core/subworkflow-template/subworkflows/main.nf b/nf_core/subworkflow-template/subworkflows/main.nf index dfebaa94fe..eb80856662 100644 --- a/nf_core/subworkflow-template/subworkflows/main.nf +++ b/nf_core/subworkflow-template/subworkflows/main.nf @@ -7,7 +7,7 @@ include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' -workflow {{ subworkflow_name|upper }} { +workflow {{ component_name_underscore|upper }} { take: // TODO nf-core: edit input (take) channels diff --git a/nf_core/subworkflow-template/subworkflows/meta.yml b/nf_core/subworkflow-template/subworkflows/meta.yml index cea20e2adf..cb77dc23a3 100644 --- a/nf_core/subworkflow-template/subworkflows/meta.yml +++ b/nf_core/subworkflow-template/subworkflows/meta.yml @@ -1,5 +1,5 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: "{{ subworkflow_name }}" +name: "{{ component_name_underscore }}" ## TODO nf-core: Add a description of the subworkflow and list keywords description: Sort SAM/BAM/CRAM file keywords: diff --git a/nf_core/subworkflow-template/tests/main.nf b/nf_core/subworkflow-template/tests/main.nf index f8c9b10dcb..e09cc50af8 100644 --- a/nf_core/subworkflow-template/tests/main.nf +++ b/nf_core/subworkflow-template/tests/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { {{ subworkflow_name|upper }} } from '../../../../subworkflows/{{ org }}/{{ subworkflow_dir }}/main.nf' +include { {{ component_name_underscore|upper }} } from '../../../../subworkflows/{{ org }}/{{ subworkflow_dir }}/main.nf' workflow test_{{ component_name_underscore }} { {% if has_meta %} @@ -14,5 +14,5 @@ workflow test_{{ component_name_underscore }} { input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) {%- endif %} - {{ subworkflow_name|upper }} ( input ) + {{ component_name_underscore|upper }} ( input ) } diff --git a/nf_core/subworkflow-template/tests/test.yml b/nf_core/subworkflow-template/tests/test.yml index 23059412da..7bca1616f3 100644 --- a/nf_core/subworkflow-template/tests/test.yml +++ b/nf_core/subworkflow-template/tests/test.yml @@ -1,12 +1,12 @@ ## TODO nf-core: Please run the following command to build this file: -# nf-core subworkflows create-test-yml {{ subworkflow_name_underscore }} -- name: "{{ subworkflow_name }}" - command: nextflow run ./tests/subworkflows/{{ org }}/{{ subworkflow_dir }} -entry test_{{ subworkflow_name }} -c ./tests/config/nextflow.config +# nf-core subworkflows create-test-yml {{ component_name_underscore }} +- name: "{{ component_name_underscore }}" + command: nextflow run ./tests/subworkflows/{{ org }}/{{ subworkflow_dir }} -entry test_{{ component_name_underscore }} -c ./tests/config/nextflow.config tags: - "subworkflows" - - "subworkflows/{{ subworkflow_name }}" + - "subworkflows/{{ component_name_underscore }}" files: - - path: "output/{{ subworkflow_name }}/test.bam" + - path: "output/{{ component_name_underscore }}/test.bam" md5sum: e667c7caad0bc4b7ac383fd023c654fc - - path: output/{{ subworkflow_name }}/versions.yml + - path: output/{{ component_name_underscore }}/versions.yml md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b