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

Fix MEGAHIT process on resume #516

Merged
merged 4 commits into from
Sep 27, 2023
Merged
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
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- [#511](https://github.com/nf-core/mag/pull/511) Update to nf-core 2.10 `TEMPLATE` (by @jfy133)
- [#511](https://github.com/nf-core/mag/pull/511) - Update to nf-core 2.10 `TEMPLATE` (by @jfy133)

### `Fixed`

- [#515](https://github.com/nf-core/mag/pull/515) Fix overwriting of GUNC output directories when running with domain classification (reported by @maxibor, fix by @jfy133)
- [#514](https://github.com/nf-core/mag/pull/514) Fix missing CONCOCT files in downstream output (reported by @maxibor, fix by @jfy133)
- [#514](https://github.com/nf-core/mag/pull/514) - Fix missing CONCOCT files in downstream output (reported by @maxibor, fix by @jfy133)
- [#515](https://github.com/nf-core/mag/pull/515) - Fix overwriting of GUNC output directories when running with domain classification (reported by @maxibor, fix by @jfy133)
- [#516](https://github.com/nf-core/mag/pull/516) - Fix edge-case bug where MEGAHIT re-uses previous work directory on resume and fails (reported by @husensofteng, fix by @prototaxites)

### `Dependencies`

Expand Down
5 changes: 5 additions & 0 deletions modules/local/megahit.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ process MEGAHIT {
mem = task.memory.toBytes()
if ( !params.megahit_fix_cpu_1 || task.cpus == 1 )
"""
## Check if we're in the same work directory as a previous failed MEGAHIT run
if [[ -d MEGAHIT ]]; then
rm -r MEGAHIT/
fi

megahit $args -t "${task.cpus}" -m $mem $input -o MEGAHIT --out-prefix "MEGAHIT-${meta.id}"

gzip -c "MEGAHIT/MEGAHIT-${meta.id}.contigs.fa" > "MEGAHIT/MEGAHIT-${meta.id}.contigs.fa.gz"
Expand Down
Loading