Skip to content

Commit

Permalink
Merge pull request #2435 from mirpedrol/fix-subworkflows-create-name
Browse files Browse the repository at this point in the history
fix subworkflow template jinja variable for subworkflow name
  • Loading branch information
mirpedrol authored Sep 25, 2023
2 parents aa7e69b + b156469 commit 54d06e8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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))
Expand Down
2 changes: 1 addition & 1 deletion nf_core/subworkflow-template/subworkflows/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nf_core/subworkflow-template/subworkflows/meta.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions nf_core/subworkflow-template/tests/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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 )
}
12 changes: 6 additions & 6 deletions nf_core/subworkflow-template/tests/test.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 54d06e8

Please sign in to comment.