Skip to content

Commit

Permalink
changing output dir to former system, making everything publish
Browse files Browse the repository at this point in the history
  • Loading branch information
toniher committed Dec 3, 2024
1 parent 6e79dbb commit 1b8b099
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions modules/local/exorthist/filter_matches.nf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
process FILTER_AND_SELECT_BEST_EX_MATCHES_BY_TARGETGENE {
tag { comp_id }

publishDir "${outdir}", mode: "copy",
// TODO: This needs to be changed once new publish approach
publishDir "${params.output}", mode: "copy",
pattern: "best_scored_EX_matches_by_targetgene.txt",
saveAs: { filename -> "${comp_id}/$filename" }

Expand All @@ -10,7 +11,6 @@ process FILTER_AND_SELECT_BEST_EX_MATCHES_BY_TARGETGENE {
val(long_dist)
val(medium_dist)
val(short_dist)
path outdir

output:
path "*.tab", emit: filterscore_per_joining
Expand Down
6 changes: 2 additions & 4 deletions modules/local/exorthist/merge_aligns.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ process MERGE_PROT_EX_INT_ALN_INFO {

stageInMode 'copy'

publishDir "${outdir}", mode: "copy", pattern: "${comp_id}/all_*_aln_features.txt"
publishDir "${outdir}", mode: "copy", pattern: "${comp_id}/EXINT_aln.gz"

input:
tuple val(comp_id), path("FOLDERS_*"), path("*")
path outdir

output:
// TODO: We should only publish certain files, not all directory
tuple val(comp_id), path("${comp_id}/"), emit: folder_jscores
path "${comp_id}/all_*_aln_features.txt", emit: aln_features
path "${comp_id}/EXINT_aln.gz", emit: exint_aln
Expand All @@ -23,5 +20,6 @@ process MERGE_PROT_EX_INT_ALN_INFO {
mv realigned_* ${comp_id}/
B4_merge_PROT_EX_INT_aln_info.pl ${comp_id}
rmdir FOLDERS_
"""
}
4 changes: 2 additions & 2 deletions modules/local/exorthist/score_matches.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ process SCORE_EX_MATCHES {
tag { comp_id }
label 'big_mem'

storeDir "${outdir}/${comp_id}"
// TODO: This needs to be changed once new publish approach
storeDir "${params.output}/${comp_id}"

input:
tuple val(comp_id), path("*")
path outdir

output:
path "all_PROT_EX_INT_aln_features_*", emit: all_features
Expand Down
6 changes: 6 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ process {
mode: params.publish_dir_mode
]
}
withName: 'MERGE_PROT_EX_INT_ALN_INFO' {
publishDir = [
path: { "${params.output}" },
mode: params.publish_dir_mode
]
}
withName: 'SPLIT_CLUSTERS_BY_SPECIES_PAIRS' {
publishDir = [
path: { "${params.output}" },
Expand Down
5 changes: 1 addition & 4 deletions subworkflows/local/exorthist/align.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ workflow ALIGN {
short_dist
alignmentnum
prevaln
outdir
nofile

main:
Expand Down Expand Up @@ -48,9 +47,7 @@ workflow ALIGN {
realigned_exons_4_merge = REALIGN_EX_PAIRS.out.realigned_exons_4_merge
data_4_merge = aligned_subclusters_4_splitting.groupTuple().join(realigned_exons_4_merge.groupTuple())
// Merge alignments information
// TODO: Outdir approach should be eventually changed
outdir_ch = Channel.fromPath(outdir, checkIfExists: true).collect()
MERGE_PROT_EX_INT_ALN_INFO(data_4_merge, outdir_ch)
MERGE_PROT_EX_INT_ALN_INFO(data_4_merge)

emit:
folder_jscores = MERGE_PROT_EX_INT_ALN_INFO.out.folder_jscores
Expand Down
9 changes: 3 additions & 6 deletions subworkflows/local/exorthist/score.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ workflow SCORE {
long_dist
medium_dist
short_dist
outdir
nofile

main:

data_to_score = folder_jscores.join(clusters_split_ch).map{ [it[0], it[1..-1] ]}
// Score EX matches from aln info. TODO: This needs to be changed once new publish approach
outdir_ch = Channel.fromPath(outdir, checkIfExists: true).collect()
SCORE_EX_MATCHES(data_to_score, outdir_ch)
// Score EX matches from aln info.
SCORE_EX_MATCHES(data_to_score)
// Filter the best matches above score cutoffs by target gene.
all_scores_to_filt_ch = SCORE_EX_MATCHES.out.all_scores_to_filt
FILTER_AND_SELECT_BEST_EX_MATCHES_BY_TARGETGENE(all_scores_to_filt_ch.join(dist_ranges_ch), long_dist, medium_dist, short_dist, outdir_ch)
FILTER_AND_SELECT_BEST_EX_MATCHES_BY_TARGETGENE(all_scores_to_filt_ch.join(dist_ranges_ch), long_dist, medium_dist, short_dist)
// Join filtered scored EX matches
filterscore_per_joining_ch = FILTER_AND_SELECT_BEST_EX_MATCHES_BY_TARGETGENE.out.filterscore_per_joining
JOIN_FILTERED_EX_MATCHES(filterscore_per_joining_ch.collect())
Expand Down
2 changes: 0 additions & 2 deletions workflows/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ workflow MAIN {
params.short_dist,
params.alignmentnum,
params.prevaln,
params.output,
nofile
)

Expand All @@ -47,7 +46,6 @@ workflow MAIN {
params.long_dist,
params.medium_dist,
params.short_dist,
params.output,
nofile
)

Expand Down

0 comments on commit 1b8b099

Please sign in to comment.