From 6e79dbb2d50d743a0958846b32b63ec540384ec7 Mon Sep 17 00:00:00 2001 From: Toni Hermoso Pulido Date: Tue, 3 Dec 2024 13:03:45 +0100 Subject: [PATCH] adding actual dummy nofile for avoiding errors in some setups --- files/NO_FILE | 1 + subworkflows/local/exorthist/align.nf | 3 ++- subworkflows/local/exorthist/cluster.nf | 3 ++- subworkflows/local/exorthist/prepare.nf | 3 ++- subworkflows/local/exorthist/score.nf | 3 ++- workflows/main.nf | 17 ++++++++++++----- 6 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 files/NO_FILE diff --git a/files/NO_FILE b/files/NO_FILE new file mode 100644 index 0000000..dc7d99a --- /dev/null +++ b/files/NO_FILE @@ -0,0 +1 @@ +https://nextflow-io.github.io/patterns/optional-input/ diff --git a/subworkflows/local/exorthist/align.nf b/subworkflows/local/exorthist/align.nf index 14abb05..ffe3d1a 100644 --- a/subworkflows/local/exorthist/align.nf +++ b/subworkflows/local/exorthist/align.nf @@ -17,6 +17,7 @@ workflow ALIGN { alignmentnum prevaln outdir + nofile main: @@ -25,7 +26,7 @@ workflow ALIGN { if (prevaln) { prevaln_ch = Channel.fromPath(prevaln, type: 'dir', checkIfExists: true).collect() } else { - prevaln_ch = Channel.fromPath("/path/to/NO_FILE").collect() + prevaln_ch = Channel.fromPath(nofile).collect() } // the last argument is the protein similarity alignment. diff --git a/subworkflows/local/exorthist/cluster.nf b/subworkflows/local/exorthist/cluster.nf index e587df5..1a3e204 100644 --- a/subworkflows/local/exorthist/cluster.nf +++ b/subworkflows/local/exorthist/cluster.nf @@ -14,6 +14,7 @@ workflow CLUSTER { clusterfile orthopairs orthogroupnum + nofile main: @@ -21,7 +22,7 @@ workflow CLUSTER { if (orthopairs) { orthopairs_ch = Channel.fromPath(orthopairs, checkIfExists: true).collect() } else { - orthopairs_ch = Channel.fromPath("/path/to/NO_FILE").collect() + orthopairs_ch = Channel.fromPath(nofile).collect() } FORMAT_EX_CLUSTERS_INPUT(score_exon_hits_pairs, clusterfile_ch, orthogroupnum) diff --git a/subworkflows/local/exorthist/prepare.nf b/subworkflows/local/exorthist/prepare.nf index 8a8ba03..6a417fa 100644 --- a/subworkflows/local/exorthist/prepare.nf +++ b/subworkflows/local/exorthist/prepare.nf @@ -17,6 +17,7 @@ workflow PREPARE { short_dist extraexons alignmentnum + nofile main: @@ -66,7 +67,7 @@ workflow PREPARE { } else { // Sic: https://nextflow-io.github.io/patterns/optional-input/ data_to_annotation.map { entry -> - entry.add(['/path/to/NO_FILE']) + entry.add([nofile]) } // data_to_annotation.view() GENERATE_ANNOTATIONS(data_to_annotation) diff --git a/subworkflows/local/exorthist/score.nf b/subworkflows/local/exorthist/score.nf index b7c43f3..4fd45d7 100644 --- a/subworkflows/local/exorthist/score.nf +++ b/subworkflows/local/exorthist/score.nf @@ -16,6 +16,7 @@ workflow SCORE { medium_dist short_dist outdir + nofile main: @@ -37,7 +38,7 @@ workflow SCORE { bonafide_pairs_ch = Channel.fromPath(bonafide_pairs, checkIfExists: true).collect() COLLAPSE_OVERLAPPING_MATCHES(filtered_all_scores, bonafide_pairs_ch) } else { - COLLAPSE_OVERLAPPING_MATCHES(filtered_all_scores, Channel.fromPath("/path/to/NO_FILE").collect()) + COLLAPSE_OVERLAPPING_MATCHES(filtered_all_scores, Channel.fromPath(nofile).collect()) } emit: diff --git a/workflows/main.nf b/workflows/main.nf index 5e45fc1..9466cc1 100644 --- a/workflows/main.nf +++ b/workflows/main.nf @@ -5,6 +5,9 @@ include { CLUSTER } from "${LOCAL_SUBWORKFLOWS}/cluster.nf" include { PREPARE } from "${LOCAL_SUBWORKFLOWS}/prepare.nf" include { SCORE } from "${LOCAL_SUBWORKFLOWS}/score.nf" +def blosum = "${projectDir}/files/blosum62.txt" +// https://nextflow-io.github.io/patterns/optional-input/ +def nofile = "${projectDir}/files/NO_FILE" workflow MAIN { @@ -19,11 +22,12 @@ workflow MAIN { params.medium_dist, params.short_dist, params.extraexons, - params.alignmentnum + params.alignmentnum, + nofile ) ALIGN( - "${projectDir}/files/blosum62.txt", + blosum, PREPARE.out.alignment_input, PREPARE.out.clusters_split_ch, params.long_dist, @@ -31,7 +35,8 @@ workflow MAIN { params.short_dist, params.alignmentnum, params.prevaln, - params.output + params.output, + nofile ) SCORE( @@ -42,7 +47,8 @@ workflow MAIN { params.long_dist, params.medium_dist, params.short_dist, - params.output + params.output, + nofile ) CLUSTER( @@ -50,7 +56,8 @@ workflow MAIN { PREPARE.out.clusters_split_ch, params.cluster, params.orthopairs, - params.orthogroupnum + params.orthogroupnum, + nofile ) emit: