From abd62caee9b1788d35528d8a86d58ee18852c86d Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 13 Nov 2025 14:03:04 +0100 Subject: [PATCH 1/4] Channel -> channel --- main.nf | 6 ++--- .../main.nf | 4 ++-- .../nf-core/utils_nfcore_pipeline/main.nf | 2 +- workflows/sampletracking.nf | 24 +++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/main.nf b/main.nf index 007f38b..4dc47d3 100644 --- a/main.nf +++ b/main.nf @@ -81,16 +81,16 @@ workflow { // NFCMGG_SAMPLETRACKING ( PIPELINE_INITIALISATION.out.samplesheet, - Channel.value([ + channel.value([ [id: "bwa"], file(params.bwa_index, checkIfExists: true) ]), - Channel.value( + channel.value( [[id:"genome_fasta"], file(params.fasta, checkIfExists: true), file(params.fai, checkIfExists: true), ]), - Channel.value( + channel.value( [[id:"haplotype_map"], file(params.haplotype_map, checkIfExists: true) ]), diff --git a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf index 960f3b5..564885d 100644 --- a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf @@ -39,7 +39,7 @@ workflow PIPELINE_INITIALISATION { main: - ch_versions = Channel.empty() + ch_versions = channel.empty() // // Print version and exit if required and dump pipeline parameters to JSON file @@ -89,7 +89,7 @@ workflow PIPELINE_INITIALISATION { return counts }) - Channel + channel .fromList(input_list) .map { meta, sample_bam, sample_bam_index, snp_fastq_1, snp_fastq_2, snp_bam, snp_bam_index -> diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index bfd2587..2f30e9a 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -98,7 +98,7 @@ def workflowVersionToYAML() { // Get channel of software versions used in pipeline in YAML format // def softwareVersionsToYAML(ch_versions) { - return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(Channel.of(workflowVersionToYAML())) + return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(channel.of(workflowVersionToYAML())) } // diff --git a/workflows/sampletracking.nf b/workflows/sampletracking.nf index 11ef55f..4d3964f 100644 --- a/workflows/sampletracking.nf +++ b/workflows/sampletracking.nf @@ -39,9 +39,9 @@ workflow SAMPLETRACKING { main: - def ch_versions = Channel.empty() - def ch_multiqc_files = Channel.empty() - def ch_pool_multiqc_files = Channel.empty() + def ch_versions = channel.empty() + def ch_multiqc_files = channel.empty() + def ch_pool_multiqc_files = channel.empty() def (ch_sample, ch_snp, ch_rest) = ch_samplesheet @@ -109,7 +109,7 @@ workflow SAMPLETRACKING { // Crosscheck fingerprints // - def ch_crosscheck_metrics_out = Channel.empty() + def ch_crosscheck_metrics_out = channel.empty() ch_samplesheet_fixed .filter { meta, _sample_bam, _sample_bam_index, snp_fastq, snp_bam, _snp_bam_index -> if(!snp_bam && !snp_fastq) { @@ -169,7 +169,7 @@ workflow SAMPLETRACKING { // // Determine sample sex // - def ch_sex_prediction_out = Channel.empty() + def ch_sex_prediction_out = channel.empty() ch_samplesheet_fixed .map { meta, sample_bam, sample_bam_index, _snp_fastq, _snp_bam, _snp_bam_index -> [ meta, sample_bam, sample_bam_index ] @@ -267,24 +267,24 @@ workflow SAMPLETRACKING { // // MODULE: MultiQC // - ch_multiqc_config = Channel.fromPath( + ch_multiqc_config = channel.fromPath( "$projectDir/assets/multiqc_config.yml", checkIfExists: true) ch_multiqc_custom_config = multiqc_config ? - Channel.fromPath(multiqc_config, checkIfExists: true) : - Channel.empty() + channel.fromPath(multiqc_config, checkIfExists: true) : + channel.empty() ch_multiqc_logo = multiqc_logo ? - Channel.fromPath(multiqc_logo, checkIfExists: true) : - Channel.empty() + channel.fromPath(multiqc_logo, checkIfExists: true) : + channel.empty() summary_params = paramsSummaryMap( workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) + ch_workflow_summary = channel.value(paramsSummaryMultiqc(summary_params)) ch_multiqc_files = ch_multiqc_files.mix( ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) ch_multiqc_custom_methods_description = multiqc_methods_description ? file(multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = Channel.value( + ch_methods_description = channel.value( methodsDescriptionText(ch_multiqc_custom_methods_description)) ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) From 26ce5cd99e5c8fd16ffd303c7f578a3c8fde37f9 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 13 Nov 2025 14:48:08 +0100 Subject: [PATCH 2/4] update lint issues --- main.nf | 45 +++---------------- modules.json | 2 +- .../picard/crosscheckfingerprints/main.nf | 4 +- .../picard-crosscheckfingerprints.diff | 6 +-- .../main.nf | 1 - 5 files changed, 12 insertions(+), 46 deletions(-) diff --git a/main.nf b/main.nf index 4dc47d3..60c75aa 100644 --- a/main.nf +++ b/main.nf @@ -17,41 +17,6 @@ include { SAMPLETRACKING } from './workflows/sampletracking' include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline' include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline' -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - NAMED WORKFLOWS FOR PIPELINE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ -// -// WORKFLOW: Run main analysis pipeline depending on type of input -// -workflow NFCMGG_SAMPLETRACKING { - - take: - samplesheet // channel: samplesheet read in from --input - bwa_index // channel: bwa index file - genome_fasta // channel: genome fasta file - haplotype_map // channel: haplotype map file - outdir // channel: output directory - - main: - - // - // WORKFLOW: Run pipeline - // - SAMPLETRACKING ( - samplesheet, - bwa_index, - genome_fasta, - haplotype_map, - outdir - ) - emit: - multiqc_report = SAMPLETRACKING.out.multiqc_report // channel: /path/to/multiqc_report.html -} -/* - - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -67,7 +32,6 @@ workflow { PIPELINE_INITIALISATION ( params.version, params.validate_params, - params.monochrome_logs, args, params.outdir, params.input, @@ -79,7 +43,7 @@ workflow { // // WORKFLOW: Run main workflow // - NFCMGG_SAMPLETRACKING ( + SAMPLETRACKING ( PIPELINE_INITIALISATION.out.samplesheet, channel.value([ [id: "bwa"], @@ -94,7 +58,10 @@ workflow { [[id:"haplotype_map"], file(params.haplotype_map, checkIfExists: true) ]), - params.outdir + params.outdir, + params.multiqc_config, + params.multiqc_logo, + params.multiqc_methods_description ) // // SUBWORKFLOW: Run completion tasks @@ -106,7 +73,7 @@ workflow { params.outdir, params.monochrome_logs, params.hook_url, - NFCMGG_SAMPLETRACKING.out.multiqc_report + SAMPLETRACKING.out.multiqc_report ) } diff --git a/modules.json b/modules.json index 0c1ce60..701ec52 100644 --- a/modules.json +++ b/modules.json @@ -29,7 +29,7 @@ }, "picard/crosscheckfingerprints": { "branch": "master", - "git_sha": "df124e87c74d8b40285199f8cc20151f5aa57255", + "git_sha": "4e8415483e3119fc3035ece12ec9236dac261357", "installed_by": ["modules"], "patch": "modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff" }, diff --git a/modules/nf-core/picard/crosscheckfingerprints/main.nf b/modules/nf-core/picard/crosscheckfingerprints/main.nf index b1239a7..e68989d 100644 --- a/modules/nf-core/picard/crosscheckfingerprints/main.nf +++ b/modules/nf-core/picard/crosscheckfingerprints/main.nf @@ -22,8 +22,8 @@ process PICARD_CROSSCHECKFINGERPRINTS { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input1_cmd = input1.collect{"--INPUT $it"}.join(' ') - def input2_cmd = input2.collect{"--SECOND_INPUT $it"}.join(' ') + def input1_cmd = input1.collect{ f1 -> "--INPUT $f1"}.join(' ') + def input2_cmd = input2.collect{ f2 -> "--SECOND_INPUT $f2"}.join(' ') def reference_cmd = fasta ? "--REFERENCE_SEQUENCE $fasta" : "" def avail_mem = 3072 diff --git a/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff b/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff index 93e0f34..86b0117 100644 --- a/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff +++ b/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff @@ -1,6 +1,4 @@ Changes in component 'nf-core/picard/crosscheckfingerprints' -'modules/nf-core/picard/crosscheckfingerprints/environment.yml' is unchanged -'modules/nf-core/picard/crosscheckfingerprints/meta.yml' is unchanged Changes in 'picard/crosscheckfingerprints/main.nf': --- modules/nf-core/picard/crosscheckfingerprints/main.nf +++ modules/nf-core/picard/crosscheckfingerprints/main.nf @@ -14,7 +12,9 @@ Changes in 'picard/crosscheckfingerprints/main.nf': output: tuple val(meta), path("*.crosscheck_metrics.txt"), emit: crosscheck_metrics +'modules/nf-core/picard/crosscheckfingerprints/environment.yml' is unchanged +'modules/nf-core/picard/crosscheckfingerprints/meta.yml' is unchanged +'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test' is unchanged 'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test.snap' is unchanged 'modules/nf-core/picard/crosscheckfingerprints/tests/nextflow.config' is unchanged -'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test' is unchanged ************************************************************ diff --git a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf index 564885d..7c83e26 100644 --- a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf @@ -29,7 +29,6 @@ workflow PIPELINE_INITIALISATION { take: version // boolean: Display version and exit validate_params // boolean: Boolean whether to validate parameters against the schema at runtime - monochrome_logs // boolean: Do not use coloured log outputs nextflow_cli_args // array: List of positional nextflow CLI args outdir // string: The output directory where the results will be saved input // string: Path to input samplesheet From d4d462e8b866a5a2063ea7947b1898be2e339fe8 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 13 Nov 2025 14:50:12 +0100 Subject: [PATCH 3/4] fix nf-core lint --- modules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.json b/modules.json index 701ec52..e3630b3 100644 --- a/modules.json +++ b/modules.json @@ -49,7 +49,7 @@ }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "git_sha": "271e7fc14eb1320364416d996fb077421f3faed2", "installed_by": ["subworkflows"] }, "utils_nfschema_plugin": { From 2298d361e7eb0518968aadda072519fcc0b1ceec Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 13 Nov 2025 15:00:22 +0100 Subject: [PATCH 4/4] add workflow output definitions --- conf/modules.config | 18 ------------------ main.nf | 9 +++++++++ nextflow.config | 3 +++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 3227877..ce83871 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -12,12 +12,6 @@ process { - publishDir = [ - path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - // BWA MEM withName: "BWA_MEM" { ext.args = {[ @@ -33,7 +27,6 @@ process { // Picard CrosscheckFingerprints withName: "PICARD_CROSSCHECKFINGERPRINTS" { - publishDir = [ enabled:false ] ext.args = {[ "--CROSSCHECK_BY SAMPLE", "--CROSSCHECK_MODE CHECK_ALL_OTHERS", @@ -47,7 +40,6 @@ process { } withName: "NGSBITS_SAMPLEGENDER" { - publishDir = [ enabled:false ] ext.prefix = { "${meta.id}.xy" } ext.args = "-max_female ${params.max_yx_female} -min_male ${params.min_yx_male}" ext.args2 = "-min_female ${params.min_hetx_female} -max_male ${params.max_hetx_male}" @@ -56,20 +48,10 @@ process { withName: 'MULTIQC_POOLS' { ext.args = { params.multiqc_title ? "--title \"${params.multiqc_title}_${meta.id}\"" : "--title \"$meta.id\"" } - publishDir = [ - path: { "${params.outdir}/multiqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } withName: 'MULTIQC_MAIN' { ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } - publishDir = [ - path: { "${params.outdir}/multiqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } diff --git a/main.nf b/main.nf index 60c75aa..7aeec67 100644 --- a/main.nf +++ b/main.nf @@ -75,6 +75,15 @@ workflow { params.hook_url, SAMPLETRACKING.out.multiqc_report ) + + publish: + multiqc_report = SAMPLETRACKING.out.multiqc_report + multiqc_pools = SAMPLETRACKING.out.multiqc_pools +} + +output { + multiqc_report { path "multiqc/" } + multiqc_pools { path "multiqc/" } } /* diff --git a/nextflow.config b/nextflow.config index 84b3774..7e6fd60 100644 --- a/nextflow.config +++ b/nextflow.config @@ -283,3 +283,6 @@ validation { defaultIgnoreParams = [] monochromeLogs = params.monochrome_logs } + +workflow.output.mode = params.publish_dir_mode +outputDir = params.outdir