From 33f66e0b2612df417ba94e89ce4c3770258d674b Mon Sep 17 00:00:00 2001 From: Vladimir Mikryukov Date: Mon, 16 Oct 2023 16:30:20 +0300 Subject: [PATCH 1/4] Update `sourmash` modules to 4.8.4 (#4008) * upd `sourmash` modules to 4.8.4 * `sourmash` - fix resource labels, specify cpus --- modules/nf-core/sourmash/compare/main.nf | 10 +++++----- modules/nf-core/sourmash/gather/main.nf | 8 ++++---- modules/nf-core/sourmash/index/main.nf | 6 +++--- modules/nf-core/sourmash/sketch/main.nf | 8 ++++---- modules/nf-core/sourmash/taxannotate/main.nf | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/nf-core/sourmash/compare/main.nf b/modules/nf-core/sourmash/compare/main.nf index 63e5deda7ec..757ab002dc6 100644 --- a/modules/nf-core/sourmash/compare/main.nf +++ b/modules/nf-core/sourmash/compare/main.nf @@ -1,11 +1,11 @@ process SOURMASH_COMPARE { tag "$meta.id" - label 'process_single' + label 'process_low' - conda "bioconda::sourmash=4.6.1" + conda "bioconda::sourmash=4.8.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': - 'biocontainers/sourmash:4.6.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/sourmash:4.8.4--hdfd78af_0': + 'biocontainers/sourmash:4.8.4--hdfd78af_0' }" input: tuple val(meta), path(signatures) @@ -33,7 +33,7 @@ process SOURMASH_COMPARE { """ sourmash compare \\ $args \\ - --processes $task.cpus \\ + --processes ${task.cpus} \\ ${comp} \\ ${csv} \\ ${ffile} \\ diff --git a/modules/nf-core/sourmash/gather/main.nf b/modules/nf-core/sourmash/gather/main.nf index 7e07e161691..8bdbf150bc5 100644 --- a/modules/nf-core/sourmash/gather/main.nf +++ b/modules/nf-core/sourmash/gather/main.nf @@ -1,11 +1,11 @@ process SOURMASH_GATHER { tag "$meta.id" - label 'process_low' + label 'process_single' - conda "bioconda::sourmash=4.6.1" + conda "bioconda::sourmash=4.8.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': - 'biocontainers/sourmash:4.6.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/sourmash:4.8.4--hdfd78af_0': + 'biocontainers/sourmash:4.8.4--hdfd78af_0' }" input: tuple val(meta), path(signature) diff --git a/modules/nf-core/sourmash/index/main.nf b/modules/nf-core/sourmash/index/main.nf index dcd64a54bcd..aeba6caa23f 100644 --- a/modules/nf-core/sourmash/index/main.nf +++ b/modules/nf-core/sourmash/index/main.nf @@ -2,10 +2,10 @@ process SOURMASH_INDEX { tag "$meta.id" label 'process_single' - conda "bioconda::sourmash=4.6.1" + conda "bioconda::sourmash=4.8.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': - 'biocontainers/sourmash:4.6.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/sourmash:4.8.4--hdfd78af_0': + 'biocontainers/sourmash:4.8.4--hdfd78af_0' }" input: tuple val(meta), path(signatures) diff --git a/modules/nf-core/sourmash/sketch/main.nf b/modules/nf-core/sourmash/sketch/main.nf index 38e70d3c27f..494e637d5bc 100644 --- a/modules/nf-core/sourmash/sketch/main.nf +++ b/modules/nf-core/sourmash/sketch/main.nf @@ -1,11 +1,11 @@ process SOURMASH_SKETCH { tag "$meta.id" - label 'process_low' + label 'process_single' - conda "bioconda::sourmash=4.6.1" + conda "bioconda::sourmash=4.8.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': - 'biocontainers/sourmash:4.6.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/sourmash:4.8.4--hdfd78af_0': + 'biocontainers/sourmash:4.8.4--hdfd78af_0' }" input: tuple val(meta), path(sequence) diff --git a/modules/nf-core/sourmash/taxannotate/main.nf b/modules/nf-core/sourmash/taxannotate/main.nf index 842289f7a8a..baf136e548a 100644 --- a/modules/nf-core/sourmash/taxannotate/main.nf +++ b/modules/nf-core/sourmash/taxannotate/main.nf @@ -2,10 +2,10 @@ process SOURMASH_TAXANNOTATE { tag "$meta.id" label 'process_single' - conda "bioconda::sourmash=4.6.1" + conda "bioconda::sourmash=4.8.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': - 'biocontainers/sourmash:4.6.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/sourmash:4.8.4--hdfd78af_0': + 'biocontainers/sourmash:4.8.4--hdfd78af_0' }" input: tuple val(meta), path(gather_results) From b1f3d31bbf14fe83959cc03f98db96c6b4f73b37 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:58:15 +0100 Subject: [PATCH 2/4] Add NFCORE_PIPELINE_UTILS subworkflow (#4027) * Add NFCORE_PIPELINE_UTILS subworkflow Includes utility functions for running an nf-core pipeline * editorconfig * tag fix * Apply suggestions from code review Co-authored-by: Friederike Hanssen --------- Co-authored-by: Friederike Hanssen --- .github/modules.yml | 3 + .../nf-core/nfcore_pipeline_utils/main.nf | 311 ++++++++++++++++++ .../nf-core/nfcore_pipeline_utils/meta.yml | 17 + .../tests/main.function.nf.test | 120 +++++++ .../tests/main.function.nf.test.snap | 78 +++++ .../tests/main.workflow.nf.test | 33 ++ .../tests/nextflow.config | 9 + 7 files changed, 571 insertions(+) create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/main.nf create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/meta.yml create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test.snap create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/tests/main.workflow.nf.test create mode 100644 subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config diff --git a/.github/modules.yml b/.github/modules.yml index d195b43d293..204fff9b840 100644 --- a/.github/modules.yml +++ b/.github/modules.yml @@ -22,5 +22,8 @@ fastq_download_prefetch_fasterqdump_sratools: nextflowpipelineutils: - subworkflows/nf-core/nextflowpipelineutils/** +nfcorepipelineutils: + - subworkflows/nf-core/nfcore_pipeline_utils/** + nfvalidationpluginutils: - subworkflows/nf-core/nfvalidationpluginutils/** diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/main.nf b/subworkflows/nf-core/nfcore_pipeline_utils/main.nf new file mode 100644 index 00000000000..b3b136dc81e --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/main.nf @@ -0,0 +1,311 @@ +// +// Subworkflow with utility functions specific to the nf-core pipeline template +// + +/* +======================================================================================== + SUBWORKFLOW DEFINITION +======================================================================================== +*/ + +workflow NFCORE_PIPELINE_UTILS { + + main: + checkConfigProvided() + + emit: + success = true + +} + +/* +======================================================================================== + FUNCTIONS +======================================================================================== +*/ + +// +// Warn if a -profile or Nextflow config has not been provided to run the pipeline +// +def checkConfigProvided() { + if (workflow.profile == 'standard' && workflow.configFiles.size() <= 1) { + log.warn "[$workflow.manifest.name] You are attempting to run the pipeline without any custom configuration!\n\n" + + "This will be dependent on your local compute environment but can be achieved via one or more of the following:\n" + + " (1) Using an existing pipeline profile e.g. `-profile docker` or `-profile singularity`\n" + + " (2) Using an existing nf-core/configs for your Institution e.g. `-profile crick` or `-profile uppmax`\n" + + " (3) Using your own local custom config e.g. `-c /path/to/your/custom.config`\n\n" + + "Please refer to the quick start section and usage docs for the pipeline.\n " + } +} + +// +// Citation string for pipeline +// +def workflowCitation() { + return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + + "* The pipeline\n" + + " ${workflow.manifest.doi}\n\n" + + "* The nf-core framework\n" + + " https://doi.org/10.1038/s41587-020-0439-x\n\n" + + "* Software dependencies\n" + + " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" +} + +// +// nf-core logo +// +def nfCoreLogo(workflow_version) { + Map colors = logColours() + String.format( + """\n + ${dashedLine()} + ${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} + ${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} + ${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} + ${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} + ${colors.green}`._,._,\'${colors.reset} + ${colors.purple} ${workflow.manifest.name} ${workflow_version}${colors.reset} + ${dashedLine()} + """.stripIndent() + ) +} + +// +// Return dashed line +// +def dashedLine() { + Map colors = logColours() + return "-${colors.dim}----------------------------------------------------${colors.reset}-" +} + +// +// ANSII colours used for terminal logging +// +def logColours() { + Map colorcodes = [:] + + // Reset / Meta + colorcodes['reset'] = params.monochrome_logs ? '' : "\033[0m" + colorcodes['bold'] = params.monochrome_logs ? '' : "\033[1m" + colorcodes['dim'] = params.monochrome_logs ? '' : "\033[2m" + colorcodes['underlined'] = params.monochrome_logs ? '' : "\033[4m" + colorcodes['blink'] = params.monochrome_logs ? '' : "\033[5m" + colorcodes['reverse'] = params.monochrome_logs ? '' : "\033[7m" + colorcodes['hidden'] = params.monochrome_logs ? '' : "\033[8m" + + // Regular Colors + colorcodes['black'] = params.monochrome_logs ? '' : "\033[0;30m" + colorcodes['red'] = params.monochrome_logs ? '' : "\033[0;31m" + colorcodes['green'] = params.monochrome_logs ? '' : "\033[0;32m" + colorcodes['yellow'] = params.monochrome_logs ? '' : "\033[0;33m" + colorcodes['blue'] = params.monochrome_logs ? '' : "\033[0;34m" + colorcodes['purple'] = params.monochrome_logs ? '' : "\033[0;35m" + colorcodes['cyan'] = params.monochrome_logs ? '' : "\033[0;36m" + colorcodes['white'] = params.monochrome_logs ? '' : "\033[0;37m" + + // Bold + colorcodes['bblack'] = params.monochrome_logs ? '' : "\033[1;30m" + colorcodes['bred'] = params.monochrome_logs ? '' : "\033[1;31m" + colorcodes['bgreen'] = params.monochrome_logs ? '' : "\033[1;32m" + colorcodes['byellow'] = params.monochrome_logs ? '' : "\033[1;33m" + colorcodes['bblue'] = params.monochrome_logs ? '' : "\033[1;34m" + colorcodes['bpurple'] = params.monochrome_logs ? '' : "\033[1;35m" + colorcodes['bcyan'] = params.monochrome_logs ? '' : "\033[1;36m" + colorcodes['bwhite'] = params.monochrome_logs ? '' : "\033[1;37m" + + // Underline + colorcodes['ublack'] = params.monochrome_logs ? '' : "\033[4;30m" + colorcodes['ured'] = params.monochrome_logs ? '' : "\033[4;31m" + colorcodes['ugreen'] = params.monochrome_logs ? '' : "\033[4;32m" + colorcodes['uyellow'] = params.monochrome_logs ? '' : "\033[4;33m" + colorcodes['ublue'] = params.monochrome_logs ? '' : "\033[4;34m" + colorcodes['upurple'] = params.monochrome_logs ? '' : "\033[4;35m" + colorcodes['ucyan'] = params.monochrome_logs ? '' : "\033[4;36m" + colorcodes['uwhite'] = params.monochrome_logs ? '' : "\033[4;37m" + + // High Intensity + colorcodes['iblack'] = params.monochrome_logs ? '' : "\033[0;90m" + colorcodes['ired'] = params.monochrome_logs ? '' : "\033[0;91m" + colorcodes['igreen'] = params.monochrome_logs ? '' : "\033[0;92m" + colorcodes['iyellow'] = params.monochrome_logs ? '' : "\033[0;93m" + colorcodes['iblue'] = params.monochrome_logs ? '' : "\033[0;94m" + colorcodes['ipurple'] = params.monochrome_logs ? '' : "\033[0;95m" + colorcodes['icyan'] = params.monochrome_logs ? '' : "\033[0;96m" + colorcodes['iwhite'] = params.monochrome_logs ? '' : "\033[0;97m" + + // Bold High Intensity + colorcodes['biblack'] = params.monochrome_logs ? '' : "\033[1;90m" + colorcodes['bired'] = params.monochrome_logs ? '' : "\033[1;91m" + colorcodes['bigreen'] = params.monochrome_logs ? '' : "\033[1;92m" + colorcodes['biyellow'] = params.monochrome_logs ? '' : "\033[1;93m" + colorcodes['biblue'] = params.monochrome_logs ? '' : "\033[1;94m" + colorcodes['bipurple'] = params.monochrome_logs ? '' : "\033[1;95m" + colorcodes['bicyan'] = params.monochrome_logs ? '' : "\033[1;96m" + colorcodes['biwhite'] = params.monochrome_logs ? '' : "\033[1;97m" + + return colorcodes +} + +// +// Construct and send completion email +// +def completionEmail(summary_params) { + + // Set up the e-mail variables + def subject = "[$workflow.manifest.name] Successful: $workflow.runName" + if (!workflow.success) { + subject = "[$workflow.manifest.name] FAILED: $workflow.runName" + } + + def summary = [:] + for (group in summary_params.keySet()) { + summary << summary_params[group] + } + + def misc_fields = [:] + misc_fields['Date Started'] = workflow.start + misc_fields['Date Completed'] = workflow.complete + misc_fields['Pipeline script file path'] = workflow.scriptFile + misc_fields['Pipeline script hash ID'] = workflow.scriptId + if (workflow.repository) misc_fields['Pipeline repository Git URL'] = workflow.repository + if (workflow.commitId) misc_fields['Pipeline repository Git Commit'] = workflow.commitId + if (workflow.revision) misc_fields['Pipeline Git branch/tag'] = workflow.revision + misc_fields['Nextflow Version'] = workflow.nextflow.version + misc_fields['Nextflow Build'] = workflow.nextflow.build + misc_fields['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp + + def email_fields = [:] + email_fields['version'] = NfcoreTemplate.version(workflow) + email_fields['runName'] = workflow.runName + email_fields['success'] = workflow.success + email_fields['dateComplete'] = workflow.complete + email_fields['duration'] = workflow.duration + email_fields['exitStatus'] = workflow.exitStatus + email_fields['errorMessage'] = (workflow.errorMessage ?: 'None') + email_fields['errorReport'] = (workflow.errorReport ?: 'None') + email_fields['commandLine'] = workflow.commandLine + email_fields['projectDir'] = workflow.projectDir + email_fields['summary'] = summary << misc_fields + + // Check if we are only sending emails on failure + def email_address = params.email + if (!params.email && params.email_on_fail && !workflow.success) { + email_address = params.email_on_fail + } + + // Render the TXT template + def engine = new groovy.text.GStringTemplateEngine() + def tf = new File("${workflow.projectDir}/assets/email_template.txt") + def txt_template = engine.createTemplate(tf).make(email_fields) + def email_txt = txt_template.toString() + + // Render the HTML template + def hf = new File("${workflow.projectDir}/assets/email_template.html") + def html_template = engine.createTemplate(hf).make(email_fields) + def email_html = html_template.toString() + + // Render the sendmail template + def smail_fields = [ email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "${workflow.projectDir}" ] + def sf = new File("${workflow.projectDir}/assets/sendmail_template.txt") + def sendmail_template = engine.createTemplate(sf).make(smail_fields) + def sendmail_html = sendmail_template.toString() + + // Send the HTML e-mail + Map colors = logColours() + if (email_address) { + try { + if (params.plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') } + // Try to send HTML e-mail using sendmail + [ 'sendmail', '-t' ].execute() << sendmail_html + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (sendmail)-" + } catch (all) { + // Catch failures and try with plaintext + def mail_cmd = [ 'mail', '-s', subject, '--content-type=text/html', email_address ] + mail_cmd.execute() << email_html + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (mail)-" + } + } + + // Write summary e-mail HTML to a file + def output_d = new File("${params.outdir}/pipeline_info/") + if (!output_d.exists()) { + output_d.mkdirs() + } + def output_hf = new File(output_d, "pipeline_report.html") + output_hf.withWriter { w -> w << email_html } + def output_tf = new File(output_d, "pipeline_report.txt") + output_tf.withWriter { w -> w << email_txt } +} + +// +// Print pipeline summary on completion +// +def completionSummary() { + Map colors = logColours() + if (workflow.success) { + if (workflow.stats.ignoredCount == 0) { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Pipeline completed successfully${colors.reset}-" + } else { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.yellow} Pipeline completed successfully, but with errored process(es) ${colors.reset}-" + } + } else { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.red} Pipeline completed with errors${colors.reset}-" + } +} + +// +// Construct and send a notification to a web server as JSON e.g. Microsoft Teams and Slack +// +def imNotification(summary_params) { + def hook_url = params.hook_url + + def summary = [:] + for (group in summary_params.keySet()) { + summary << summary_params[group] + } + + def misc_fields = [:] + misc_fields['start'] = workflow.start + misc_fields['complete'] = workflow.complete + misc_fields['scriptfile'] = workflow.scriptFile + misc_fields['scriptid'] = workflow.scriptId + if (workflow.repository) misc_fields['repository'] = workflow.repository + if (workflow.commitId) misc_fields['commitid'] = workflow.commitId + if (workflow.revision) misc_fields['revision'] = workflow.revision + misc_fields['nxf_version'] = workflow.nextflow.version + misc_fields['nxf_build'] = workflow.nextflow.build + misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp + + def msg_fields = [:] + msg_fields['version'] = NfcoreTemplate.version(workflow) + msg_fields['runName'] = workflow.runName + msg_fields['success'] = workflow.success + msg_fields['dateComplete'] = workflow.complete + msg_fields['duration'] = workflow.duration + msg_fields['exitStatus'] = workflow.exitStatus + msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None') + msg_fields['errorReport'] = (workflow.errorReport ?: 'None') + msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") + msg_fields['projectDir'] = workflow.projectDir + msg_fields['summary'] = summary << misc_fields + + // Render the JSON template + def engine = new groovy.text.GStringTemplateEngine() + // Different JSON depending on the service provider + // Defaults to "Adaptive Cards" (https://adaptivecards.io), except Slack which has its own format + def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" + def hf = new File("${workflow.projectDir}/assets/${json_path}") + def json_template = engine.createTemplate(hf).make(msg_fields) + def json_message = json_template.toString() + + // POST + def post = new URL(hook_url).openConnection(); + post.setRequestMethod("POST") + post.setDoOutput(true) + post.setRequestProperty("Content-Type", "application/json") + post.getOutputStream().write(json_message.getBytes("UTF-8")); + def postRC = post.getResponseCode(); + if (! postRC.equals(200)) { + log.warn(post.getErrorStream().getText()); + } +} diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/meta.yml b/subworkflows/nf-core/nfcore_pipeline_utils/meta.yml new file mode 100644 index 00000000000..5721b7e326d --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/meta.yml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "NFCORE_PIPELINE_UTILS" +description: Subworkflow with utility functions specific to the nf-core pipeline template +keywords: + - utility + - pipeline + - initialise + - version +components: [] +input: [] +output: + - success: + type: boolean + description: | + Dummy output to indicate success +authors: + - "@adamrtalbot" diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test new file mode 100644 index 00000000000..265ece395db --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test @@ -0,0 +1,120 @@ + +nextflow_function { + + name "Test Functions" + script "../main.nf" + config "subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config" + + test("Test Function checkConfigProvided") { + + function "checkConfigProvided" + + when { + function { + """ + // define inputs of the function here. Example: + // input[0] = 1 + """ + } + } + + then { + assertAll ( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + + } + + test("Test Function workflowCitation") { + + function "workflowCitation" + + when { + function { + """ + // define inputs of the function here. Example: + // input[0] = 1 + """ + } + } + + then { + assertAll ( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + + } + + test("Test Function nfCoreLogo") { + + function "nfCoreLogo" + + when { + function { + """ + input[0] = "9.9.9" + """ + } + } + + then { + assertAll ( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + + } + + + + test("Test Function dashedLine") { + + function "dashedLine" + + when { + function { + """ + // define inputs of the function here. Example: + // input[0] = 1 + """ + } + } + + then { + assertAll ( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + + } + + + + test("Test Function logColours") { + + function "logColours" + + when { + function { + """ + // define inputs of the function here. Example: + // input[0] = 1 + """ + } + } + + then { + assertAll ( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test.snap b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test.snap new file mode 100644 index 00000000000..3ea51f68c62 --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.function.nf.test.snap @@ -0,0 +1,78 @@ +{ + "Test Function logColours": { + "content": [ + { + "reset": "\u001b[0m", + "bold": "\u001b[1m", + "dim": "\u001b[2m", + "underlined": "\u001b[4m", + "blink": "\u001b[5m", + "reverse": "\u001b[7m", + "hidden": "\u001b[8m", + "black": "\u001b[0;30m", + "red": "\u001b[0;31m", + "green": "\u001b[0;32m", + "yellow": "\u001b[0;33m", + "blue": "\u001b[0;34m", + "purple": "\u001b[0;35m", + "cyan": "\u001b[0;36m", + "white": "\u001b[0;37m", + "bblack": "\u001b[1;30m", + "bred": "\u001b[1;31m", + "bgreen": "\u001b[1;32m", + "byellow": "\u001b[1;33m", + "bblue": "\u001b[1;34m", + "bpurple": "\u001b[1;35m", + "bcyan": "\u001b[1;36m", + "bwhite": "\u001b[1;37m", + "ublack": "\u001b[4;30m", + "ured": "\u001b[4;31m", + "ugreen": "\u001b[4;32m", + "uyellow": "\u001b[4;33m", + "ublue": "\u001b[4;34m", + "upurple": "\u001b[4;35m", + "ucyan": "\u001b[4;36m", + "uwhite": "\u001b[4;37m", + "iblack": "\u001b[0;90m", + "ired": "\u001b[0;91m", + "igreen": "\u001b[0;92m", + "iyellow": "\u001b[0;93m", + "iblue": "\u001b[0;94m", + "ipurple": "\u001b[0;95m", + "icyan": "\u001b[0;96m", + "iwhite": "\u001b[0;97m", + "biblack": "\u001b[1;90m", + "bired": "\u001b[1;91m", + "bigreen": "\u001b[1;92m", + "biyellow": "\u001b[1;93m", + "biblue": "\u001b[1;94m", + "bipurple": "\u001b[1;95m", + "bicyan": "\u001b[1;96m", + "biwhite": "\u001b[1;97m" + } + ], + "timestamp": "2023-10-16T14:27:09.843064" + }, + "Test Function checkConfigProvided": { + "content": null, + "timestamp": "2023-10-16T14:27:01.415849" + }, + "Test Function nfCoreLogo": { + "content": [ + "\n\n-\u001b[2m----------------------------------------------------\u001b[0m-\n \u001b[0;32m,--.\u001b[0;30m/\u001b[0;32m,-.\u001b[0m\n\u001b[0;34m ___ __ __ __ ___ \u001b[0;32m/,-._.--~'\u001b[0m\n\u001b[0;34m |\\ | |__ __ / ` / \\ |__) |__ \u001b[0;33m} {\u001b[0m\n\u001b[0;34m | \\| | \\__, \\__/ | \\ |___ \u001b[0;32m\\`-._,-`-,\u001b[0m\n \u001b[0;32m`._,._,'\u001b[0m\n\u001b[0;35m nextflow_workflow 9.9.9\u001b[0m\n-\u001b[2m----------------------------------------------------\u001b[0m-\n" + ], + "timestamp": "2023-10-16T14:27:51.566211" + }, + "Test Function workflowCitation": { + "content": [ + "If you use nextflow_workflow for your analysis please cite:\n\n* The pipeline\n https://doi.org/10.5281/zenodo.5070524\n\n* The nf-core framework\n https://doi.org/10.1038/s41587-020-0439-x\n\n* Software dependencies\n https://github.com/nextflow_workflow/blob/master/CITATIONS.md" + ], + "timestamp": "2023-10-16T14:27:03.505737" + }, + "Test Function dashedLine": { + "content": [ + "-\u001b[2m----------------------------------------------------\u001b[0m-" + ], + "timestamp": "2023-10-16T14:27:07.721916" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.workflow.nf.test b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.workflow.nf.test new file mode 100644 index 00000000000..ad7c73a8ab8 --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/tests/main.workflow.nf.test @@ -0,0 +1,33 @@ +nextflow_workflow { + + name "Test Workflow NFCORE_PIPELINE_UTILS" + script "../main.nf" + config "subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config" + workflow "NFCORE_PIPELINE_UTILS" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "nfcorepipelineutils" + tag "subworkflows/nfcorepipelineutils" + + test("Should run without failures") { + + when { + params { + // define parameters here. Example: + // outdir = "tests/results" + } + workflow { + """ + // define inputs of the workflow here. Example: + // input[0] = file("test-file.txt") + """ + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config b/subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config new file mode 100644 index 00000000000..53574ffec4f --- /dev/null +++ b/subworkflows/nf-core/nfcore_pipeline_utils/tests/nextflow.config @@ -0,0 +1,9 @@ +manifest { + name = 'nextflow_workflow' + author = """nf-core""" + homePage = 'https://127.0.0.1' + description = """Dummy pipeline""" + nextflowVersion = '!>=23.04.0' + version = '9.9.9' + doi = 'https://doi.org/10.5281/zenodo.5070524' +} \ No newline at end of file From 98f05ea2f3fe405e14fdc6ac362fef446549e237 Mon Sep 17 00:00:00 2001 From: Leon Rauschning <99650940+lrauschning@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:11:07 +0200 Subject: [PATCH 3/4] bump T-Coffee version (#4017) * bump version * fix singularity package name * switch to more recent singularity container * set TEMP env variable * remove unnecessary comments --------- Co-authored-by: Leon Rauschning Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/tcoffee/align/main.nf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/tcoffee/align/main.nf b/modules/nf-core/tcoffee/align/main.nf index 815d9f5da89..27477ce5806 100644 --- a/modules/nf-core/tcoffee/align/main.nf +++ b/modules/nf-core/tcoffee/align/main.nf @@ -2,10 +2,10 @@ process TCOFFEE_ALIGN { tag "$meta.id" label 'process_medium' - conda "bioconda::t-coffee=13.45.0.4846264" + conda "bioconda::t-coffee=13.46.0.919e8c6b" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/t-coffee:13.45.0.4846264--hc57179f_5': - 'biocontainers/t-coffee:13.45.0.4846264--hc57179f_5' }" + 'https://depot.galaxyproject.org/singularity/t-coffee:13.46.0.919e8c6b--hfc96bf3_0': + 'biocontainers/t-coffee:13.46.0.919e8c6b--hfc96bf3_0' }" input: tuple val(meta) , path(fasta) @@ -25,6 +25,7 @@ process TCOFFEE_ALIGN { def tree_args = tree ? "-usetree $tree" : "" def template_args = template ? "-template_file $template" : "" """ + export TEMP='./' t_coffee -seq ${fasta} \ $tree_args \ $template_args \ From a444cf4d4bc25ff333f5c35aa9f8d5827b991467 Mon Sep 17 00:00:00 2001 From: Maxime U Garcia Date: Mon, 16 Oct 2023 16:50:47 +0200 Subject: [PATCH 4/4] Update renovate.json5 (#4032) --- .github/renovate.json5 | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e578df51455..b7cdd8761f9 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -6,7 +6,6 @@ dependencyDashboardTitle: "Renovate Dashboard 🤖", suppressNotifications: ["prIgnoreNotification"], rebaseWhen: "conflicted", - schedule: ["every sunday"], reviewers: ["team:maintainers"], regexManagers: [ {