Skip to content

Add stub block and migrate plasmidid to topic channels#11438

Open
HReed1 wants to merge 4 commits intonf-core:masterfrom
HReed1:stub-topics-plasmidid
Open

Add stub block and migrate plasmidid to topic channels#11438
HReed1 wants to merge 4 commits intonf-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

HReed1 and others added 2 commits April 30, 2026 15:11
- Replace manual channel-by-channel snapshots with sanitizeOutput(unstableKeys)
- Mark directory outputs (images, logs, data, database, kmer) as unstable
- Fix lint failure: versions_plasmidid now properly keyed in snapshot
- Stub snapshot verified locally; main test snapshot from prior working run
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.

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 ?

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

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