+
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
14 changes: 14 additions & 0 deletions nf_core/pipeline-template/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_{{ s
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_{{ short_name }}_pipeline'
{%- if igenomes %}
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_{{ short_name }}_pipeline'
{%- endif %}

// Import nf-core-utils plugin functions
include { getWorkflowVersion } from 'plugin/nf-core-utils'
include { dumpParametersToJSON } from 'plugin/nf-core-utils'
include { checkCondaChannels } from 'plugin/nf-core-utils'
include { completionEmail } from 'plugin/nf-core-utils'
Copy link
Contributor

Choose a reason for hiding this comment

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

needs a {% if email %} wrapper

include { completionSummary } from 'plugin/nf-core-utils'
{%- if adaptivecard or slackreport %}
include { imNotification } from 'plugin/nf-core-utils'
{%- endif %}
include { checkConfigProvided } from 'plugin/nf-core-utils'
include { checkProfileProvided } from 'plugin/nf-core-utils'
{%- if igenomes %}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
18 changes: 1 addition & 17 deletions nf_core/pipeline-template/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,7 @@
}
},
"subworkflows": {
"nf-core": {
"utils_nextflow_pipeline": {
"branch": "master",
"git_sha": "c2b22d85f30a706a3073387f30380704fcae013b",
"installed_by": ["subworkflows"]
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a",
"installed_by": ["subworkflows"]
}{% if nf_schema %},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e",
"installed_by": ["subworkflows"]
}{% endif %}
}
"nf-core": {}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ manifest {
// Nextflow plugins
plugins {
id 'nf-schema@2.4.2' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id 'nf-core-utils@0.3.0' // Utility functions for nf-core pipelines
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
id 'nf-core-utils@0.3.0' // Utility functions for nf-core pipelines
id 'nf-core-utils@1.0.0' // Utility functions for nf-core pipelines

}

validation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

{% if nf_schema %}include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin'
{% if nf_schema %}include { paramsSummaryLog } from 'plugin/nf-schema'
include { validateParameters } from 'plugin/nf-schema'
include { paramsSummaryMap } from 'plugin/nf-schema'
include { samplesheetToList } from 'plugin/nf-schema'{% endif %}
{%- if email %}
include { completionEmail } from '../../nf-core/utils_nfcore_pipeline'
include { completionEmail } from 'plugin/nf-core-utils'
{%- endif %}
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
include { completionSummary } from 'plugin/nf-core-utils'
{%- if adaptivecard or slackreport %}
include { imNotification } from '../../nf-core/utils_nfcore_pipeline'
include { imNotification } from 'plugin/nf-core-utils'
{%- endif %}
include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline'
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
include { checkConfigProvided } from 'plugin/nf-core-utils'
include { checkProfileProvided } from 'plugin/nf-core-utils'
include { getWorkflowVersion } from 'plugin/nf-core-utils'
include { dumpParametersToJSON } from 'plugin/nf-core-utils'
include { checkCondaChannels } from 'plugin/nf-core-utils'
include { processVersionsFromFile } from 'plugin/nf-core-utils'
include { workflowVersionToChannel } from 'plugin/nf-core-utils'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -44,31 +50,36 @@ workflow PIPELINE_INITIALISATION {
//
// Print version and exit if required and dump pipeline parameters to JSON file
//
UTILS_NEXTFLOW_PIPELINE (
version,
true,
outdir,
workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1
)
if (version) {
log.info("${workflow.manifest.name} ${getWorkflowVersion(workflow.manifest.version, workflow.commitId)}")
System.exit(0)
}

if (outdir) {
dumpParametersToJSON(outdir, params)
}

if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
checkCondaChannels()
}

{%- if nf_schema %}

//
// Validate parameters and generate parameter summary to stdout
//
UTILS_NFSCHEMA_PLUGIN (
workflow,
validate_params,
null
)
log.info paramsSummaryLog(workflow)

if (validate_params) {
validateParameters()
}
{%- endif %}

//
// Check config provided to the pipeline
//
UTILS_NFCORE_PIPELINE (
nextflow_cli_args
)
checkConfigProvided()
checkProfileProvided(nextflow_cli_args, monochrome_logs)

{%- if igenomes %}

Expand Down Expand Up @@ -157,7 +168,7 @@ workflow PIPELINE_COMPLETION {
plaintext_email,
outdir,
monochrome_logs,
{% if multiqc %}multiqc_reports.getVal(),{% else %}[]{% endif %}
{% if multiqc %}multiqc_reports.getVal(){% else %}[]{% endif %}
)
}
{%- endif %}
Expand All @@ -182,6 +193,55 @@ workflow PIPELINE_COMPLETION {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//
// Get channel of software versions used in pipeline in YAML format
//
def softwareVersionsToYAML(ch_versions) {
return ch_versions.unique()
.map { version -> processVersionsFromFile([version.toString()]) }
.unique()
.mix(Channel.fromList(workflowVersionToChannel(workflow.session)).map { it ->
"""
Workflow:
${it[1]}: ${it[2]}
""".stripIndent().trim()
})
}

//
// Get workflow summary for MultiQC
//
def paramsSummaryMultiqc(summary_params) {
Comment on lines +211 to +214
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap this whole function inside a {% if multiqc %

def summary_section = ''
summary_params
.keySet()
.each { group ->
def group_params = summary_params.get(group)
// This gets the parameters of that particular group
if (group_params) {
summary_section += " <p style=\"font-size:110%\"><b>${group}</b></p>\n"
summary_section += " <dl class=\"dl-horizontal\">\n"
group_params
.keySet()
.sort()
.each { param ->
summary_section += " <dt>${param}</dt><dd><samp>${group_params.get(param) ?: '<span style=\"color:#999999;\">N/A</a>'}</samp></dd>\n"
}
summary_section += " </dl>\n"
}
}

def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-summary'\n" as String
yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n"
yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n"
yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n"
yaml_file_text += "plot_type: 'html'\n"
yaml_file_text += "data: |\n"
yaml_file_text += "${summary_section}"

return yaml_file_text
}

{%- if igenomes %}
//
// Check and validate pipeline parameters
Expand Down

This file was deleted.

This file was deleted.

Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载