Skip to content

Commit

Permalink
Fix broken versions.yml file in last/train. (#7393)
Browse files Browse the repository at this point in the history
Here is the long story:

Escape sequences for newline and tab in a shell `tr` command were not
escaped in the script section of the module, causing them to be expanded
in `.command.sh`.

This did not prevent `tr` from doing its job, but this caused the lines
in the script to be indented, like this:

```
    cat <<-END_VERSIONS > versions.yml
    "NFCORE_PAIRGENOMEALIGN:PAIRGENOMEALIGN:PAIRALIGN_M2M:ALIGNMENT_TRAIN":
        last: $(lastdb --version | sed 's/lastdb //')
    END_VERSIONS
```

The indentation broke the herescript, but did not cause the module to
fail.

Therefore, the `versions.yml` file contained one extra line with
`    END_VERSIONS` in it.  This crashes the pipelines that collect the
version numbers, but this was not noticed because `last/train` is always
used with other `last/` submodules, and I was not using `last/train`'s
versions file until today, because I was assuming that the information
would always be redundant.
  • Loading branch information
charles-plessy authored Jan 30, 2025
1 parent a4cb3da commit 29a9928
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions modules/nf-core/last/train/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ process LAST_TRAIN {
$fastx \\
> ${prefix}.train
echo "id\tsubstitution_percent_identity\tlast -t\tlast -a\tlast -A\tlast -b\tlast -B\tlast -S" > ${prefix}.train.tsv
printf "\$(basename ${prefix}.train .target.train)\t" >> ${prefix}.train.tsv
grep 'substitution percent identity' ${prefix}.train | tail -n 1 | awk '{print \$5}' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -t' ${prefix}.train | tail -n 1 | awk '{print \$2}' | sed -e 's/-t//' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -a' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -A' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -b' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -B' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv
grep 'last -S' ${prefix}.train | tail -n 1 | awk '{print \$3}' >> ${prefix}.train.tsv
echo "id\tsubstitution_percent_identity\tlast -t\tlast -a\tlast -A\tlast -b\tlast -B\tlast -S" > ${prefix}.train.tsv
printf "\$(basename ${prefix}.train .target.train)\t" >> ${prefix}.train.tsv
grep 'substitution percent identity' ${prefix}.train | tail -n 1 | awk '{print \$5}' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -t' ${prefix}.train | tail -n 1 | awk '{print \$2}' | sed -e 's/-t//' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -a' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -A' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -b' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -B' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv
grep 'last -S' ${prefix}.train | tail -n 1 | awk '{print \$3}' >> ${prefix}.train.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
8 changes: 4 additions & 4 deletions modules/nf-core/last/train/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
]
],
"2": [
"versions.yml:md5,c1f06f4162a8b4ee1b8094d967f6678d"
"versions.yml:md5,b2d4a4fce93a910c90768053127969b3"
],
"multiqc": [
[
Expand All @@ -95,14 +95,14 @@
]
],
"versions": [
"versions.yml:md5,c1f06f4162a8b4ee1b8094d967f6678d"
"versions.yml:md5,b2d4a4fce93a910c90768053127969b3"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
"nextflow": "24.10.4"
},
"timestamp": "2025-01-22T10:22:21.360808"
"timestamp": "2025-01-30T18:37:11.305733"
}
}

0 comments on commit 29a9928

Please sign in to comment.