Skip to content

Split detail report notebooks by workflow level - #100

Open
KevinMLanderos wants to merge 2 commits into
v2from
reorder-notebooks-by-workflow
Open

Split detail report notebooks by workflow level#100
KevinMLanderos wants to merge 2 commits into
v2from
reorder-notebooks-by-workflow

Conversation

@KevinMLanderos

Copy link
Copy Markdown
Collaborator

Split the part1/part2 detail reports so each is generated only for the workflow_level stages that ran, replacing the on/off template swap hack.

template_details_part1.qmd -> template_details_sample.qmd
Rename only. Includes template_sample.qmd; rendered when sample runs.

template_details_part2.qmd -> split into:
template_details_compare.qmd — template_overlap.qmd + template_sharing.qmd,
plus a static pointer to the patient report. Rendered when compare runs.
template_details_patient.qmd — template_giana.qmd + template_gliph.qmd.
Rendered when patient runs; no longer gated behind compare.

Drop template_patient_clustering_on/off.qmd and the template_patient_clustering.qmd staging - the patient report is simply not emitted when the patient stage is absent.

template_giana.qmd: import os in the first cell. It used os.path in early cells but only imported os later, relying on template_overlap.qmd (which ran first in the old combined part2) to have imported it. It's now the first include in template_details_patient.qmd.

Wiring: rename params in nextflow.config / nextflow_schema.json (template_details_part1 -> _sample; part2 + patient_clustering_on/off -> _compare + _patient), rework the report channels in subworkflows/local/bulktcr_analysis.nf, and update the README report table.

Verified with nf-test: Bulk {sample,compare}, {sample,patient}, {sample,patient,compare} all pass.

Split the part1/part2 detail reports so each is generated only for the
workflow_level stages that ran, replacing the on/off template swap hack.

  template_details_part1.qmd -> template_details_sample.qmd
      Rename only. Includes template_sample.qmd; rendered when `sample` runs.

  template_details_part2.qmd -> split into:
    template_details_compare.qmd  — template_overlap.qmd + template_sharing.qmd,
        plus a static pointer to the patient report. Rendered when `compare` runs.
    template_details_patient.qmd  — template_giana.qmd + template_gliph.qmd.
        Rendered when `patient` runs; no longer gated behind `compare`.

Drop template_patient_clustering_on/off.qmd and the template_patient_clustering.qmd
staging - the patient report is simply not emitted when the patient stage is absent.

template_giana.qmd: import os in the first cell. It used os.path in early cells
but only imported os later, relying on template_overlap.qmd (which ran first in
the old combined part2) to have imported it. It's now the first include in
template_details_patient.qmd.

Wiring: rename params in nextflow.config / nextflow_schema.json
(template_details_part1 -> _sample; part2 + patient_clustering_on/off ->
_compare + _patient), rework the report channels in
subworkflows/local/bulktcr_analysis.nf, and update the README report table.

Verified with nf-test: Bulk {sample,compare}, {sample,patient},
{sample,patient,compare} all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WhjujvKjf1RV5gABqZnMFB
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Unit Test Results

17 tests  ±0   17 ✅ ±0   7m 1s ⏱️ -18s
 7 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 43de124. ± Comparison against base commit 60726e4.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the bulk HTML “Details” reporting so that sample-, compare-, and patient-level detail notebooks are generated only for the workflow stages that actually ran, removing the previous patient-clustering on/off template swap approach.

Changes:

  • Renames/splits detail report templates into template_details_sample.qmd, template_details_compare.qmd, and template_details_patient.qmd, and updates the compare notebook to point readers to the separate patient report.
  • Rewires report channel construction in BULKTCR_ANALYSIS to emit the new notebooks at the appropriate workflow levels (and decouples patient details from compare).
  • Updates pipeline params/schema/docs accordingly and removes the obsolete patient clustering placeholder templates.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
subworkflows/local/bulktcr_analysis.nf Updates report emission wiring to use split sample/compare/patient detail templates.
README.md Updates report documentation to reflect the split detail notebooks and when they are rendered.
notebooks/template_patient_clustering_on.qmd Removes obsolete patient-clustering “on” wrapper template.
notebooks/template_patient_clustering_off.qmd Removes obsolete patient-clustering “off” placeholder template.
notebooks/template_giana.qmd Adds an early import os to prevent hidden dependency on other included notebooks.
notebooks/template_details_sample.qmd Adds the new sample-level details notebook wrapper including template_sample.qmd.
notebooks/template_details_patient.qmd Refocuses patient details to include GIANA/GLIPH2 content directly.
notebooks/template_details_compare.qmd Adds new comparison-level details notebook wrapper; includes overlap/sharing and points to patient report.
nextflow.config Renames report template params and removes patient-clustering on/off params.
nextflow_schema.json Renames/updates report template params and their descriptions.
Suppressed comments (1)

README.md:82

  • This bullet says including patient in --workflow_level renders the patient details notebook, but report generation is sample-centric and currently requires sample to be present. Wording should match actual behavior to avoid confusing users who run --workflow_level patient without sample.
- `--workflow_level` includes `patient` → renders `template_details_patient.qmd` (patient-level clonotype analysis)
- `--use_gliph2` → additionally includes GLIPH2 clustering in the patient details report

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
Comment on lines +72 to +74
| `template_details_sample.qmd` | `sample` | Detailed per-sample repertoire analysis |
| `template_details_compare.qmd` | `compare` | Detailed cross-sample / longitudinal comparison analysis |
| `template_details_patient.qmd` | `patient` | Patient-level clonotype clustering (GIANA, and GLIPH2 when `--use_gliph2`) |
Comment thread nextflow_schema.json
Comment on lines +135 to 138
"template_details_patient": {
"type": "string",
"description": "Path to patient-level clustering (GIANA/GLIPH2) notebook template, used when patient workflow_level is run."
"description": "Path to the patient-level details notebook template with GIANA/GLIPH2 clustering (rendered when the patient workflow_level is run)."
},
Comment thread notebooks/template_details_compare.qmd Outdated
Comment on lines +114 to +116
Patient-level clonotype clustering (GIANA and GLIPH2) is reported separately in
the **Patient Details** report (`template_details_patient.html`), which is
generated when `patient` is included in `--workflow_level`.
Comment on lines +211 to +213
// Patient-level details report (GIANA, plus GLIPH2 when --use_gliph2). Rendered
// whenever the patient stage ran; it does not depend on the compare stage.
if (levels.contains('patient')) {
Bulk HTML report rendering is gated on run_reports (levels.contains
'sample'); the README table/bullet, nextflow_schema.json descriptions,
the compare notebook's callout, and a code comment all implied the
compare/patient details reports render whenever compare/patient ran,
without the sample requirement. Flagged by Copilot in PR #100 review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants