Skip to content

Add stub block and migrate plasmidid to topic channels#11438

Open
HReed1 wants to merge 2 commits into
nf-core:masterfrom
HReed1:stub-topics-plasmidid
Open

Add stub block and migrate plasmidid to topic channels#11438
HReed1 wants to merge 2 commits into
nf-core:masterfrom
HReed1:stub-topics-plasmidid

Conversation

@HReed1
Copy link
Copy Markdown
Contributor

@HReed1 HReed1 commented Apr 30, 2026

Changes

  • Migrated version emission from versions.yml heredoc to topic: versions tuple pattern
  • Added stub: block creating all 8 output directories and touch files
  • Added stub test case
  • Used hybrid snapshot strategy: stable outputs (html, tab, fasta_files, versions) with full md5, non-deterministic directory outputs (logs, kmer, database, data, images) by name only
  • Auto-fixed meta.yml to align with main.nf

Verification

  • nf-core modules lint plasmidid: 53/53 passed, 0 failures
  • nf-test (Docker): 2/2 passed, snapshots stable across consecutive runs

Part of #4570

@HReed1
Copy link
Copy Markdown
Contributor Author

HReed1 commented Apr 30, 2026

@nf-core-bot fix linting

Copy link
Copy Markdown
Contributor

@LouisLeNezet LouisLeNezet left a comment

Choose a reason for hiding this comment

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

Hi,
Just a few changes needed before approval

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() }
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.

In the stub test all the files should be stable.

file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)

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.

Please remove the empty new line as well as // meta map. This is no more needed.

Comment thread modules/nf-core/plasmidid/main.nf Outdated
tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files
tuple val(meta), path("${prefix}/kmer/") , emit: kmer
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid
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.

This can be simplified as

Suggested change
tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid
tuple val("${task.process}"), val('plasmidid'), eval("plasmidID --version 2>&1| sed 's/^plasmidID //'"), topic: versions, emit: versions_plasmidid

def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p ${prefix}/images ${prefix}/logs ${prefix}/data ${prefix}/database ${prefix}/fasta_files ${prefix}/kmer
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.

Could you add some files in the empty folders that correspond to what is present in the real test ?

Comment thread modules/nf-core/plasmidid/meta.yml Outdated
pattern: "*.{tab}"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
- edam: http://edamontology.org/format_3475
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.

Please keep the comment

Suggested change
- edam: http://edamontology.org/format_3475
- edam: http://edamontology.org/format_3475 # TSV

- Replace versions.yml with eval() topic: versions emission
- Simplify version command per reviewer suggestion
- Add stub block with representative files in all output directories
- Remove unstableKeys from stub test (stubs are deterministic)
- Remove // meta map comments and blank lines from tests
- Restore EDAM # TSV comment on tab output
- Regenerate meta.yml, remove legacy versions output
@HReed1 HReed1 force-pushed the stub-topics-plasmidid branch from 7d590dc to 9d2f946 Compare May 15, 2026 04:54
@HReed1
Copy link
Copy Markdown
Contributor Author

HReed1 commented May 15, 2026

Thanks for the review @LouisLeNezet! All feedback addressed:

✅ Removed unstableKeys from stub test — all stub outputs are now stable
✅ Removed // meta map comments and blank lines from test file
✅ Simplified version eval command
✅ Added representative files in stub directories matching real outputs
✅ Restored # TSV EDAM comment on tab output in meta.yml

Verification:
nf-core modules lint plasmidid: 53/53 passed, 0 failures
nf-test (Docker): 2/2 passed — script (65.5s) + stub (5.5s)

Note on Conda CI failure: This is a pre-existing upstream issue unrelated to this PR (the script: block is unchanged from master). The Conda-resolved Prokka produces an empty/malformed .gff file, causing the downstream gff_to_bed.sh helper inside plasmidID to fail at line 834 (source). This is a known Conda-specific Prokka dependency incompatibility that doesn't occur in Docker/Singularity where the container bundles compatible dependency versions. Docker and Singularity CI pass cleanly.

@HReed1 HReed1 enabled auto-merge May 15, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants