From 21e5cb8f54375993a35bd2651b265b15a4bb3d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taavi=20P=C3=A4ll?= Date: Fri, 8 May 2026 20:13:40 +0300 Subject: [PATCH] refactor: lowercase `channel` factory across subworkflows + workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DSL2 prefers the lowercase `channel` factory function over the `Channel` class qualifier — both work but the lowercase form is the documented default and is a one-character net win on every line that constructs a channel. Pure cosmetic refactor, no behaviour change. Touches all sites currently using `Channel.empty`, `Channel.fromPath`, etc. across: subworkflows/local/{call,collect_rna,db_search,merge,qc, utils_nfcore_dram_pipeline}.nf workflows/dram.nf --- subworkflows/local/call.nf | 4 +- subworkflows/local/collect_rna.nf | 8 ++-- subworkflows/local/db_search.nf | 46 +++++++++---------- subworkflows/local/merge.nf | 2 +- subworkflows/local/qc.nf | 2 +- .../local/utils_nfcore_dram_pipeline/main.nf | 2 +- workflows/dram.nf | 20 ++++---- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/subworkflows/local/call.nf b/subworkflows/local/call.nf index 9e5fd89f..83af21f3 100644 --- a/subworkflows/local/call.nf +++ b/subworkflows/local/call.nf @@ -38,13 +38,13 @@ workflow CALL { .set { ch_collected_faa } // Set the resulting list to ch_collected_faa // Collect all individual fasta to pass to quast - Channel.empty() + channel.empty() .mix( ch_called_genes ) .collect() .set { ch_collected_fna } // Collect all individual fasta to pass to quast - Channel.empty() + channel.empty() .mix( ch_filtered_fasta, ch_gene_gff ) .collect() .set { ch_collected_fasta } diff --git a/subworkflows/local/collect_rna.nf b/subworkflows/local/collect_rna.nf index 55e77d11..307bbdfb 100644 --- a/subworkflows/local/collect_rna.nf +++ b/subworkflows/local/collect_rna.nf @@ -33,7 +33,7 @@ workflow COLLECT_RNA { // If we didn't run call if (!call) { if (params.rrnas) { - Channel.fromPath("${params.rrnas}/*.tsv", checkIfExists: true) + channel.fromPath("${params.rrnas}/*.tsv", checkIfExists: true) .ifEmpty { exit 1, "Cannot find individual rRNA files generated with barrnap at: ${params.rrnas}\nNB: Path needs to follow pattern: path/to/directory" } .collect() .set { ch_collected_rRNAs } @@ -43,7 +43,7 @@ workflow COLLECT_RNA { log.warn("No rRNA files provided, skipping rRNA steps.") } if (params.trnas) { - Channel.fromPath("${params.trnas}/*.tsv", checkIfExists: true) + channel.fromPath("${params.trnas}/*.tsv", checkIfExists: true) .ifEmpty { exit 1, "Cannot find individual tRNA files generated with tRNAscan-SE. Cannot find any files at: ${params.trnas}\nNB: Path needs to follow pattern: path/to/directory" } .collect() .set { ch_collected_tRNAs } @@ -57,14 +57,14 @@ workflow COLLECT_RNA { TRNA_SCAN( ch_fasta ) ch_trna_scan = TRNA_SCAN.out.trna_scan_out // Collect all input_fasta formatted tRNA files - Channel.empty() + channel.empty() .mix( ch_trna_scan ) .collect() .set { ch_collected_tRNAs } // Run barrnap on each fasta to identify rRNAs RRNA_SCAN( ch_fasta ) ch_rrna_scan = RRNA_SCAN.out.rrna_scan_out - Channel.empty() + channel.empty() .mix( ch_rrna_scan ) .collect() .set { ch_collected_rRNAs } diff --git a/subworkflows/local/db_search.nf b/subworkflows/local/db_search.nf index d106eaf1..33b1f649 100644 --- a/subworkflows/local/db_search.nf +++ b/subworkflows/local/db_search.nf @@ -402,29 +402,29 @@ workflow DB_CHANNEL_SETUP { main: index_mmseqs = false - ch_kegg_db = Channel.empty() - ch_kofam_db = Channel.empty() - ch_dbcan_db = Channel.empty() - ch_camper_hmm_db = Channel.empty() - ch_camper_mmseqs_db = Channel.empty() - ch_camper_mmseqs_list = Channel.empty() - ch_merops_db = Channel.empty() - ch_pfam_mmseqs_db = Channel.empty() - ch_heme_db = Channel.empty() - ch_sulfur_db = Channel.empty() - ch_uniref_db = Channel.empty() - ch_metals_db = Channel.empty() - ch_antismash_db = Channel.empty() - ch_card_db = Channel.empty() - ch_tcdb_db = Channel.empty() - ch_dram_db = Channel.empty() - ch_methyl_db = Channel.empty() - ch_fegenie_db = Channel.empty() - ch_canthyd_hmm_db = Channel.empty() - ch_canthyd_mmseqs_db = Channel.empty() - ch_canthyd_mmseqs_list = Channel.empty() - ch_vogdb_db = Channel.empty() - ch_viral_db = Channel.empty() + ch_kegg_db = channel.empty() + ch_kofam_db = channel.empty() + ch_dbcan_db = channel.empty() + ch_camper_hmm_db = channel.empty() + ch_camper_mmseqs_db = channel.empty() + ch_camper_mmseqs_list = channel.empty() + ch_merops_db = channel.empty() + ch_pfam_mmseqs_db = channel.empty() + ch_heme_db = channel.empty() + ch_sulfur_db = channel.empty() + ch_uniref_db = channel.empty() + ch_metals_db = channel.empty() + ch_antismash_db = channel.empty() + ch_card_db = channel.empty() + ch_tcdb_db = channel.empty() + ch_dram_db = channel.empty() + ch_methyl_db = channel.empty() + ch_fegenie_db = channel.empty() + ch_canthyd_hmm_db = channel.empty() + ch_canthyd_mmseqs_db = channel.empty() + ch_canthyd_mmseqs_list = channel.empty() + ch_vogdb_db = channel.empty() + ch_viral_db = channel.empty() if (use_kegg) { ch_kegg_db = file(params.kegg_db).exists() ? file(params.kegg_db) : error("Error: If using --annotate, you must supply prebuilt databases. KEGG database file not found at ${params.kegg_db}") diff --git a/subworkflows/local/merge.nf b/subworkflows/local/merge.nf index d6945aeb..e6ba2c4e 100644 --- a/subworkflows/local/merge.nf +++ b/subworkflows/local/merge.nf @@ -34,7 +34,7 @@ workflow MERGE { Channel .from(tsv_files.collect { annotations_dir.toString() + '/' + it }) .set { ch_merge_annotations } - Channel.empty() + channel.empty() .mix( ch_merge_annotations ) .collect() .set { ch_merge_annotations_collected } diff --git a/subworkflows/local/qc.nf b/subworkflows/local/qc.nf index 3fcdd537..094c9073 100644 --- a/subworkflows/local/qc.nf +++ b/subworkflows/local/qc.nf @@ -57,7 +57,7 @@ workflow QC { tuple(input_fastaName, it) } // Collect all individual fasta to pass to quast - Channel.empty() + channel.empty() .mix( ch_called_genes ) .collect() .set { ch_collected_fna } diff --git a/subworkflows/local/utils_nfcore_dram_pipeline/main.nf b/subworkflows/local/utils_nfcore_dram_pipeline/main.nf index 28e0ee51..2b05878d 100644 --- a/subworkflows/local/utils_nfcore_dram_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_dram_pipeline/main.nf @@ -41,7 +41,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 diff --git a/workflows/dram.nf b/workflows/dram.nf index f5c073e1..6646d3e1 100644 --- a/workflows/dram.nf +++ b/workflows/dram.nf @@ -36,9 +36,9 @@ workflow DRAM { // Setup // - ch_versions = Channel.empty() - ch_multiqc_files = Channel.empty() - ch_fasta = Channel.empty() + ch_versions = channel.empty() + ch_multiqc_files = channel.empty() + ch_fasta = channel.empty() default_sheet = file(params.distill_dummy_sheet) distill_flag = (params.summarize || params.distill_topic != "" || params.distill_ecosystem != "" || params.distill_custom != "" || params.sum_ecos != "") @@ -309,24 +309,24 @@ workflow DRAM { // // MODULE: MultiQC // - ch_multiqc_config = Channel.fromPath( + ch_multiqc_config = channel.fromPath( "$projectDir/assets/multiqc_config.yml", checkIfExists: true) ch_multiqc_custom_config = params.multiqc_config ? - Channel.fromPath(params.multiqc_config, checkIfExists: true) : - Channel.empty() + channel.fromPath(params.multiqc_config, checkIfExists: true) : + channel.empty() ch_multiqc_logo = params.multiqc_logo ? - Channel.fromPath(params.multiqc_logo, checkIfExists: true) : - Channel.empty() + channel.fromPath(params.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 = params.multiqc_methods_description ? file(params.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)