# FrESH temperature characterization dataset and analysis code

This repository contains the data products and analysis scripts used for the temperature-characterization study of the FrESH droplet-freezing assay.

## Contents

### Data
The `data/` directory contains the anonymized input data required by the public analysis workflow. These files include:
- step-experiment input files used by `analyze_step.py`
- ramp-experiment input files used by `analyze_ramp-2.py`
- pooled freezing-temperature data used by `analyze_hotspot.py`
- window-definition files such as `step_windows.json` and `ramp_windows.json`

### Code
The repository includes three main analysis scripts:
- `analyze_step.py`: fits bath-to-well linear transfer functions from static step experiments and produces summary tables and figures.
- `analyze_ramp-2.py`: evaluates dynamic residuals during cooling-ramp experiments using the static transfer functions and produces binned residual summaries and figure outputs.
- `analyze_hotspot.py`: analyzes recurring spatial patterns in pooled freezing-temperature data and produces heatmaps, Moran's I statistics, and spatial summary tables.

## Expected repository structure

```text
.
├── data/
├── output/
├── analyze_step.py
├── analyze_ramp.py
└── analyze_hotspot.py
```

## Analysis workflow
Run the scripts in the following order:

1. `analyze_step.py`
   - Reads step-experiment data from `data/`
   - Builds bath-to-well transfer functions for each chiller and sensor
   - Writes summary tables and figure files to `output/`

2. `analyze_ramp-2.py`
   - Uses the static model summary generated by the step analysis
   - Reads ramp windows from `data/ramp_windows.json`
   - Computes dynamic residuals during full cooling ramps
   - Writes dynamic residual summaries and figure files to `output/`

3. `analyze_hotspot.py`
   - Reads `data/freezing_temps_pooled.csv`
   - Computes plate-position bias fields from pooled routine measurements
   - Writes spatial heatmaps, Moran's I results, and summary tables to `output/`

## Main outputs
Representative output files generated by the workflow include:
- `output/table_transfer.csv`
- `output/all_characterization_models.csv`
- `output/fig3_offset_RE1050.png`
- `output/fig3_offset_RP1845.png`
- `output/fig3_offset_condensed.png`
- `output/dynamic_residuals_ramps.csv`
- `output/dynamic_probe_summary.csv`
- `output/dynamic_uncertainty_summary.csv`
- `output/dynamic_binned_summary.csv`
- `output/fig4_dynamic_residuals_amt.png`
- `output/spatial_bias_heatmaps_4panel.png`
- `output/morans_i_results.csv`
- `output/spatial_bias_summary.csv`
- `output/spatial_ci_fields.csv`

## Scope of the deposited material
This deposit is intended to provide the anonymized data products and the exact public scripts needed to reproduce the temperature-characterization analyses reported in the associated manuscript. The repository supports the static step analysis, the dynamic ramp analysis, and the pooled spatial-bias analysis used to derive the operational temperature-correction framework and uncertainty characterization for FrESH.

## Manuscript context
The deposited material supports the study on temperature uncertainty characterization of the FrESH droplet-freezing assay, including the static bath-to-well calibration, the dynamic residual analysis during cooling ramps, and the empirical assessment of spatial variability across multi-well plates.
