Skip to content

Commit

Permalink
adding actual dummy nofile for avoiding errors in some setups
Browse files Browse the repository at this point in the history
  • Loading branch information
toniher committed Dec 3, 2024
1 parent df7e1d3 commit 6e79dbb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions files/NO_FILE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://nextflow-io.github.io/patterns/optional-input/
3 changes: 2 additions & 1 deletion subworkflows/local/exorthist/align.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ workflow ALIGN {
alignmentnum
prevaln
outdir
nofile

main:

Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/exorthist/cluster.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ workflow CLUSTER {
clusterfile
orthopairs
orthogroupnum
nofile

main:

clusterfile_ch = Channel.fromPath(clusterfile, checkIfExists: true).collect()
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)
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/exorthist/prepare.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ workflow PREPARE {
short_dist
extraexons
alignmentnum
nofile

main:

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/exorthist/score.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ workflow SCORE {
medium_dist
short_dist
outdir
nofile

main:

Expand All @@ -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:
Expand Down
17 changes: 12 additions & 5 deletions workflows/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -19,19 +22,21 @@ 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,
params.medium_dist,
params.short_dist,
params.alignmentnum,
params.prevaln,
params.output
params.output,
nofile
)

SCORE(
Expand All @@ -42,15 +47,17 @@ workflow MAIN {
params.long_dist,
params.medium_dist,
params.short_dist,
params.output
params.output,
nofile
)

CLUSTER(
SCORE.out.score_exon_hits_pairs,
PREPARE.out.clusters_split_ch,
params.cluster,
params.orthopairs,
params.orthogroupnum
params.orthogroupnum,
nofile
)

emit:
Expand Down

0 comments on commit 6e79dbb

Please sign in to comment.