# Data for: Self-Organization Through Local Cell-Cell Communication Drives Intestinal Epithelial Zonation

Processed spatial transcriptomics data for every figure in the paper, plus the code
needed to regenerate them.

**Start with `RECONSTRUCT.md`** — several files are split into parts and must be
reassembled before use.

Code: https://github.com/nitzanlab/Self-Organization-Through-Local-Cell-Cell-Communication-Drives-Intestinal-Epithelial-Zonation

## What is here

| | |
|---|---|
| `raw.zip` | monolayer transcript tables, nuclei segmentation, cell-by-gene matrices |
| `unperturbed.zip` | unperturbed monolayer (seqFISH), incl. precomputed erosion masks |
| `sprinkled.zip` | cell transplantation, 12 hr and 72 hr, per ROI |
| `sprinkling_nov_23.zip.part*` | cell transplantation, November 2023 series |
| `perturbations.zip` | pharmacological perturbation experiments |
| `background_nov23_12hr_roi2.tiff` | stitched background image |
| `background_nov23_72hr_roi1.tiff.part*` | stitched background image |
| `background_pasadena_roi1.tiff.part*` | stitched background image |
| `intestinal_monolayer_spatial_data.zip` | monolayer spatial data |
| `RECONSTRUCT.md` | how to reassemble, unzip and lay out everything |

Files above ~3 GB are uploaded as `.part` pieces because single uploads that large do
not complete reliably. `cat <name>.part* > <name>` rebuilds each one; `RECONSTRUCT.md`
gives the exact commands and an MD5 for each reassembled file.

The three background images retain only the channels the figures read (acquisition
channel 3 for pasadena, channels 2 and 3 for the two nov23 images), which is why they
are smaller than the original acquisitions. The full multi-channel acquisitions are
available from the corresponding authors on request.

## Two datasets are not included

Published by others, not redistributed here. `RECONSTRUCT.md` says where to put them.

1. **Moor et al. 2018**, Cell 175(4):1156-1167 — `table_A_LCM_TPM_values.tsv` and
   `table_D_zonation_reconstruction.tsv` → `in_vivo_villus_data/`
   Used by Figure 1 (in vivo comparison) and Figure 5 (in vivo EphA2).
2. **Mouse Visium HD**, GEO accession GSE303705 → `mouse_visium/`
   Used by Figure 2 (scale invariance).

## Running the analysis

Point the code at the directory holding the reassembled data:

    export ZONATION_DATA_DIR=/path/to/this/directory

or edit `HOME_DIR` in `utils/constant.py`. Then:

    from paper.plotScripts.plotALL import plot_all_figures
    plot_all_figures()

Output lands in `paper/graphs/`, one subdirectory per figure.

## A note on cloud storage

If you stage this data on Google Drive or Dropbox, verify it is really present before
running: both serve placeholder files that read as empty and make the analysis fail in
confusing ways.

    find "$ZONATION_DATA_DIR" -type f | while read -r f; do
      [ ! -s "$f" ] && echo "EMPTY:    $f"
      [ "$(stat -f '%b' "$f")" = "0" ] && echo "DATALESS: $f"
    done

No output means everything is materialised.
