-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use INITIALISE subworkflow instead of WorkflowMain.initialise() #2430
Changes from all commits
cf14aa1
e9be029
cc01dd0
61fbeb8
8153dc4
7e307e6
83ccc5e
eab1442
31a47a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,23 +30,7 @@ params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta') | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
*/ | ||
|
||
include { validateParameters; paramsHelp } from 'plugin/nf-validation' | ||
|
||
// Print help message if needed | ||
if (params.help) { | ||
def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The subworkflow INITIALISE does not contain the nf-core logo, we should add it or keep it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added it back, but it now always appears. Options:
For now, adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with adding it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm just having a look now and as long as you switch around the order of functions correctly I think it will be fine(ish). |
||
def citation = '\n' + WorkflowMain.citation(workflow) + '\n' | ||
def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker" | ||
log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) | ||
System.exit(0) | ||
} | ||
|
||
// Validate input parameters | ||
if (params.validate_params) { | ||
validateParameters() | ||
} | ||
|
||
WorkflowMain.initialise(workflow, params, log) | ||
include { INITIALISE } from './subworkflows/nf-core/initialise/main.nf' | ||
|
||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -60,6 +44,8 @@ include { {{ short_name|upper }} } from './workflows/{{ short_name }}' | |
// WORKFLOW: Run main {{ name }} analysis pipeline | ||
// | ||
workflow {{ prefix_nodash|upper }}_{{ short_name|upper }} { | ||
log.info NfcoreTemplate.logo(workflow, params.monochrome_logs) | ||
INITIALISE(params.version, params.help, params.validate_params) | ||
{{ short_name|upper }} () | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,7 @@ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
*/ | ||
|
||
include { paramsSummaryLog; paramsSummaryMap } from 'plugin/nf-validation' | ||
|
||
def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) | ||
def citation = '\n' + WorkflowMain.citation(workflow) + '\n' | ||
def summary_params = paramsSummaryMap(workflow) | ||
|
||
// Print parameter summary log to screen | ||
log.info logo + paramsSummaryLog(workflow) + citation | ||
|
||
Workflow{{ short_name[0]|upper }}{{ short_name[1:] }}.initialise(params, log) | ||
include { paramsSummaryMap } from 'plugin/nf-validation' | ||
|
||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -59,6 +50,9 @@ include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoft | |
// Info required for completion email and summary | ||
def multiqc_report = [] | ||
|
||
// Get map of parameter values | ||
def summary_params = paramsSummaryMap(workflow) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could possibly add this to the INITIALISE subworkflow to make everything central. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. INITIALISE is meant to be used in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could work anywhere, but we would have to re-work structure slightly for the scoping to be correct for this particular use case. But it's hardly a massive problem having it here anyway. It would be cleaner to not have anything outside the workflow scope in this file, e.g. global scope stuff only happens in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see! sounds good then :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd remove even more the workflow to be honest, but that's for the next release, we're too early to move so fast I'm afraid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you like to add this modification if it is a fast change and merge the PR for this release? |
||
|
||
workflow {{ short_name|upper }} { | ||
|
||
ch_versions = Channel.empty() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the igenomes bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't touched igenomes - you still need to use
WorkflowMain.getGenomeAttribute
for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nf-core/modules#3864
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since igenomes is optional in case you are creating a customised template, I think the best is to keep it in this groovy function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am on a one man crusade to remove everything from
lib/
. But yes, I'm not sure it's appropriate within INITIALISE. Haven't got a good solution for this yet 🤔