Test 08 - Age of Flagged Analysis
Purpose
Generate age and temporal analyses for flagged cases/controls across specified cohorts. Produces graphs and statistics for cases and controls stratified by cohorts defined in the COHORTS environment variable.
Required Inputs
From configs/env.sh and the test invocation environment:
WORK_DIR: Working folder where outputs will be writtenFIRST_WORK_DIR: Reference run (contains rep and bootstrap JSON)COHORTS: A pipe-separated list of cohort definitions; each item should bename=featureswherefeaturesis a filter string understood byFilterSamples/bootstrap- Optional:
ALT_PREDS_PATHfor comparator comparisons
How to Run
From your TestKit folder, execute:
Or include as part of the full suite:
Outputs are stored under ${WORK_DIR}/age_of_flagged.
What This Test Does
- If
ALT_PREDS_PATHis not set, prints a message noting comparator comparisons will be skipped. - For each cohort listed in
COHORTS:- Uses
FilterSamplesto create cohort-specific prediction files${WORK_DIR}/bootstrap/<cohort_name>.predsif not present. - Invokes
age_of_flagged.py(a Python helper) to compute and plot age distributions and other temporal statistics for the given cohort; outputs go under${WORK_DIR}/age_of_flagged.
- Uses
Output Location
- Per-cohort age analysis:
${WORK_DIR}/age_of_flagged(HTML or image outputs and supporting data files) - Per-cohort prediction files used as input:
${WORK_DIR}/bootstrap/<cohort>.preds
How to Interpret Results
- Open the plots in
${WORK_DIR}/age_of_flaggedto inspect age distributions among flagged (predicted high-risk) patients and controls. - Compare cohort-specific plots to check consistency (e.g., older average age in one cohort may indicate selection bias).
Common failure modes and suggestions
- Misformatted
COHORTSvariable:- Ensure
COHORTScontains entries likecohortName=featureFilterseparated by|.
- Ensure
- Missing
FilterSamplesorage_of_flagged.pyhelper scripts:- Ensure the referenced helpers are available under
${CURR_PT}/resourcesor on PATH.
- Ensure the referenced helpers are available under
- Missing input predictions or samples:
- Confirm
${WORK_DIR}/bootstrap/eligible_only.predsexists and prediction files referenced by${FIRST_WORK_DIR}are present.
- Confirm
Test Results Review
Primary files to inspect after running this test:
${WORK_DIR}/age_of_flagged/*(per-cohort graphs)