From 1f077714091638fc4cdef43d04b3c2f14ca7ae2e Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 15 May 2024 14:14:58 +0200 Subject: [PATCH 1/3] Fix intermittant RGI process fail when certain files not produced --- CHANGELOG.md | 1 + modules.json | 2 +- modules/nf-core/rgi/main/main.nf | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ef451bf..96950a60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#363](https://github.com/nf-core/funcscan/pull/363) Removed warning from DeepBGC usage docs. (by @jasmezz) - [#365](https://github.com/nf-core/funcscan/pull/365) Fixed AMRFinderPlus module and usage docs for manual database download. (by @jasmezz) - [#371](https://github.com/nf-core/funcscan/pull/371) Fixed AMRFinderPlus parameter `arg_amrfinderplus_name`. (by @m3hdad) +- [#376](https://github.com/nf-core/funcscan/pull/376) Fixed an occasional RGI failure when certain files not produced. (by @jfy133) ### `Dependencies` diff --git a/modules.json b/modules.json index d7b5c8ae..e47d1885 100644 --- a/modules.json +++ b/modules.json @@ -177,7 +177,7 @@ }, "rgi/main": { "branch": "master", - "git_sha": "dbbb0c509e044d2680b429ba622049d4a23426dc", + "git_sha": "4dc25cf0a0f11ea5a2693ec2540d41cbb829fabe", "installed_by": ["modules"] }, "seqkit/seq": { diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 94606b9d..6ac87f13 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -60,7 +60,16 @@ process RGI_MAIN { --input_sequence $fasta mkdir temp/ - mv *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes *{variant,rrna,protein,predictedGenes,overexpression,homolog}.json temp/ + mv *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes temp/ + + ## These files not always generated, so only move if they exist + ## Taken from https://stackoverflow.com/a/54655320 (RIP) by @TSJNachos117 + if [ "\$(ls -A | grep -i \\variant.json\\\$)" ] ; then mv *variant.json temp/ ; fi + if [ "\$(ls -A | grep -i \\rrna.json\\\$)" ] ; then mv *rrna.json temp/ ; fi + if [ "\$(ls -A | grep -i \\protein.json\\\$)" ] ; then mv *protein.json temp/ ; fi + if [ "\$(ls -A | grep -i \\predictedGenes.json\\\$)" ]; then mv *predictedGenes.json temp/; fi + if [ "\$(ls -A | grep -i \\overexpression.json\\\$)" ]; then mv *overexpression.json temp/; fi + if [ "\$(ls -A | grep -i \\homolog.json\\\$)" ] ; then mv *homolog.json temp/ ; fi RGI_VERSION=\$(rgi main --version) From af088336700afbef08cc7e5105c920e51a7e5509 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 15 May 2024 14:16:25 +0200 Subject: [PATCH 2/3] Fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96950a60..31466033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#363](https://github.com/nf-core/funcscan/pull/363) Removed warning from DeepBGC usage docs. (by @jasmezz) - [#365](https://github.com/nf-core/funcscan/pull/365) Fixed AMRFinderPlus module and usage docs for manual database download. (by @jasmezz) - [#371](https://github.com/nf-core/funcscan/pull/371) Fixed AMRFinderPlus parameter `arg_amrfinderplus_name`. (by @m3hdad) -- [#376](https://github.com/nf-core/funcscan/pull/376) Fixed an occasional RGI failure when certain files not produced. (by @jfy133) +- [#376](https://github.com/nf-core/funcscan/pull/376) Fixed an occasional RGI process failure when certain files not produced. (by @jfy133) ### `Dependencies` From 8fb57b5a36a63fd4d9f92a21fcd2fa51f0a8bf20 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 16 May 2024 13:08:03 +0200 Subject: [PATCH 3/3] Better version --- CHANGELOG.md | 2 +- modules.json | 2 +- modules/nf-core/rgi/main/main.nf | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31466033..6ffe23d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#363](https://github.com/nf-core/funcscan/pull/363) Removed warning from DeepBGC usage docs. (by @jasmezz) - [#365](https://github.com/nf-core/funcscan/pull/365) Fixed AMRFinderPlus module and usage docs for manual database download. (by @jasmezz) - [#371](https://github.com/nf-core/funcscan/pull/371) Fixed AMRFinderPlus parameter `arg_amrfinderplus_name`. (by @m3hdad) -- [#376](https://github.com/nf-core/funcscan/pull/376) Fixed an occasional RGI process failure when certain files not produced. (by @jfy133) +- [#376](https://github.com/nf-core/funcscan/pull/376) Fixed an occasional RGI process failure when certain files not produced. (❤️ to @amizeranschi for reporting, fix by @amizeranschi & @jfy133) ### `Dependencies` diff --git a/modules.json b/modules.json index e47d1885..d1171ecd 100644 --- a/modules.json +++ b/modules.json @@ -177,7 +177,7 @@ }, "rgi/main": { "branch": "master", - "git_sha": "4dc25cf0a0f11ea5a2693ec2540d41cbb829fabe", + "git_sha": "0ae1adbee6a09b4c5097e990b2db1f5ebe96265c", "installed_by": ["modules"] }, "seqkit/seq": { diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 6ac87f13..ba05358a 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -60,16 +60,7 @@ process RGI_MAIN { --input_sequence $fasta mkdir temp/ - mv *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes temp/ - - ## These files not always generated, so only move if they exist - ## Taken from https://stackoverflow.com/a/54655320 (RIP) by @TSJNachos117 - if [ "\$(ls -A | grep -i \\variant.json\\\$)" ] ; then mv *variant.json temp/ ; fi - if [ "\$(ls -A | grep -i \\rrna.json\\\$)" ] ; then mv *rrna.json temp/ ; fi - if [ "\$(ls -A | grep -i \\protein.json\\\$)" ] ; then mv *protein.json temp/ ; fi - if [ "\$(ls -A | grep -i \\predictedGenes.json\\\$)" ]; then mv *predictedGenes.json temp/; fi - if [ "\$(ls -A | grep -i \\overexpression.json\\\$)" ]; then mv *overexpression.json temp/; fi - if [ "\$(ls -A | grep -i \\homolog.json\\\$)" ] ; then mv *homolog.json temp/ ; fi + for FILE in *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes *{variant,rrna,protein,predictedGenes,overexpression,homolog}.json; do [[ -e \$FILE ]] && mv \$FILE temp/; done RGI_VERSION=\$(rgi main --version)