Skip to content
Open
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
9 changes: 6 additions & 3 deletions modules/nf-core/gstama/polyacleanup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process GSTAMA_POLYACLEANUP {
tuple val(meta), path(fasta)

output:
tuple val(meta), path("*.fa.gz") , emit: fasta
tuple val(meta), path("*_seq.fa.gz") , emit: seq
tuple val(meta), path("*_polya_flnc_report.txt.gz"), emit: report
tuple val(meta), path("*_tails.fa.gz") , emit: tails

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you do:

output:
tuple val(meta), path("${prefix}.fa.gz")                   , emit: fasta
tuple val(meta), path("${prefix}_polya_flnc_report.txt.gz"), emit: report
tuple val(meta), path("${prefix}_tails.fa.gz")             , emit: tails

This way, you do not rename the tool output at all. Just make the fasta output specific.

@sguizard sguizard Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have correct my first message once I understood the real problem.
I forgot, my apologies for that.
Let's rewind to the original problem and fold back to the solution.

The last update of the module changed the outputs to make them more generic by removing the _tama prefix. This was a good idea, but it introduced a regression.

For your information, the _tama prefix is an artefact from when I developed the isoseq pipeline. Maybe not the smartest idea at the time, but I learned a lot since then.

So what was the idea behind those three channels and why the last update introduced a regression?
In order to not mixing two kind of sequence information generated by the script, the Full Length Non Chimeric reads one side and the poly A on the other side, I have set up a fasta output channel and a tails output channel.
The tails channel I suppose to grab the polyA sequences and the fasta is supose to grab FLNC sequences.
In its original code, the channel globs included a _tama prefix. The reason of this is simply because the nf-core/isoseq pipeline generated files have this prefix. Again, maybe not the wisest choice, but I was young and nf-core naive.

Now, fast forward to the last module update. In order, make the module code more generic, _tama has been removed. A wise choice, but with unexpected consequences. Changing the fasta channel glob from *_tama.fa.gz to *.fa.gz change which files are grabbed by the channel. Instead of collecting only the FLNCs, it grabs the FLNCs and the polyA tails. Indeed, those two files shares the same extension.

Even if this small modification has nothing dramatic, it has the annoying effect to mix the two information into one channel. After, I can understand that the channel name can be confusing.fasta can be changed to seq to avoid this confusion.

To fix this regression, this simplest solution is to make FLNC fasta file name unique by renaming it and adapt the glob to this renamed version. This is the point of this patch.

Writing this made me realize how the fasta channel name can be confusing. I'm going to push a commit to rename it into seq. It will be more inline with its purpose.

tuple val("${task.process}"), val('gstama'), eval("tama_collapse.py -version | sed -n 's/tc_version_date_//p'"), emit: versions_gstama, topic: versions
Expand All @@ -28,15 +28,18 @@ process GSTAMA_POLYACLEANUP {
-f $fasta \\
-p ${prefix} \\
$args
gzip ${prefix}.fa

mv ${prefix}.fa ${prefix}_seq.fa

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could remove the mv this and then do:

gzip ${prefix}.fa
gzip ${prefix}_polya_flnc_report.txt
gzip ${prefix}_tails.fa


gzip ${prefix}_seq.fa
gzip ${prefix}_polya_flnc_report.txt
gzip ${prefix}_tails.fa
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "" | gzip > ${prefix}.fa.gz
echo "" | gzip > ${prefix}_seq.fa.gz
echo "" | gzip > ${prefix}_polya_flnc_report.txt.gz
echo "" | gzip > ${prefix}_tails.fa.gz
"""
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/gstama/polyacleanup/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ input:
pattern: "*.{fa,fasta}"
ontologies: []
output:
fasta:
seq:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.fa.gz":
- "*_seq.fa.gz":
type: file
description: The Full Length Non Chimeric reads cleaned from remaining
polyA tails. The sequences are in FASTA format compressed with gzip.
Expand Down
38 changes: 16 additions & 22 deletions modules/nf-core/gstama/polyacleanup/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
"test-gstama-polyacleanup": {
"content": [
{
"fasta": [
"report": [
[
{
"id": "test"
},
[
"test.fa.gz:md5,f0a2c3ca8f19d2197c6b5b273093ebf0",
"test_tails.fa.gz:md5,20a02db3d29cc45b39880e1ad5ee243b"
]
"test_polya_flnc_report.txt.gz:md5,83ba9d11a59ff516f45dd45c78613206"
]
],
"report": [
"seq": [
[
{
"id": "test"
},
"test_polya_flnc_report.txt.gz:md5,83ba9d11a59ff516f45dd45c78613206"
"test_seq.fa.gz:md5,f0a2c3ca8f19d2197c6b5b273093ebf0"
]
],
"tails": [
Expand All @@ -38,32 +35,29 @@
]
}
],
"timestamp": "2026-05-11T23:18:48.341014322",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.03.2"
}
"nf-test": "0.9.3",
"nextflow": "26.04.4"
},
"timestamp": "2026-07-03T08:49:26.133692481"
},
"test-gstama-polyacleanup -- stub": {
"content": [
{
"fasta": [
"report": [
[
{
"id": "test"
},
[
"test.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_tails.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
"test_polya_flnc_report.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"report": [
"seq": [
[
{
"id": "test"
},
"test_polya_flnc_report.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
"test_seq.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"tails": [
Expand All @@ -83,10 +77,10 @@
]
}
],
"timestamp": "2026-05-11T23:18:56.653882224",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.03.2"
}
"nf-test": "0.9.3",
"nextflow": "26.04.4"
},
"timestamp": "2026-07-03T08:49:31.508481265"
}
}