Skip to content

Support configurable report structure and synchronized table of contents in CPSR and PCGR #314

Open

Description

@ShatalovP

Hi Sigve!

Please allow users to customize the structure of CPSR and PCGR reports by selecting which analytical sections to include, changing their order, and organizing them into groups.

The table of contents should be generated automatically from the final structure, with the correct section order, hierarchy, and links.

Requirements

  • Enable, disable, and reorder sections and subsections.
  • Support custom section titles and grouping.
  • Allow summary cards, plots, and tables to be positioned independently where appropriate.
  • Keep headings, section anchors, and table-of-contents links synchronized when components are moved.
  • Apply the configured structure to both HTML and PDF outputs.
  • Preserve the current layout as the default.
    Suggested implementation

Add an optional layout configuration file, supplied through a parameter such as:

--report-layout report-layout.yaml

Each report component could have a stable identifier. The configuration would specify its inclusion, position, title, and nesting. For example:
sections:

  • id: msi_status

  • id: tumor_mutational_burden

  • id: somatic_variants
    title: Somatic variants
    children:

    • id: variant_oncogenicity
    • id: variant_actionability
    • id: variant_summary
  • id: somatic_cnas

  • id: germline_findings

  • id: documentation
    The report body and table of contents should be generated from the same section tree. Each component should move together with its heading and anchor, preventing navigation links from pointing to unrelated content.

Acceptance criteria

  • The configuration controls section inclusion, order, titles, and grouping.
  • The table of contents matches the rendered report and links to the correct sections.
  • HTML and PDF follow the same configured structure.
  • Layout changes preserve analytical results and table contents.
  • Invalid configurations produce clear errors.
  • Running without a configuration preserves the default layout.

Please also support configuring the column order in variant tables through the report layout configuration. For example in CPSR:

Gene → Alteration → DP → VAF → Genomic Change → Clinical Significance → ACMG CODE

The configured order should apply to both HTML and PDF reports, while preserving column values, formatting, and interactive functionality in HTML.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions