This repository details the steps needed to reproduce the analysis described in the publication:
This repository contains code and notebooks to reproduce the analyses for CCF medication effects across transcriptomics and proteomics. The work focuses on:
- Medication family effects (each drug family vs "No Medication")
- Disease severity effects (remission vs active) within subpopulations
- Aggregation utilities and plotting helpers for downstream interpretation
Analyses are implemented as both notebooks and reproducible command-line scripts.
If you use this code or the derived results, please cite the associated study and this repository. A related multi-omics analysis framework and structure is inspired by:
- SPARC Multiomics analysis repository:
https://github.com/enveda/sparc-multiomics/tree/main. See the SPARC repo README for an example of reproducibility structure and reporting.
When replicating the project, we are unable to disclose the real data, as it was provided by the Chron's and Colitis Foundation and is not open source. In such cases, notebooks indicate inputs and expected outputs to enable you to follow the processing logic.
Dependencies are managed with Poetry.
- Install Poetry (see
https://python-poetry.org/docs/) - From the repository root, run:
poetry install - Use Python 3.10 as specified in
pyproject.toml
Optional developer tooling: ruff, black, pytest are included in the dev group.
We outline input expectations and how to reproduce key analyses either via notebooks or via scripts.
Numbered prefixes indicate run order. Start with data preparation, then modeling, then downstream analysis/figures.
-
Notebooks (recommended order):
0_data_prep.ipynb— prepare processed dataframes and feature lists1_metadata_analysis.ipynb— exploratory metadata QC and plots- Run Scripts
3_analysis/...— aggregation, significance tables, visualizations4_paper_plots/...— final figure generation
-
Scripts (align with notebook numbering):
scripts/2.1_run_modeling_med_vs_no_med.py— medication vs no medication analysisscripts/2.2_run_modeling_rem_vs_active.py— remission versus active disease analysis
Minimal run path if you have processed inputs:
- Run
0_data_prep.ipynb(or ensuredata/processed_dataframes/*exist) - Run one or both scripts depending on the goal
- Run downstream notebooks in
3_analysis/and4_paper_plots/
Expected processed inputs are under data/processed_dataframes/:
transcriptomics_dataframe.parquetproteomics_dataframe.parquettranscriptomics_dataframe_remission.parquettranscriptomics_dataframe_active.parquetproteomics_dataframe_remission.parquetproteomics_dataframe_active.parquettranscriptomics_gene_cols.txt(one feature per line)proteomics_protein_cols.txt(one feature per line)
Outputs are written under data/results/ in the following subfolders:
med_vs_no_med/transcriptomics/andmed_vs_no_med/proteomics/rem_vs_active/transcriptomics/andrem_vs_active/proteomics/- Aggregated result tables are written as parquet files, e.g.:
med_vs_no_med→agg_med_vs_no_med_transcriptomics_results.parquet,agg_med_vs_no_med_proteomics_results.parquetdisease_severity→agg_rem_vs_active_transcriptomics_results.parquet,agg_rem_vs_active_proteomics_results.parquet
Directory paths and filenames are centralized in ccf_medication/constants/pathing.py and ccf_medication/constants/tables.py.
Notebooks in notebooks/ mirror the scripted analyses and exploratory data analysis. Since raw data cannot be shared, notebooks document start and end points so you can follow transformations, filtering, and modeling set-up.
Two primary entry points reproduce the core modeling results. Run them from the repo root with Poetry.
- Medication vs No Medication (per drug family)
- Script:
scripts/2.1_run_modeling_med_vs_no_med.py - Purpose: Mixed-effects modeling comparing each medication group (e.g. TNF-α inhibitors) vs "No Medication" across transcriptomics and proteomics, split by relevant subpopulations (diagnosis, tissue for transcriptomics).
- Example:
poetry run python scripts/2.1_run_modeling_med_vs_no_med.py
- Outputs:
- Per-split CSVs for fold-changes under
data/results/med_vs_no_med/* - Aggregations saved to
data/processed_dataframes/agg_med_vs_no_med_*.parquet
- Per-split CSVs for fold-changes under
- Disease Severity (Remission vs Active)
- Script:
scripts/2.2_run_modeling_rem_vs_active.py - Purpose: Mixed-effects modeling of
remissionvsactiveseverity within each split and drug family; also aggregates per-split results. - Example:
poetry run python scripts/2.2_run_modeling_rem_vs_active.py
- Outputs:
- Per-split CSVs saved under
data/results/rem_vs_active/* - Aggregations saved to
data/processed_dataframes/agg_rem_vs_active_*.parquet
- Per-split CSVs saved under
Implementation details live in ccf_medication/models/calls.py (e.g., run_me_model_analysis, helpers) and ccf_medication/models/mixed_effects.py.
ccf_medication/constants/: paths, thresholds, labels, plotting mapsmodels/: mixed effects modeling, significance, orchestrationplotting/: heatmaps, volcano and strip plots, utilitiesutils/: loading, file validation, general helpers
scripts/: reproducible CLI entry points for analysesnotebooks/: exploratory and paper-figure notebooksdata/: processed inputs and results (not versioned raw data)
- SPARC Multiomics repository (much of the data preprocessing comes from this repo):
https://github.com/enveda/sparc-multiomics/tree/main
The results here are partly based on data from the Crohn’s & Colitis Foundation’s IBD Plexus platform and SPARC IBD cohort. We thank the Foundation and participating patients and sites.
This project is licensed under the terms of the LICENSE file included in this repository.
