Skip to content

Commit 2a559e7

Browse files
authored
Merge pull request #7 from PennLINC/add_qc_classifier
Post-replication fixes
2 parents 1a5f3f5 + 4d6ac8a commit 2a559e7

11 files changed

Lines changed: 487 additions & 827 deletions

File tree

reproducibility_guide/12_supplement.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supplemental Figures And Analyses
22

3-
This chapter documents the scripts and notebooks in `scripts/8_supplement` used to generate supplemental figures (S2-S16) and supporting supplementary tables.
3+
This chapter documents the scripts and notebooks in `scripts/8_supplement` used to generate supplemental figures (S2-S18) and supporting supplementary tables.
44

55
```{important}
66
Many supplemental analyses require the **full modeling run** across all configured microstructural metrics and quality covariates.
@@ -20,7 +20,7 @@ Before running supplement notebooks, make sure you have completed:
2020
- Assembled quality effects:
2121
- `data/quality_effects/quality_effects_all_outputs.rds`
2222

23-
In practice, this usually means running the modeling scripts in Chapter 8 without limiting to the main-text subset arrays.
23+
In practice, this usually means running the modeling scripts in Chapter 9 without limiting to the main-text subset arrays.
2424

2525
## Running supplement notebooks
2626

@@ -39,7 +39,7 @@ Or execute from CLI:
3939

4040
```bash
4141
cd "${PROJECT_ROOT}/scripts/8_supplement"
42-
for nb in FigureS2_S6.ipynb FigureS7_S9.ipynb FigureS10.ipynb FigureS11.ipynb FigureS12.ipynb FigureS13.ipynb FigureS14.ipynb FigureS15.ipynb FigureS16.ipynb; do
42+
for nb in FigureS2_S6.ipynb FigureS7_S9.ipynb FigureS10.ipynb FigureS11.ipynb FigureS12.ipynb FigureS13.ipynb FigureS14.ipynb FigureS15.ipynb FigureS16.ipynb FigureS17.ipynb FigureS18.ipynb; do
4343
"${PY_ENV}/bin/jupyter" nbconvert --to notebook --execute --inplace "$nb"
4444
done
4545
```
@@ -55,10 +55,10 @@ Outputs are written to `${PROJECT_ROOT}/figures/Supplement/FigureS*/`.
5555
- `FigureS12.ipynb`: cross-vendor correspondence of bundlewise age effects, pre/post harmonization, across all configured microstructural metrics.
5656
- `FigureS13.ipynb`: cross-metric age-effect correlation heatmap across all configured microstructural metrics.
5757
- `FigureS14.ipynb`: winner-take-all maximum quality-effect heatmap across all configured microstructural metrics and bundles.
58-
- `FigureS15.ipynb`: IQM covariance/correlation heatmap from harmonized data.
59-
- `FigureS16.ipynb`: FA/MD software comparison panels for batch, age, and quality effects.
60-
61-
`FigureS14_old.ipynb` and `FigureS15_old.ipynb` are legacy versions retained in the directory and are not part of the current supplemental figure workflow.
58+
- `FigureS15.ipynb`: full-dataset supplemental version of Figure 7 (batch mediation/sensitivity grid), with row-2 age-by-IQM scatters colored by scanner vendor and software version encoded as marker shape.
59+
- `FigureS16.ipynb`: IQM covariance/correlation heatmap from harmonized data.
60+
- `FigureS17.ipynb`: FA/MD software comparison panels for batch, age, and quality effects.
61+
- `FigureS18.ipynb`: supplementary panel combining vendor-stratified manual-vs-predicted scatter relationships with SHAP summary.
6262

6363
## Supplementary tables in `scripts/8_supplement`
6464

reproducibility_guide/7_replication_setup.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,36 @@ A computational environment must have the following packages (and dependencies):
7070
```
7171
install.packages(c(
7272
"arrow",
73+
"cowplot",
7374
"dplyr",
75+
"forcats",
7476
"fs",
7577
"gamm4",
78+
"ggpattern",
7679
"ggplot2",
80+
"grid",
81+
"hexbin",
7782
"IRkernel",
7883
"jsonlite",
84+
"knitr",
7985
"lme4",
8086
"mgcv",
87+
"nlme",
88+
"patchwork",
8189
"purrr",
8290
"readr",
8391
"remotes",
92+
"scales",
93+
"showtext",
8494
"stringr",
95+
"sysfonts",
8596
"systemfonts",
8697
"tibble",
87-
"tidyr"
98+
"tidyr",
99+
"tidyselect",
100+
"tidyverse",
101+
"tools",
102+
"viridis"
88103
))
89104
```
90105

@@ -134,4 +149,3 @@ To make that fallback reliable, launch Jupyter from the project root:
134149
cd "${PROJECT_ROOT}"
135150
"${PY_ENV}/bin/jupyter" lab
136151
```
137-

scripts/1_munge_data/munge_data.R

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,28 @@ final_output_file <- fs::path(output_dir, "merged_data.parquet")
9797
# AutoTrack bundle geometry metrics to extract from bundlestats files
9898
shape_metrics <- c(
9999
"bundle_name",
100+
"number_of_tracts",
101+
"mean_length_mm",
102+
"span_mm",
103+
"curl",
104+
"elongation",
105+
"total_volume_mm3",
100106
"1st_quarter_volume_mm3",
101107
"2nd_and_3rd_quarter_volume_mm3",
102108
"4th_quarter_volume_mm3",
109+
"total_surface_area_mm2",
110+
"total_radius_of_end_regions_mm",
111+
"total_area_of_end_regions_mm2",
112+
"irregularity",
103113
"area_of_end_region_1_mm2",
114+
"radius_of_end_region_1_mm",
115+
"volume_of_end_branches_1",
104116
"area_of_end_region_2_mm2",
105-
"curl",
106-
"elongation",
107-
"irregularity",
108-
"mean_length_mm",
109-
"number_of_tracts",
110-
"span_mm",
111-
"total_volume_mm3"
117+
"radius_of_end_region_2_mm",
118+
"volume_of_end_branches_2"
112119
)
113120

121+
114122
# Scanner QC columns that should be treated as numeric
115123
qc_numeric_cols <- c(
116124
"raw_dimension_x", "raw_dimension_y", "raw_dimension_z",

scripts/6_figures/Figure4.ipynb

Lines changed: 47 additions & 29 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)