Repository navigation
Conversation
…mizers Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
This comment has been minimized.
This comment has been minimized.
|
/review |
|
✅ MultiQC preview report generated for Console output$ multiqc -m kraken test-data/data/modules -n multiqc_report_pr3759.html -o report --no-ansi
/// MultiQC 🔍 v1.36.dev0
file_search | Search path: /home/runner/work/MultiQC/MultiQC/test-data/data/modules
file_search | Only using modules: kraken
kraken | Found 17 reports
file_search | Only using modules: kraken
write_results | Data : report/multiqc_report_pr3759_data
write_results | Report : report/multiqc_report_pr3759.html
multiqc | MultiQC completeHow this worksThe bot posts a preview report on PRs that edit modules:
The bot only posts a new report when there are new commits. If there are none, it reacts 😕 to your comment. The bot hides older report comments. |
|
Fixes a real crash: Full reviewCI statusTwo checks are red, and neither failure comes from this PR:
Both come from #3698, which is now on Findings💡 Suggestion: Module-specific tests normally go in This would also make the two type-annotation changes unnecessary. 💡 Suggestion: If you keep the annotations, 🪶 Nit: There's an edge case here, but it's not a regression. If every species row in a minimizer report has zero distinct minimizers, Checks
What's good
|
…on edits Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
|
Thanks! I've done this. |

Who hits this: anyone running MultiQC on Kraken 2 reports made with both
--report-minimizer-dataand--report-zero-counts, which writes a row for every species in the database, most with zero distinct minimizers. https://github.com/DerrickWood/kraken2/blob/master/docs/MANUAL.markdownDescription
parse_logs()inmultiqc/modules/kraken/kraken.pyhas a guard against zero distinct minimizers:The fields come from
line.split("\t"), sominimizer_distinctis the string"0", and"0" != 0is always true. The guard never fires, and any species row with zero distinct minimizers raisesZeroDivisionError. This came in with the parser rewrite in #2756.In a batch, one such report stops the whole Kraken module, so Kraken results are missing for every sample, including valid ones. With
--strictMultiQC exits 1; without it, the module error is logged and the report has no Kraken section.Changes
multiqc/modules/kraken/kraken.py: convertminimizer_distincttointbefore the zero check, and only store a duplication ratio when the distinct count is non-zero. The duplication heatmap already skips falsy values, so leaving the key out gives the same output as storing0.0. I checked this on all 17 files intest-data/data/modules/kraken, which produce identical output before and after. It also avoids storing a0.0for every zero-count species.table_pct_by_sample,dup_by_taxon_by_sample). These are needed because the new test importskraken.py, and themypy testsCI job then type-checks the module and fails on those two lines without them.tests/test_kraken_minimizers.py: a parser-level test and a two-sampleparse_logstest (one normal report, one with a zero-count species row).Verification
--report-minimizer-data --report-zero-counts): before the fix, a mixed two-sample batch exits 1 withZeroDivisionErrorand exports Kraken data for 0 of 2 samples. After the fix it exports both, with the same counts, unclassified percentage and duplication heatmap value as the normal-report control.mypy multiqc,mypy tests,ruff checkandruff format --checkare clean.Found and written with AI agents; a separate AI referee reproduced the problem before this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N