Skip to content

Commit

Permalink
Display message when error 132 found (#6675)
Browse files Browse the repository at this point in the history
* Display message when error 132 found

* Update snapshots

* Make lint happy

* Add call to the function with trap

* Make nf-core lint happy

* More linting

* Make lint happy
  • Loading branch information
JoseEspinosa authored Sep 20, 2024
1 parent 1960623 commit 49057d3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
12 changes: 12 additions & 0 deletions modules/nf-core/kalign/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ 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, see https://github.com/TimoLassmann/kalign/issues/46.\n\n"
else
trap - ERR
return \$exit_code
fi
}
trap 'error_handler' ERR
unpigz -cdf $fasta | \\
kalign \\
$args \\
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/kalign/align/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ tools:
tool_dev_url: "https://github.com/TimoLassmann/kalign"
doi: "10.1093/bioinformatics/btz795"
licence: ["GPL v3"]
identifier: ""
identifier: "biotools:kalign"
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test']`
e.g. [ id:'test']
- fasta:
type: file
description: Input sequences in FASTA format. May be gzipped or uncompressed.
Expand Down
20 changes: 14 additions & 6 deletions modules/nf-core/kalign/align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
],
"1": [
"versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe"
"versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94"
],
"alignment": [
[
Expand All @@ -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": [
Expand All @@ -40,7 +44,7 @@
]
],
"1": [
"versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe"
"versions.yml:md5,b5ef6a09110c24f552fcddb1af13ff94"
],
"alignment": [
[
Expand All @@ -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"
}
}

0 comments on commit 49057d3

Please sign in to comment.