diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac382c1e..566ef509 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors on: - push: - branches: - - dev pull_request: release: types: [published] diff --git a/.nf-core.yml b/.nf-core.yml index cafd671c..cad7f3e2 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,5 +1,11 @@ repository_type: pipeline lint: + actions_ci: false + files_exist: + - .github/workflows/awsfulltest.yml + - .github/workflows/awstest.yml + - conf/igenomes.config + - lib/WorkflowFetchngs.groovy files_unchanged: - assets/sendmail_template.txt - lib/NfcoreTemplate.groovy diff --git a/main.nf b/main.nf index b600e82f..ed4f6877 100644 --- a/main.nf +++ b/main.nf @@ -1,28 +1,33 @@ #!/usr/bin/env nextflow + /* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== nf-core/fetchngs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== Github : https://github.com/nf-core/fetchngs Website: https://nf-co.re/fetchngs Slack : https://nfcore.slack.com/channels/fetchngs ----------------------------------------------------------------------------------------- +======================================================================================== */ nextflow.enable.dsl = 2 /* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== VALIDATE & PRINT PARAMETER SUMMARY -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== */ -include { validateParameters; paramsHelp } from 'plugin/nf-validation' +include { paramsHelp; paramsSummaryLog; validateParameters } from 'plugin/nf-validation' + +def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) +def citation = '\n' + WorkflowMain.citation(workflow) + '\n' + +// Print parameter summary log to screen +log.info logo + paramsSummaryLog(workflow) + citation // Print help message if needed if (params.help) { - def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) - def citation = '\n' + WorkflowMain.citation(workflow) + '\n' def String command = "nextflow run ${workflow.manifest.name} --input id.csv -profile docker" log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) System.exit(0) @@ -33,11 +38,9 @@ if (params.validate_params) { validateParameters() } -WorkflowMain.initialise(workflow, params, log) - // Check if --input file is empty ch_input = file(params.input, checkIfExists: true) -if (ch_input.isEmpty()) {exit 1, "File provided with --input is empty: ${ch_input.getName()}!"} +if (ch_input.isEmpty()) { error("File provided with --input is empty: ${ch_input.getName()}!") } // Read in ids from --input file Channel @@ -47,12 +50,6 @@ Channel .unique() .set { ch_ids } -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - NAMED WORKFLOW FOR PIPELINE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - // Auto-detect input id type def input_type = '' if (WorkflowMain.isSraId(ch_input)) { @@ -60,9 +57,15 @@ if (WorkflowMain.isSraId(ch_input)) { } else if (WorkflowMain.isSynapseId(ch_input)) { input_type = 'synapse' } else { - exit 1, 'Ids provided via --input not recognised please make sure they are either SRA / ENA / GEO / DDBJ or Synapse ids!' + error('Ids provided via --input not recognised please make sure they are either SRA / ENA / GEO / DDBJ or Synapse ids!') } +/* +======================================================================================== + VALIDATE INPUTS +======================================================================================== +*/ + if (params.input_type == input_type) { if (params.input_type == 'sra') { include { SRA } from './workflows/sra' @@ -70,9 +73,15 @@ if (params.input_type == input_type) { include { SYNAPSE } from './workflows/synapse' } } else { - exit 1, "Ids auto-detected as ${input_type}. Please provide '--input_type ${input_type}' as a parameter to the pipeline!" + error("Ids auto-detected as ${input_type}. Please provide '--input_type ${input_type}' as a parameter to the pipeline!") } +/* +======================================================================================== + NAMED WORKFLOW FOR PIPELINE +======================================================================================== +*/ + // // WORKFLOW: Run main nf-core/fetchngs analysis pipeline depending on type of identifier provided // @@ -93,9 +102,9 @@ workflow NFCORE_FETCHNGS { } /* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== RUN ALL WORKFLOWS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== */ // @@ -107,7 +116,7 @@ workflow { } /* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== THE END -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +======================================================================================== */