Single-cell spatial transcriptomics of inherited retinal degeneration reveals broad and focal organization of disease responses
This repository contains the analysis and plotting code for Figs. 1–4 and Supplementary Figs. S1–S5 for this manuscript.
| Directory | Contents |
|---|---|
figure_1/code/ through figure_4/code/ |
Main figure scripts |
figure_1_supp/code/, figure_2_supp/code/, figure_3_supp/code/ |
Supplementary Figs. S1–S3 scripts |
figure_4_supp_1/code/, figure_4_supp_2/code/ |
Supplementary Figs. S4-S5 scripts |
_shared/code/ |
Code shared by multiple scripts |
preprocessing/ |
Code for preprocessing data |
Create a Python environment, then install the required dependencies:
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtRaw and preprocessed data is deposited on Zenodo* at the following link: https://doi.org/10.5281/zenodo.22767514.
Download and unzip the Zenodo data deposit, then set DATA_DIR:
export DATA_DIR=/path/to/retina_spatial_paper_data*See the Zenodo README for more detailed information on the contents of the deposit.
From preprocessing/, run the scripts in this order:
python build_cell_typing.py
python build_arc_columns.py
python build_per_cell_gene_counts.py
python build_all_rods.py
python export_transcript_subsets.py
python build_ds8_cache.py
python ../figure_1/code/Fig1b_00_compute_harmony.pyNotes: The cell segmentation masks and the trained U-Net model and layer predictions are already provided in the Zenodo deposit for convenience. To regenerate them:
- Run
build_segmentation.pyfor regenerating the cell segmentation - Run the scripts in
preprocessing/unet/for regenerating the U-Net model (predict_unet_layers.pyapplies the existing trained model)
Run each script from its own code/ directory:
cd figure_1/code
python Fig1a.pyNotes on the order to run scripts:
- Run Fig. 3 scripts before Fig. 4 and Supplementary Fig. 3, as some scripts require Fig. 3 outputs.
- Within Fig. 4, run
Fig4a.pyfirst, as it produces the rod injury response score used by the subsequent scripts.