Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use publishDir to save final output files instead of manual copyTo #35

Merged
merged 2 commits into from
Apr 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,12 @@ merged_databases = merged_databases.mix(cBioportal_proteindb)
*/
process merge_proteindbs {

publishDir "${params.outdir}/", mode: params.publish_dir_mode,
// Final step if not cleaning or creating a decoy database - save output to params.final_database_protein
saveAs: { filename ->
params.clean_database || params.decoy ? null : params.final_database_protein
}

input:
file("proteindb*") from merged_databases.collect()

Expand All @@ -748,6 +754,12 @@ process merge_proteindbs {
*/
process clean_protein_database {

publishDir "${params.outdir}/", mode: params.publish_dir_mode,
// Final step if not creating a decoy database - save output to params.final_database_protein
saveAs: { filename ->
params.decoy ? null : params.final_database_protein
}

when:
params.clean_database

Expand Down Expand Up @@ -782,6 +794,9 @@ to_protein_decoy_ch = params.clean_database ? clean_database_sh : to_clean_ch
*/
process decoy {

publishDir "${params.outdir}/", mode: params.publish_dir_mode,
saveAs: { filename -> params.final_database_protein }

when:
params.decoy

Expand All @@ -804,12 +819,6 @@ process decoy {
"""
}

result_database_ch = params.decoy ? fasta_decoy_db_ch: to_protein_decoy_ch

/** Write the final results to S3 bucket**/

result_database_ch.subscribe { results -> results.copyTo("${params.outdir}/${params.final_database_protein}")}


/*
* Output Description HTML
Expand Down