Add --report_json flag for machine-readable export of report tables#589
Open
TianYuan-Liu wants to merge 1 commit intomasterfrom
Open
Add --report_json flag for machine-readable export of report tables#589TianYuan-Liu wants to merge 1 commit intomasterfrom
TianYuan-Liu wants to merge 1 commit intomasterfrom
Conversation
Adds a new --report_json CLI flag that exports all SQANTI3 report tables (summary counts, isoform/gene classification, splice junctions, polyA, CAGE, and quality metrics) as a structured JSON file. The JSON export works alongside any --report format and can also be used with --report skip to produce only the JSON without HTML/PDF output. Closes #218 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on April 7. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
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.
Summary
--report_jsonCLI flag that exports all SQANTI3 report tables as a structured JSON file ({prefix}_report_tables.json)--reportformat (html/pdf/both) and also with--report skipto produce only JSON without HTML/PDF outputChanges
src/qc_argparse.py— new--report_jsonCLI flag (boolean, defaultFalse)src/qc_output.py— forward flag to R script as 6th argumentsrc/qc_pipeline.py— run R script when--report skip --report_jsonis usedsrc/parallel.py— mirror wiring for parallel/chunked executionsrc/write_parameters.py— logReportJSONparametersrc/utilities/report_qc/SQANTI3_report.R—export_tables_to_json()function usingjsonlite, accept"skip"format, fixed pdf/html branch logictest/integration/test_report_json.py— 4 integration tests covering: JSON+HTML, JSON+skip, no-flag backward compatibility, quality metrics structureJSON structure
{ "metadata": { "generated_at": "...", "classification_file": "...", "junction_file": "..." }, "summary": { "unique_genes": 123, "unique_isoforms": 456, "isoform_classification": [{"category": "FSM", "n_isoforms": 100}, ...], "gene_classification": [{"category": "FSM", "n_genes": 50}, ...], "splice_junction_classification": [{"category": "canonical_known", "n_sjs": 200, "percent": 95.2}, ...] }, "polya": { "by_category": [...], "motif_frequency": [...] }, "cage": { "by_category": [...] }, "quality_metrics": { "rt_switching": [{"structural_category": "...", "count": 5, "total": 100, "percent": 5.0}], "noncanonical_sj": [...], "nmd_prediction": [...], "sj_coverage": [...] } }Validation
All JSON values validated against classification/junction files on example data — counts match exactly.
Closes #218
Test plan
sqanti3_qc.py --report_jsonwith example data and verify JSON outputsqanti3_qc.py --report skip --report_jsonand verify JSON-only output--report_jsonand verify no JSON file is createdpytest test/integration/test_report_json.py -v🤖 Generated with Claude Code