Skip to content

Commit

Permalink
Merge pull request #66 from mirpedrol/fix-resume-modules
Browse files Browse the repository at this point in the history
Fix resume
  • Loading branch information
mirpedrol authored Aug 4, 2023
2 parents d8d0935 + 05f4f72 commit c6b9910
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Summary processes don't modify the input file anymore, allowing resuming these processes ([#66](https://github.com/nf-core/crisprseq/pull/66))
- Do not stash unexistent files, use empty lists instead. Fixes AWS tests ([#67](https://github.com/nf-core/crisprseq/pull/67))

### Deprecated
Expand Down
2 changes: 1 addition & 1 deletion modules/local/alignment_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process ALIGNMENT_SUMMARY {
tuple val(meta), path(reads), path(summary)

output:
tuple val(meta), path(summary), emit: summary
tuple val(meta), path("*_alignment_summary.csv"), emit: summary

when:
task.ext.when == null || task.ext.when
Expand Down
2 changes: 1 addition & 1 deletion modules/local/clustering_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process CLUSTERING_SUMMARY {
tuple val(meta), path(reads), path(summary)

output:
tuple val(meta), path(summary), emit: summary
tuple val(meta), path("*_clustering_summary.csv"), emit: summary

when:
task.ext.when == null || task.ext.when
Expand Down
2 changes: 1 addition & 1 deletion modules/local/merging_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process MERGING_SUMMARY {


output:
tuple val(meta), path("*_summary.csv"), emit: summary
tuple val(meta), path("*_merging_summary.csv"), emit: summary

when:
task.ext.when == null || task.ext.when
Expand Down
3 changes: 2 additions & 1 deletion templates/alignment_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
summary_lines = summary.readlines()

add_line = True
with open("$summary", "w") as output_file:
outname = "$summary".replace("_clustering_summary.csv", "_alignment_summary.csv")
with open(outname, "w") as output_file:
for line in summary_lines:
if "aligned-reads" not in line:
output_file.write(line)
Expand Down
3 changes: 2 additions & 1 deletion templates/clustering_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
summary_lines = summary.readlines()

add_line = True
with open("$summary", "w") as output_file:
outname = "$summary".replace("_merging_summary.csv", "_clustering_summary.csv")
with open(outname, "w") as output_file:
for line in summary_lines:
if "clustered-reads" not in line:
output_file.write(line)
Expand Down
2 changes: 1 addition & 1 deletion templates/merging_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
else:
prefix = "$meta.id"

with open(f"{prefix}_summary.csv", "w") as output_file:
with open(f"{prefix}_merging_summary.csv", "w") as output_file:
output_file.write("class, count\\n")
output_file.write(f"raw-reads, {raw_reads_count} (100.0%)\\n")
output_file.write(
Expand Down

0 comments on commit c6b9910

Please sign in to comment.