Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

### Template

- simplify TEMPLATE with nf-core-utils 0.4.0 ([#3870](https://github.com/nf-core/tools/pull/3870))

### Linting

### Modules
Expand Down
3 changes: 2 additions & 1 deletion nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ manifest {
{% if nf_schema -%}
// Nextflow plugins
plugins {
id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id 'nf-core-utils@0.4.0' // Helper functions for pipeline
}

validation {
Expand Down
36 changes: 10 additions & 26 deletions nf_core/pipeline-template/workflows/pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include { MULTIQC } from '../modules/nf-core/multiqc/main'{% endi
include { paramsSummaryMap } from 'plugin/nf-schema'{% endif %}
{%- if multiqc %}
include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline'{% endif %}
include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're not deleting this in the PR here because it needs to be removed upstream and then updated? Is there a corresponding PR in nf-core/modules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually my end goal is to totally remove the need for all utils subworklows and use the nf-core-utils plugin instead.
So no plan to remove from the modules yet, I think I will just let it die there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there should be a separate PR here to actually change the paramsSummaryMultiqc function from the subworkflow to the plugin, and so on...

include { softwareVersionsToYAML } from 'plugin/nf-core-utils'
{%- if citations or multiqc %}
include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_{{ short_name }}_pipeline'{% endif %}
{%- endif %}
Expand Down Expand Up @@ -50,31 +50,15 @@ workflow {{ short_name|upper }} {
//
// Collate and save software versions
//
def topic_versions = Channel.topic("versions")
.distinct()
.branch { entry ->
versions_file: entry instanceof Path
versions_tuple: true
}

def topic_versions_string = topic_versions.versions_tuple
.map { process, tool, version ->
[ process[process.lastIndexOf(':')+1..-1], " ${tool}: ${version}" ]
}
.groupTuple(by:0)
.map { process, tool_versions ->
tool_versions.unique().sort()
"${process}:\n${tool_versions.join('\n')}"
}

softwareVersionsToYAML(ch_versions.mix(topic_versions.versions_file))
.mix(topic_versions_string)
.collectFile(
storeDir: "${params.outdir}/pipeline_info",
name: {% if is_nfcore %}'nf_core_' + {% endif %} '{{ short_name }}_software_' {% if multiqc %} + 'mqc_' {% endif %} + 'versions.yml',
sort: true,
newLine: true
).set { ch_collated_versions }
softwareVersionsToYAML(
softwareVersions: ch_versions.mix(channel.topic("versions")),
nextflowVersion: workflow.nextflow.version
).collectFile(
storeDir: "${params.outdir}/pipeline_info",
name: {% if is_nfcore %}'nf_core_' + {% endif %} '{{ short_name }}_software_' {% if multiqc %} + 'mqc_' {% endif %} + 'versions.yml',
sort: true,
newLine: true,
).set { ch_collated_versions }

{% if multiqc %}
//
Expand Down