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

momps and mlst: remove collect from report to avoid overwriting previous results when a pipeline is resumed #196

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ all the components.
position in the `nextflow run` command inside the .nextflow.log file.
- Fix parsing of .nextflow.log file when searching for `nextflow run` command.
- Fixed bug between mash_sketch_fasta and mash_dist.
- `momps` and `mlst` components now save results per sample to avoid overwriting
results from previous runs

### Minor/Other changes

Expand All @@ -30,6 +32,7 @@ with a secondary channel into `mafft`
- New version of DEN-IM recipe
- Now prints an ordered list of components
- Moved taxonomy results from `results/annotation/` to `results/taxonomy/`
- Moved mlst results from `results/annotation/` to `results/typing/`


## 1.4.0
Expand Down
10 changes: 5 additions & 5 deletions flowcraft/generator/templates/mlst.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process mlst_{{ pid }} {
set sample_id, file(assembly) from {{ input_channel }}

output:
file '*.mlst.txt' into LOG_mlst_{{ pid }}
set sample_id, file('*.mlst.txt') into LOG_mlst_{{ pid }}
set sample_id, file(assembly), file(".status") into MAIN_mlst_out_{{ pid }}
{% with task_name="mlst" %}
{%- include "compiler_channels.txt" ignore missing -%}
Expand Down Expand Up @@ -47,17 +47,17 @@ process mlst_{{ pid }} {

process compile_mlst_{{ pid }} {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the results are being produced for each sample, then the whole compile_mlst process is not needed anymore. You could just remove this process and add the publishDir of the appropriate output in the mlst process correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If for some reason, this process in kept, then the name does not make sense anymore, as it is not compiling stuff.


publishDir "results/annotation/mlst_{{ pid }}/"
publishDir "results/typing/mlst_{{ pid }}/"

input:
file res from LOG_mlst_{{ pid }}.collect()
set sample_id, res from LOG_mlst_{{ pid }}

output:
file "mlst_report.tsv"
file "*mlst_report.tsv"

script:
"""
cat $res >> mlst_report.tsv
cat $res > ${sample_id}_mlst_report.tsv
"""
}

Expand Down
10 changes: 6 additions & 4 deletions flowcraft/generator/templates/momps.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ process momps_{{ pid }} {
val clear from checkpointClear_{{ pid }}

output:
val sample_id into momps_sample_id_{{ pid }}
file("*_st.tsv") into momps_st_{{ pid }}
file("*_profile.tsv") into momps_profile_{{ pid }}
{% with task_name="momps" %}
Expand Down Expand Up @@ -75,17 +76,18 @@ process momps_report_{{ pid }} {
publishDir "results/typing/momps_{{ pid }}/", pattern: "*.tsv"

input:
file(st_file) from momps_st_{{ pid }}.collect()
file(profile_file) from momps_profile_{{ pid }}.collect()
val sample_id from momps_sample_id_{{ pid }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same login applies here. If output is not being compile, then it makes more sense to just create these files on the main process and move the publishDir there.

file(st_file) from momps_st_{{ pid }}
file(profile_file) from momps_profile_{{ pid }}

output:
file "*.tsv"


script:
"""
cat $st_file >> momps_st.tsv
cat $profile_file >> momps_profile.tsv
cat $st_file > ${sample_id}_momps_st.tsv
cat $profile_file > ${sample_id}_momps_profile.tsv
"""

}
Expand Down