Skip to content

isoseq: support pbreports-format refine JSON - #3698

Merged
ewels merged 2 commits into
mainfrom
fix/issue-3673-isoseq-refine-attributes
Nov 27, 2026
Merged

ewels merged 2 commits into
mainfrom
fix/issue-3673-isoseq-refine-attributes

Conversation

@ewels

@ewels ewels commented Oct 2, 2026

Copy link
Copy Markdown
Member
  • This comment contains a description of changes (with reason)

Reads refine metrics from the attributes list used by newer isoseq releases.

Closes #3673

Test data: MultiQC/test-data#398

🤖 Generated with Claude Code

ewels and others added 2 commits October 2, 2026 16:18
The regression data added to MultiQC/test-data is exercised by
test_modules_run, so a separate unit test is redundant.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@multiqc-bot

Copy link
Copy Markdown
Contributor

✅ MultiQC preview report generated for isoseq. See run.

Screenshot

MultiQC report screenshot

Console output
$ multiqc -m isoseq test-data/data/modules -n multiqc_report_pr3698.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: isoseq
            isoseq | Found 2 cluster reports
            isoseq | Found 3 refine reports
            isoseq | Found 3 refine reports
       file_search | Only using modules: isoseq
     write_results | Data        : report/multiqc_report_pr3698_data
     write_results | Report      : report/multiqc_report_pr3698.html
           multiqc | MultiQC complete
How this works

The bot posts a preview report on PRs that edit modules:

  1. When the first build finishes, a few minutes after the PR opens. If you push more fixes before then, the report uses the latest commit.
  2. Each night, if there are new commits since the last report.
  3. When anyone comments /report. If the build is still running, the report posts when it finishes.

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.

@ewels

ewels commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

/review

@claude

claude Bot commented Oct 6, 2026

Copy link
Copy Markdown

This PR fixes the empty "CCS statistics" table from #3673. Newer isoseq refine releases write a pbreports JSON that nests the metrics in an attributes list, and this change flattens that list to id: value before the table is built. The fix is small and correct, CI is green, and the issue and test data are linked. The only thing I'd flag before merging is the order of merges with the test-data PR.

Full review

Findings

🔧 Change: merge MultiQC/test-data#398 first

The regression file (data/modules/isoseq/issue_3673/sample.filter_summary.report.json) only lives in MultiQC/test-data#398, which is still open. The second commit removed the unit test because test_modules_run covers this case. That's only true once the test-data PR is on test-data main. Until then the green CI here never runs the new code path (codecov/patch passing doesn't show the attributes branch ran). Please merge #398 first, then re-run CI on this PR. That way the new path is actually tested before this lands.

💡 Suggestion: multiqc/modules/isoseq/isoseq.py:231

The helptext still says the summary file is *.filter_summary.json. The issue (and the new test data) shows current releases write *.filter_summary.report.json. A one-word update would keep the helptext in line with the format this PR now supports.

🪶 Nit: multiqc/modules/isoseq/isoseq.py:22

"Newer isoseq versions" is vague. If you know the release where the format changed (the issue was seen with isoseq 26.2.0 / pbcopper v26.2.0), name it in the docstring so future maintainers know which versions use which format.

🪶 Nit (not introduced by this PR, just noticed nearby): multiqc/modules/isoseq/isoseq.py:98-101

The data file names are swapped: JSON data goes to multiqc_isoseq_refine_csv and CSV data to multiqc_isoseq_refine_json. Also, _add_refine_box_plots only runs when JSON data exists and builds empty box plots when no CSV was found. Neither is a regression from this PR. They could go in a follow-up while this code is fresh.

What's good

  • The format check ("attributes" in data) keeps the old flat format working, so the change is backwards compatible.
  • It crashes loudly: attr["id"] / attr["value"] are accessed directly rather than with .get(), so a malformed pbreports file fails visibly instead of producing an empty table again. This follows the project's crash-loudly rule.
  • The change is small and does one thing. Real-format test data goes through the test-data repo rather than being mocked in a unit test.

@ewels ewels added this to the v1.36 milestone Nov 27, 2026
@ewels
ewels merged commit eb28d06 into main Nov 27, 2026
14 checks passed
@ewels
ewels deleted the fix/issue-3673-isoseq-refine-attributes branch November 27, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isoseq module: refine JSON table renders empty - expects flat keys, actual pbreports format nests them in 'attributes'

2 participants