From fd0aed8aa95e62ce823284a7cc89a61cdb551897 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 12:17:35 +0200 Subject: [PATCH 1/7] Display message when error 132 found --- modules/nf-core/kalign/align/main.nf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/nf-core/kalign/align/main.nf b/modules/nf-core/kalign/align/main.nf index 5d575dc71ea..7262e246231 100644 --- a/modules/nf-core/kalign/align/main.nf +++ b/modules/nf-core/kalign/align/main.nf @@ -23,6 +23,16 @@ process KALIGN_ALIGN { def prefix = task.ext.prefix ?: "${meta.id}" def write_output = compress ? ">(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "${prefix}.aln" """ + error_handler() { + exit_code=\$? + if [ \$exit_code -eq 132 ]; then + echo "\n\nKALIGN failed because is incompatible with some CPU types.\n\n" + else + trap - ERR + return \$exit_code + fi + } + unpigz -cdf $fasta | \\ kalign \\ $args \\ From a0d8e558c532e4e81aae23c2adbbf866904315aa Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 12:46:09 +0200 Subject: [PATCH 2/7] Update snapshots --- .../kalign/align/tests/main.nf.test.snap | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/kalign/align/tests/main.nf.test.snap b/modules/nf-core/kalign/align/tests/main.nf.test.snap index da6fc94c52e..cee655899ec 100644 --- a/modules/nf-core/kalign/align/tests/main.nf.test.snap +++ b/modules/nf-core/kalign/align/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + "versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94" ], "alignment": [ [ @@ -22,11 +22,15 @@ ] ], "versions": [ - "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + "versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94" ] } ], - "timestamp": "2024-03-22T16:42:01.934768" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-09-20T12:44:18.067352" }, "SARS-CoV-2 scaffolds fasta - compressed": { "content": [ @@ -40,7 +44,7 @@ ] ], "1": [ - "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + "versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94" ], "alignment": [ [ @@ -51,10 +55,14 @@ ] ], "versions": [ - "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + "versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94" ] } ], - "timestamp": "2024-03-22T16:42:07.734293" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-09-20T12:44:31.031883" } } \ No newline at end of file From be7a7e891d0e8758888bfadc494ceba86bdf3cc9 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 12:46:19 +0200 Subject: [PATCH 3/7] Make lint happy --- modules/nf-core/kalign/align/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/kalign/align/main.nf b/modules/nf-core/kalign/align/main.nf index 7262e246231..5cc23e2927b 100644 --- a/modules/nf-core/kalign/align/main.nf +++ b/modules/nf-core/kalign/align/main.nf @@ -26,13 +26,13 @@ process KALIGN_ALIGN { error_handler() { exit_code=\$? if [ \$exit_code -eq 132 ]; then - echo "\n\nKALIGN failed because is incompatible with some CPU types.\n\n" + echo "\n\nKALIGN failed because is incompatible with some CPU types, see https://github.com/TimoLassmann/kalign/issues/46.\n\n" else trap - ERR return \$exit_code fi } - + unpigz -cdf $fasta | \\ kalign \\ $args \\ From c38febf4fd44030fa7a549dc6226b46641c5b996 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 14:17:13 +0200 Subject: [PATCH 4/7] Add call to the function with trap --- modules/nf-core/kalign/align/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nf-core/kalign/align/main.nf b/modules/nf-core/kalign/align/main.nf index 5cc23e2927b..ca32dc4d5bf 100644 --- a/modules/nf-core/kalign/align/main.nf +++ b/modules/nf-core/kalign/align/main.nf @@ -32,6 +32,8 @@ process KALIGN_ALIGN { return \$exit_code fi } + + trap 'error_handler' ERR unpigz -cdf $fasta | \\ kalign \\ From 0a4197ea1f81f4fd357e872a85b79e229ebb6935 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 14:53:11 +0200 Subject: [PATCH 5/7] Make nf-core lint happy --- modules/nf-core/kalign/align/meta.yml | 58 ++++++++++++++++----------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/modules/nf-core/kalign/align/meta.yml b/modules/nf-core/kalign/align/meta.yml index 187f6bc3fae..415ceee2fa0 100644 --- a/modules/nf-core/kalign/align/meta.yml +++ b/modules/nf-core/kalign/align/meta.yml @@ -12,36 +12,46 @@ tools: tool_dev_url: "https://github.com/TimoLassmann/kalign" doi: "10.1093/bioinformatics/btz795" licence: ["GPL v3"] + identifier: "biotools:kalign" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test']` - - fasta: - type: file - description: Input sequences in FASTA format. May be gzipped or uncompressed. - pattern: "*.{fa,fasta}{.gz,}" - - compress: - type: boolean - description: Flag representing whether the output MSA should be compressed. Set to true to enable/false to disable compression. Compression is done using pigz, and is multithreaded. + - - meta: + type: map + description: | + Groovy Map containing sample information + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input sequences in FASTA format. May be gzipped or uncompressed. + pattern: "*.{fa,fasta}{.gz,}" + - - compress: + type: boolean + description: Flag representing whether the output MSA should be compressed. + Set to true to enable/false to disable compression. Compression is done using + pigz, and is multithreaded. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'test']` - alignment: - type: file - description: Alignment file. May be gzipped or uncompressed, depending on if `compress` is set to `true` or `false`. - pattern: "*.{aln}{.gz,}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test']` + - "*.aln{.gz,}": + type: file + description: Alignment file. May be gzipped or uncompressed, depending on if + `compress` is set to `true` or `false`. + pattern: "*.{aln}{.gz,}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@luisas" - "@JoseEspinosa" maintainers: - "@luisas" - - "@JoseEspinosa" + - "@JoseEspinosa" \ No newline at end of file From 95ba3ba5c27c22081c1c56386485d3d7c0e32387 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 20 Sep 2024 15:00:40 +0200 Subject: [PATCH 6/7] More linting --- modules/nf-core/kalign/align/main.nf | 2 +- modules/nf-core/kalign/align/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/kalign/align/main.nf b/modules/nf-core/kalign/align/main.nf index ca32dc4d5bf..59998df1adc 100644 --- a/modules/nf-core/kalign/align/main.nf +++ b/modules/nf-core/kalign/align/main.nf @@ -32,7 +32,7 @@ process KALIGN_ALIGN { return \$exit_code fi } - + trap 'error_handler' ERR unpigz -cdf $fasta | \\ diff --git a/modules/nf-core/kalign/align/meta.yml b/modules/nf-core/kalign/align/meta.yml index f1061978ec4..44cd288e734 100644 --- a/modules/nf-core/kalign/align/meta.yml +++ b/modules/nf-core/kalign/align/meta.yml @@ -17,7 +17,7 @@ input: - - meta: type: map description: | - Groovy Map containing sample information + Groovy Map containing sample information e.g. [ id:'test'] - fasta: type: file From bd7d9f5b7d6fe9171e2c784f74e313cef6881cd5 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Fri, 20 Sep 2024 13:44:41 +0000 Subject: [PATCH 7/7] Make lint happy --- modules/nf-core/kalign/align/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/kalign/align/meta.yml b/modules/nf-core/kalign/align/meta.yml index 44cd288e734..66c5ca8af95 100644 --- a/modules/nf-core/kalign/align/meta.yml +++ b/modules/nf-core/kalign/align/meta.yml @@ -50,4 +50,4 @@ authors: - "@JoseEspinosa" maintainers: - "@luisas" - - "@JoseEspinosa" \ No newline at end of file + - "@JoseEspinosa"