Sort peak QC plot inputs deterministically - #454
Open
NicoDeVeaux wants to merge 3 commits into
Open
Conversation
`collect` emits in task-completion order, and plot_macs3_qc.r / plot_homer_annotatepeaks.r derive sample ids from the order of the file list they are handed. In plot_homer_annotatepeaks.r the summary column order follows the `feature` factor levels, which accumulate by first appearance across the input files, so a reshuffle changes the md5 of macs3_annotatePeaks.*.summary.txt, its _mqc.tsv, and the MultiQC peak annotation plot table. Observed as an intermittent snapshot mismatch in tests/skip_trimming.nf.test on nf-core#453. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 4.0.3. For more documentation on how to update your pipeline, please see the Synchronisation documentation. |
|
❌ nf-test failed with latest Nextflow versionNote Tests with Nextflow's latest version failed but it will not cause a CI workflow failure.
See the full run for details. |
`toSortedList` emits an empty list when its source channel is empty, whereas `collect` emits nothing at all, so the previous version started PLOT_MACS3_QC with no files when no merged-replicate peaks exist and plot_macs3_qc.r died on `flag "i" requires an argument`. Seen in the `bowtie2 with stub` test. Sort the staged file list in the process script instead, which leaves the channel semantics untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an intermittent nf-test snapshot failure in
tests/skip_trimming.nf.test.The flake
The same commit produced opposite results on the same Nextflow version (
26.07.0-edge), with onlyCHANGELOG.mddiffering between the two pipeline states:docker | latest-everything | 2/7Three md5s differ when it fails, all from the same source:
macs3_annotatePeaks.mLb.clN.summary.txt,macs3_annotatePeaks.mLb.clN.summary_mqc.tsv, and themultiqc_mlib_peak_annotation-plot.txtderived from them.Cause
collectemits in task-completion order, andPLOT_MACS3_QC/PLOT_HOMER_ANNOTATEPEAKSderive their sample ids from the order of the file list via-i ${annos.join(',')}/-s ....In
bin/plot_homer_annotatepeaks.rthe summary rows are already deterministic — lines 99-101 sort the factor levels. The columns are not:summary.dat <- dcast(plot.feature.dat, variable ~ feature)takes its column order from thefeaturefactor levels, which accumulate by first appearance across the input files. Samples with differing feature sets therefore produce different column orders depending on which file was read first, which is why this only trips occasionally.Fix
Sort the staged file list by name inside the two process scripts.
Notes
subworkflows/local/bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nflines 30 and 64 have the same unsorted-collectpattern feeding consensus peak and featureCounts column order. nf-core modules update #448 already fixes that call site.featurefactor levels before thedcastinplot_homer_annotatepeaks.rwould harden the R script independently of input order. Left out to keep this change small.PR checklist
nf-core lint).CHANGELOG.mdis updated.