Migrate narfmap/hashtable to topic channels - #12445
Conversation
LouisLeNezet
left a comment
There was a problem hiding this comment.
Hi @xHaMMaDy,
Would you have some time to finish this PR ?
| { assert snapshot( | ||
| process.out.bam, | ||
| process.out.bam.collect { meta, bamFile -> [meta, file(bamFile).name, file(bamFile).exists(), file(bamFile).size() > 0] }, | ||
| file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, |
There was a problem hiding this comment.
This line should be as a separate assertion outside the snapshot.
There was a problem hiding this comment.
I meant
assertAll (
{ assert process.success },
{ assert file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") } },
{ assert snapshot(
process.out.bam.collect { meta, bamFile -> [meta, file(bamFile).name, bam(bamFile).getReadsMD5()] },
process.out.findAll { key, val -> key.startsWith("versions") },
).match() }
)
LouisLeNezet
left a comment
There was a problem hiding this comment.
You just need now to update the meta and snapshot
| { assert snapshot( | ||
| process.out.bam, | ||
| process.out.bam.collect { meta, bamFile -> [meta, file(bamFile).name, file(bamFile).exists(), file(bamFile).size() > 0] }, | ||
| file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, |
There was a problem hiding this comment.
I meant
assertAll (
{ assert process.success },
{ assert file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") } },
{ assert snapshot(
process.out.bam.collect { meta, bamFile -> [meta, file(bamFile).name, bam(bamFile).getReadsMD5()] },
process.out.findAll { key, val -> key.startsWith("versions") },
).match() }
)
|
Pushed an update for the align test snapshots.
I also tested the exact
So for this specific malformed-BAM regression test, I moved the Local checks:
Comment added by Codex |
Keep the PR branch linear on current master and preserve the reviewed NARFMAP changes.\n\nGenerated by Codex
147ac60 to
d8543dd
Compare
Use channel-aware sanitization and stable BAM read-hash fields.\n\nGenerated by Codex
Record the empty-read MD5 produced by the fixture across all profiles.\n\nGenerated by Codex
Snapshot stable BAM names because the fixture emits empty-read BAMs and lint rejects empty MD5 values.\n\nGenerated by Codex
|
CI is green after the latest update. I rebased the branch onto current master and kept the PR diff scoped to the NARFMAP modules. The align snapshots now avoid empty BAM MD5 values, and the hashtable snapshot uses stable output names with channel-aware sanitization. Comment added by Codex |
LouisLeNezet
left a comment
There was a problem hiding this comment.
It seems that the narfmap/align topic migration was already done.
If you want to simplify the nf-test for this module, please use sanitizeOutput with the readsMD5Keys to check for the bam file md5 sum.
https://nf-co.re/nft-utils#sanitizeoutput---sanitize-process-output-to-create-clean-snapshots
Also if the log is unstable please use unstableKeys:["log"]
| tuple val(meta), path('*.log'), emit: log | ||
| tuple val("${task.process}"), val('narfmap'), eval("dragen-os --version 2>&1"), topic: versions, emit: versions_narfmap | ||
| tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools | ||
| tuple val("${task.process}"), val('samtools'), eval("samtools version | sed -En '1s/.* ([0-9]+\\.[0-9]+).*/\\1/p'"), topic: versions, emit: versions_samtools |
There was a problem hiding this comment.
The previous topic expression was better.
| { assert snapshot( | ||
| file(process.out.hashmap[0][1]).name, | ||
| file(process.out.versions[0]).name | ||
| sanitizeOutput(process.out, ignoreKeys: ["hashmap"]), |
There was a problem hiding this comment.
If you use sanitizeOutput, you don't need to collect the file names after.
There was a problem hiding this comment.
Also you should use unstableKeys here and not ignoreKeys.
Description
versions.ymloutput with aversions_narfmaptuple broadcast totopic: versionsdragen-os --version 2>&1to report the NARFMAP versionGenerated by Codex
PR checklist
Closes #12319
topic: versions.label.Tests
nf-core modules lint narfmap/hashtable(59 passed)