Skip to content

General - Report Export #18

@hansen-maria

Description

@hansen-maria

Is your feature request related to a problem? Please describe.
BioProfileKit generates rich per-column and dataset-level statistics, but all computed data is currently consumed only by the HTML report. There is no way to access the raw analysis results programmatically for downstream processing, reproducibility auditing, or integration into laboratory information management systems (LIMS). Users who want to archive results, diff two runs, or feed BioProfileKit output into a pipeline have no option other than scraping the HTML.

Describe the solution you'd like
Add a --export CLI option that serialises the full analysis result to a structured JSON file alongside the HTML report:

bioprofilekit -i data.csv --export
→ data_renders/
    index.html
    columns.html
    ...
    bioprofilekit_export.json   ← new

The export should include all DatasetSummary, ColumnOverview, NumericColumns, CategoricalColumns, QualityAssessment, and MultivariateAnalysis fields, serialised with dataclasses.asdict() and written via json.dump(). HTML plot strings should be excluded by default and optionally included via --export-plots.

In addition, expose the export via the frontend: add a persistent Export JSON button to the navbar or the Analysis Overview page that triggers a client-side download of the same JSON structure. Since the report is a static HTML file, the export data should be embedded at report generation time as a <script type="application/json" id="bpk-export-data"> block in numeric_overview.jinja, and the button's onclick handler should read that block and invoke URL.createObjectURL() to initiate the download — no server required.

Describe alternatives you've considered
Exporting only the Quality Assessment Report as JSON. A full export is more useful for reproducibility and enables downstream tools to re-render or re-analyse the data without re-running BioProfileKit. A CSV export of the column-level summary was also considered but loses the nested structure of sequence and taxonomy data.

Additional context
The embedded JSON approach keeps the report self-contained (no external files needed) and works in both the local static HTML context and the de.NBI web deployment. For de.NBI, the same JSON structure would serve as the API response body, enabling the Vue.js frontend to consume BioProfileKit results without re-running the Python pipeline on every page load. The --export flag and the in-browser button should produce byte-for-byte identical output so that CLI and frontend exports are interchangeable for reproducibility purposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions