<\!DOCTYPE html> IPAA QoL Pipeline — Holubar Lab
Holubar Lab — Research Toolkit

IPAA QoL Pipeline

Reusable, cohort-agnostic pipeline for processing IPAA Quality-of-Life survey data → AMA-styled tables + figures.

You're authenticated. Magic-link gated. This page documents the reusable IPAA QoL Pipeline (Python source under SDH Research Toolkit/IPAA QoL Pipeline/) — what it does, how to consume it, and the reference papers it's anchored against.

Reusable, cohort-agnostic pipeline for processing IPAA Quality-of-Life (QoL) survey data and producing AMA-styled tables + figures for manuscript submission.

Author: Stefan D. Holubar Lab, Cleveland Clinic Status: in development (Phase 3 of /trilogy tps_qol, 2026-04-27) License: internal use only (not yet open-sourced)

---

What it does

Takes raw QoL survey xlsx exports (e.g., from Cleveland Clinic ileal pouch registry) → produces:

All output is config-driven, so the same code base serves any IPAA QoL study using the Cleveland Clinic Pouch Survey instrument.

Reference instruments supported

To support a different instrument, copy qol_pipeline/config.py defaults and override the InstrumentConfig fields.

Reference papers (output schema anchors)

Paper Role
Holubar et al. 2025 (in preparation)Primary anchor for within-cohort Before vs After tables
Maspero, Lavryk, Holubar et al. BJS 2023 (PMID 37535972)Primary anchor for cross-sectional PSM-matched cohort comparison
Lavryk, Stocchi, Holubar et al. J Gastrointest Surg 2019 (PMID 30097964)Methodological precedent for trajectory + multivariate factor analyses

Folder structure


IPAA QoL Pipeline/
├── README.md
├── .gitignore
├── Scripts/
│   └── qol_pipeline/                # main package
│       ├── __init__.py
│       ├── config.py                # InstrumentConfig dataclass
│       ├── load_qol.py              # xlsx → tidy DataFrame
│       ├── classify.py              # fu_period → before/after/context
│       ├── derive.py                # CGQLI + composites
│       ├── stats.py                 # Wilcoxon, Chi-sq, paired-t, McNemar
│       ├── tables.py                # within_cohort + cross_sectional builders
│       ├── figures.py               # CONSORT + waterfall plots
│       └── docx_writer.py           # AMA-styled docx output
├── templates/
│   ├── T1_pouch_survey_items.docx   # static instrument-reference table
│   └── ama_table_style.json         # 12/6/12 border spec
├── validation/
│   ├── holubar_2025_anchors.json    # ground-truth from published paper
│   └── test_ali_reproduces_published.py
├── examples/
│   └── ali_qol_demo.py              # worked example using Ali QoL data
└── z.txt

Usage (consumer perspective)

From a TPS-style consumer project:


import sys
from pathlib import Path
SANDBOX = Path("/Volumes/T1 Claude/000 Claude Sandbox")
sys.path.insert(0, str(SANDBOX / "IPAA QoL Pipeline" / "Scripts"))

from qol_pipeline import load_qol, classify, derive, tables, figures, docx_writer
from qol_pipeline.config import InstrumentConfig, CLEVELAND_POUCH_SURVEY

# 1) Load
df = load_qol.load_qol(
    xlsx_path="path/to/cohort_qol.xlsx",
    instrument_config=CLEVELAND_POUCH_SURVEY,
    cohort_name="My Cohort",
)

# 2) Classify before/after
df = classify.add_before_after(df, CLEVELAND_POUCH_SURVEY)

# 3) Derive CGQLI
df = derive.add_cgqli(df, CLEVELAND_POUCH_SURVEY)

# 4) Build tables
within = tables.within_cohort_table(df, cohort_name="My Cohort")
cross = tables.cross_sectional_table(df_a, df_b, name_a="Group A", name_b="Group B")

# 5) Render docx
docx_writer.write_docx(tables=[within, cross], out_path="QoL Tables.docx")

Adding a new IPAA QoL study (future-proofing)

  1. Drop the QoL xlsx into your study's project folder
  2. Inspect schema vs Ali's xlsx (likely same Cleveland registry export — but verify column names)
  3. If columns differ, add a new ColumnMapping to qol_pipeline/config.py or pass an override
  4. Write a thin driver script analogous to A Fellows/Shah/TPS/QoL/Scripts/run_tps_qol.py
  5. Run; outputs land in your study's Data/ and the AMA-styled tables in <Study> QoL Tables.docx

Validation

The pipeline includes a regression test (validation/test_ali_reproduces_published.py) that runs against Ali's QoL data and asserts the output matches Holubar 2025 anchor rows within tolerance. Run this whenever you change classify.py, derive.py, or stats.py.

Status (as of 2026-04-27)

For questions, additions, or onboarding help — email Stefan directly:

webmaster@holubarlab.org