Skip to content
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

Remove lib directory and replace it with granular utils_* subworkflows #2736

Merged
merged 27 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5ed48a9
Install utils_subworkflows_* from nf-core/modules
drpatelh Feb 8, 2024
53487ec
Remove lib directory from pipeline template
drpatelh Feb 8, 2024
99fb69f
Change output channel name in input_check subworkflow
drpatelh Feb 8, 2024
bae90f0
Delete custom/dumpsoftwareversions module
drpatelh Feb 8, 2024
a78d41b
Delete fasta from test.config
drpatelh Feb 8, 2024
7343ce4
Add local subworkflow for pipeline utilities
drpatelh Feb 8, 2024
090a395
Update main workflows in pipeline to use utils_* subworkflows
drpatelh Feb 8, 2024
fdf3e54
Disable native version detection in MultiQC
drpatelh Feb 8, 2024
5214976
Add checkProfileProvided function back in
drpatelh Feb 8, 2024
7832a44
update utils_nfcore_pipeline in the template
mirpedrol Feb 9, 2024
91b1529
add multiqc report to completion email
mirpedrol Feb 10, 2024
48c7026
add methodsDescriptionText to multiqc report
mirpedrol Feb 12, 2024
bbf3fac
update template subworkflows
mirpedrol Feb 12, 2024
125cc59
remove warn exceeding resources
mirpedrol Feb 12, 2024
c64ed82
fix SimpleTemplateEngine error by writing to the file
mirpedrol Feb 12, 2024
e56999f
use nf-validation to create input channel
mirpedrol Feb 13, 2024
75f833f
linting: warn if groovy files in lib exist
mirpedrol Feb 13, 2024
a62c307
fix pytests
mirpedrol Feb 13, 2024
0dd064a
rename local subworkflow from the template
mirpedrol Feb 13, 2024
5b5b30a
fix editorconfig errors in the template
mirpedrol Feb 13, 2024
71a0eec
rename local subworkflow with jinja
mirpedrol Feb 14, 2024
ff69ee3
fix more pytests
mirpedrol Feb 14, 2024
b325944
fix creating a template without igenomes
mirpedrol Feb 14, 2024
3bd4cfe
return multiqc description as string
mirpedrol Feb 14, 2024
9c89874
fix prettier inconsistencies in the pipeline template
mirpedrol Feb 14, 2024
7f7e920
fix more linting tests
mirpedrol Feb 14, 2024
28c0196
apply suggestions from code review
mirpedrol Feb 15, 2024
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
5 changes: 1 addition & 4 deletions nf_core/pipeline-template/conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ params {
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'

{% if igenomes -%}
{% if igenomes %}
mirpedrol marked this conversation as resolved.
Show resolved Hide resolved
// Genome references
genome = 'R64-1-1'
{%- else -%}
// Fasta references
fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/genome/NC_045512.2/GCF_009858895.2_ASM985889v3_genomic.200409.fna.gz'
{%- endif %}
}
356 changes: 0 additions & 356 deletions nf_core/pipeline-template/lib/NfcoreTemplate.groovy

This file was deleted.

47 changes: 0 additions & 47 deletions nf_core/pipeline-template/lib/Utils.groovy

This file was deleted.

80 changes: 0 additions & 80 deletions nf_core/pipeline-template/lib/WorkflowMain.groovy

This file was deleted.

123 changes: 0 additions & 123 deletions nf_core/pipeline-template/lib/WorkflowPipeline.groovy

This file was deleted.

95 changes: 60 additions & 35 deletions nf_core/pipeline-template/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@
*/

nextflow.enable.dsl = 2

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { {{ short_name|upper }} } from './workflows/{{ short_name }}'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_pipeline_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_pipeline_pipeline'
{% if igenomes %}
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_pipeline_pipeline'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
Expand All @@ -22,59 +34,72 @@ nextflow.enable.dsl = 2
// TODO nf-core: Remove this line if you don't need a FASTA file
// This is an example of how to use getGenomeAttribute() to fetch parameters
// from igenomes.config using `--genome`
params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta')
params.fasta = getGenomeAttribute('fasta')
{% endif %}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATE & PRINT PARAMETER SUMMARY
NAMED WORKFLOWS FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { validateParameters; paramsHelp } from 'plugin/nf-validation'
//
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow {{ prefix_nodash|upper }}_{{ short_name|upper }} {

// 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 samplesheet.csv --genome GRCh37 -profile docker"
log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs)
System.exit(0)
}
take:
samplesheet // channel: samplesheet read in from --input

// Validate input parameters
if (params.validate_params) {
validateParameters()
}
main:

WorkflowMain.initialise(workflow, params, log, args)
//
// WORKFLOW: Run pipeline
//
{{ short_name|upper }} (
samplesheet
)

}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOW FOR PIPELINE
RUN MAIN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { {{ short_name|upper }} } from './workflows/{{ short_name }}'
workflow {

//
// WORKFLOW: Run main {{ name }} analysis pipeline
//
workflow {{ prefix_nodash|upper }}_{{ short_name|upper }} {
{{ short_name|upper }} ()
}
main:

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN ALL WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
//
// SUBWORKFLOW: Run initialisation tasks
//
PIPELINE_INITIALISATION (
params.version,
params.help,
params.validate_params,
params.monochrome_logs,
params.outdir,
params.input
)

//
// WORKFLOW: Execute a single named workflow for the pipeline
// See: https://github.com/nf-core/rnaseq/issues/619
//
workflow {
{{ prefix_nodash|upper }}_{{ short_name|upper }} ()
//
// WORKFLOW: Run main workflow
//
{{ prefix_nodash|upper }}_{{ short_name|upper }} (
PIPELINE_INITIALISATION.out.samplesheet
)

//
// SUBWORKFLOW: Run completion tasks
//
PIPELINE_COMPLETION (
params.email,
params.email_on_fail,
params.plaintext_email,
params.outdir,
params.monochrome_logs,
params.hook_url
)
}

/*
Expand Down
Loading
Loading